Clone wiki

Publy / FAQ

If your question is not listed, please ask the mailing list:

How does Publy render LaTeX equations?

Publy handles LaTeX formulas by leaving them untouched in the HTML, so that MathJax can render them when people view the website. The standard header file included with Publy (data/defaultHeader.html) includes the following JavaScript to load and configure MathJax:

<!-- Include MathJax to convert LaTeX formulas to HTML on the fly -->
<script type="text/x-mathjax-config">
    tex2jax: {
      inlineMath: [['$','$'], ['\\(','\\)']],
      processEscapes: true
    "HTML-CSS": { scale: 90 }
<script src="" async></script>

In addition, by default, Publy tells MathJax to not process the abstract text, since it is typically hidden initially (this speeds up page load). It is then processed when necessary by the following JavaScript, found in data/base.js:

// Toggles abstract. Input: .abstract-container 
function toggleAbstract(abs) { 

    // Render the math in here, if necessary 
    if (abs.hasClass("tex2jax_ignore")) { 
        MathJax.Hub.Queue(["Typeset", MathJax.Hub, abs.get(0)]);