-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Markdown to PDF: "header-includes" content corrupted #9953
Comments
Pandoc
Meta
{ unMeta =
fromList
[ ( "header-includes"
, MetaBlocks
[ RawBlock (Format "tex") "\\makeatletter\n\\let\\old@"
, Para
[ Str "verbatim@font="
, RawInline (Format "tex") "\\verbatim"
, Cite
[ Citation
{ citationId = "font"
, citationPrefix = []
, citationSuffix = []
, citationMode = AuthorInText
, citationNoteNum = 1
, citationHash = 0
}
]
[ Str "@font" ]
, SoftBreak
, RawInline
(Format "tex")
"\\def\\verbatim@font{%\n\\fontsize{10}{12}%\n\\old@verbatim@font\n}"
, SoftBreak
, RawInline (Format "tex") "\\makeatother"
]
]
)
]
}
[] And now we can see what is happening. It's not an intended change. Note that you can work around this by enclosing the raw LaTeX in
(see |
Possibly relevant item from pandoc 3.1.12.3 changelog:
Not that this really explains what is happening. |
Thanks for the hint about the workaround which appears to work as you suggest:
If there is anything else I can do to help resolve the unintended change please let me know. |
There seems to be a regression in pandoc 3.2.1 compared to 3.1.11.1 with the handling of header-includes when converting from markdown to PDF. Take a file (test.md) with the following Markdown content:
To convert this to PDF, I run the following command:
pandoc test.md -o test.pdf
If I use pandoc 3.1.11.1 this completes without any issue. However, version 3.2.1 flags an error:
Inspection of the tex output produced by the
--verbose
pandoc option shows what's happening. When pandoc 3.1.11.1 is used, the header-includes content appears in the output exactly as specified in the markdown file. However, when pandoc 3.2.1 is used the tex output becomes:The errant line break after
\let\old@
is the cause of the LaTeX error. I also note that\makeatother
is no longer on a line by itself.Both pandoc versions in use are from binary tarballs downloaded from the pandoc project downloads page. They are running under Linux. LaTeX comes from TeXLive 2023.
Does this behaviour come about due to a regression, or has pandoc 3.2 introduced a change in the way header-includes must be specified?
The text was updated successfully, but these errors were encountered: