5

I use the even theme.

$$
L=\sum_{(u,v)\in D} \log {\exp(-d(u,v))}
$$

and

$$
-\log {\sum_{v' \in N(u)} \exp(-d(u,v'))}
$$

works but when I combine the two,

$$
L=\sum_{(u,v)\in D} \log {\exp(-d(u,v))}-\log {\sum_{v' \in N(u)} \exp(-d(u,v'))}
$$

It is not outputted as latex. Debugging this thing is also time consuming.

1
  • 1
    This is an annoying bug in the default BlackFriday parser used by Hugo for Markdown. See here. Sep 9, 2019 at 11:56

1 Answer 1

8

Many markdown processors use the underscore (_) to indicate italics (one at the beginning and one at the end of the text to be italicized). So when your math contains two underscores, Markdown removes them and inserts <em>...</em> tags (or something equivalent to that) before sending the page to the browser. MathJax doesn't process math that contains HTML tags, so the resulting (modified) math is not typeset.

The usual solution is to use a backslash to prevent the underscore from being processed by Markdown, so use \_ in place of _ in your math. You may also need to double some backslashes (e.g., \\ may need to be entered as \\\\ in a Markdown document).

See the MathJax documentation on LaTeX in HTML documents for more details (look for the paragraphs on Markdown).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.