Witiko / markdown

:notebook_with_decorative_cover: A package for converting and rendering markdown documents in TeX
http://ctan.org/pkg/markdown
LaTeX Project Public License v1.3c
332 stars 31 forks source link

Error rendering math with certain combination of package options #527

Closed nopria closed 2 weeks ago

nopria commented 2 weeks ago

The following MWE (I just updated all TeXLive packages)

\documentclass{book}
\usepackage[hybrid, underscores=false, superscripts]{markdown}

\begin{document}
Outside markdown: before math $r^2/l_s^2>1$ after math.

\begin{markdown}
Inside markdown: before math $r^2/l_s^2>1$  after math.
\end{markdown}
\end{document}

gives the error

! Missing $ inserted.
<inserted text> 
                $
l.2 ... math $r\markdownRendererSuperscript{2/l_s}
                                                  2>1$  after math.\markdown...

The error shows up only with both options underscores=false, superscripts are used (in addition to hybrid which is necessary to render math inside markdown); if only one or none of such options are used, the error disappears.

However, an easy workaround is to add a space in the formula:

$r^2 /l_s^2>1$

nopria commented 2 weeks ago

The problem is solved by using texMathDollars option.