-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable latex_macros for output writers #9677
Comments
Can you expand on this? How are you rendering this md document?
The expansion takes place in the reader. By the time the writer gets it, it has already been expanded and there is nothing the writer can do to "unexpand" it. So, this needs to be a reader extension. |
I was using
But this will not work correctly, because the
Ok, I understand. I was more thinking about a "readable" command line, ignoring the inner workings of pandoc. I still think it would be nice if the result in the markdown file would look like
instead of
so that the latex macros won't get ignored when rendering the markdown. |
Right. I guess that's something I hadn't considered in telling the Markdown writer to use the raw attribute syntax. We could (a) in the markdown writer, avoid using the raw attribute syntax, at least for macro definitions, or (b) in the markdown reader, process macros even when in raw blocks. |
From a user perspective I would choose option (a), because it leads to a simpler markdown file. |
Note that you can always turn off the raw attribute extension: |
blocks, unless there is no other option. Mainly this is motivated by #9677. If we put raw tex in a raw_attribute block, then the macros don't get interpreted when it is read again by pandoc's markdown reader.
I've changed the writer so it doesn't use |
At the moment the extension
latex_macros
can only be activated for input readers (https://pandoc.org/MANUAL.html#latex-macros). As far as I can see it is active by default e.g. formarkdown
andlatex
. However when converting the followingtest.tex
from latex to markdown
test.md
viathe latex macros get expanded although that would not be necessary (because
latex_macros
extension is active formarkdown
by default):I figured out, that one can prevent the expansion of the latex macros by using the input format
latex-latex_macros
likewhich results in
However this won't render correctly.
So my suggestion would be to not extend latex macros if the output format has explicitily activated the extension
latex_macros
, e.g.This could also be done for HTML output like
because mathjax supports latex macros, too : https://docs.mathjax.org/en/latest/input/tex/macros.html .
The text was updated successfully, but these errors were encountered: