curiositry/mnml-ghost-theme

inline math

abhayghatpande opened this issue · 3 comments

Hi,

How to type inline math with the Katex?

One way I was typing math, was to use code injection (on Ghost Pro). In the head, I included the snippet:

<script type="text/javascript"
  src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Then, I could use (almost) standard MathJax syntax to include math: [ ... ] or $$ ... $$ for display math and ( ... ) for inline math.

But if I apply mnml theme, the math elements get scroll bars around them. And I don't know how to modify the theme for Pro usage.

I have other questions about using the theme for Pro, such as how to create navigation, but will create a separate issue for that.

Hey @abhayghatpande. Thanks for your question, and sorry for the delay. This issue is that Ghost parses anything in an inline element as markdown, and ignores the content of block level elements. That’s why I use <section> tags for block level math — if I use an inline element, or even if I use a block level element inline, Ghost will parse the math as markdown before KaTeX can typeset it.

I have asked (on the Ghost Slack chat) if there’s a way to get the Ghost markdown parser to ignore a particular inline HTML element, and am awaiting a response. I’ll keep you posted!

(if there isn’t a way to get Ghost not to parse the content of inline elements as markdown, I’ll look into other solutions…)

parrt commented

Any movement on getting inline katex? thanks!

@parrt Unfortunately, no :/

(But if you find a good solution, by all means submit a pull-request!)