-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
PDF generation from Markdown fails when a code block is written into an Alert #10641
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
Comments
This works fine for me without the custom template, so the issue has to do with the custom template you're using. Do you run into the problem with just the code block (without the alert)? If so, then I suspect your custom template is missing things needed for highlighting. If not, then I'm not sure, but it's impossible to say without seeing the template. |
Before reporting back here, please do what you can to debug this on your own. Test with an alert without a code block. Compare your custom template to the default template to see what might be missing. And see if the person who wrote your custom template (if it wasn't you) can help. |
I can write both code blocks and alerts in my document with no problem, the crash specifically happens when I put a code block inside an alert. When you talk about default template, do you mean the template used by Pandoc when no template is provided, or do you refer to the templates in this repository ? I will continue to debug this on my own, thank you for your time. |
These should be the same (unless you have overridden the default template in your user data directroy). You can get the default template using |
I think I found the problem : There's nothing wrong with Pandoc as far as I can tell, nor with the template.
Into this (with the
The problem is that the |
You can see how pandoc parses this by doing:
Clearly this isn't what was desired. If you modify the python program to produce
then you might be getting closer. But a better solution would be to use a Lua filter (see #9821 ). |
The filter in #9821 is actually just for PDF via typst, but you could modify it easily enough for PDF via LaTeX. |
Uh oh!
There was an error while loading. Please reload this page.
Pandoc 3.6.3 on Ubuntu 24.04.01 LTS
Doing this kind of Markdown (code block inside an alert) makes the generation fail :
The error message :
Are we supposed to be able to do that, or is it me who is trying to do something that is not supposed to happen ?
With regards
The text was updated successfully, but these errors were encountered: