rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.76k stars 1.27k forks source link

latex macros not working in \equation{} environment #123

Closed dahtah closed 8 years ago

dahtah commented 8 years ago

pandoc supports directly defining Latex macros directly in the markdown, e.g. \newcommand{\a}{\mathcal{alpha}} This works fine in bookdown, as long as one uses the $$ syntax, but not when using the \equation syntax, meaning it's not possible to have a numbered equation with a macro in it. The reason as far as I can tell is that pandoc expands the macros directly when outputting html, but only when the math appears between $$. I guess a possible workaround is to also copy all the macros into an html preamble, but it is cumbersome. It would be great to have a unified mechanism.

yihui commented 8 years ago

I think it makes more sense to file a feature request to Pandoc: https://github.com/jgm/pandoc

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.