Closed mpark closed 5 years ago
Also the case within title
:
---
title: "`foo_bar`{.cpp}"
---
Generated LaTeX:
$ pandoc foo.md --to latex --self-contained
# ...
\title{\VERB|\NormalTok{foo_bar}|}
\date{}
\begin{document}
\maketitle
Problem generating PDF:
$ pandoc foo.md --output foo.pdf
Error producing PDF.
! Missing $ inserted.
<inserted text>
$
l.91
In both cases, escaping the _
in the LaTeX source seems to solve the problem.
To be clear: this is not generally a problem, it just occurs when the highlighted code is embedded in strikeout or occurs in a title (perhaps other contexts as well, but in most contexts this works).
Yep, I've updated the title. It seems like verb
has trouble being passed to other commands: https://truonglatex.wordpress.com/2011/07/26/stack-size-limit-error-with-hyperref/
Seems like this may have been the cause in #5574.
I'll transfer this to skylighting, since the escapes need to be added there. (I found some other missing escapes too.)
pandoc 2.7.3
Given:
Generated LaTeX:
Problem generating PDF: