Skip to content
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

Inline highlighted code within a header generates invalid LaTeX #5574

Closed
mpark opened this issue Jun 11, 2019 · 3 comments
Closed

Inline highlighted code within a header generates invalid LaTeX #5574

mpark opened this issue Jun 11, 2019 · 3 comments

Comments

@mpark
Copy link

mpark commented Jun 11, 2019

pandoc 2.7.2

The following Markdown:

# `foo`{.cpp}

generates:

\hypertarget{foo}{%
\section{\texorpdfstring{\VERB|\NormalTok{foo}|}{foo}}\label{foo}}

and attempting to produce a PDF results the following error:

Error producing PDF.
! TeX capacity exceeded, sorry [parameter stack size=10000].
\@ifundefined #1->
                  \ifcsname #1\endcsname \@ifundefin@d@i \else \@ifundefin@d...
l.90 ...|\NormalTok{foo}|}{foo}}\label{foo}}
mpark added a commit to mpark/wg21 that referenced this issue Jun 12, 2019
@jgm jgm closed this as completed in bec95c9 Jun 12, 2019
mpark added a commit to mpark/wg21 that referenced this issue Jun 12, 2019
On OS X, Homebrew is already building 2.7.3.
On Linux (e.g., Ubuntu), manual installation is required anyway.

This version includes the following bug fixes we care about:
  - jgm/pandoc#5529
  - jgm/pandoc#5574
  - jgm/skylighting#76
  - jgm/skylighting#77
mpark added a commit to mpark/wg21 that referenced this issue Jun 13, 2019
mpark added a commit to mpark/wg21 that referenced this issue Jun 14, 2019
@mpark
Copy link
Author

mpark commented Jun 14, 2019

@jgm: I looked into this a bit. The following workaround seems to work:

\hypertarget{foo}{%
\section[foo]{\VERB|\NormalTok{foo}|}\label{foo}}

I guess this could be a decent workaround:

\hypertarget{foo}{%
\section[\texttt{foo}]{\VERB|\NormalTok{foo}|}\label{foo}}

On the other hand, I wonder whether the \VERB environment is all that useful now that most special characters are escaped by jgm/skylighting@1832ce0 anyway. Is it possible to simply use \texttt for even for highlighted inline code?

@Wandmalfarbe
Copy link
Contributor

Wandmalfarbe commented Jun 14, 2019

I just want to add that it compiles perfectly without the language tag:

  1. # `foo`{.cpp}: Error
  2. # `foo`: Ok
  3. # `foo`{.cpp} with --listings: Error
  4. # `foo` with --listings: Ok

@mpark
Copy link
Author

mpark commented Jun 14, 2019

@Wandmalfarbe: Yes, that works today because raw verbatim code produces \texttt{...}. The highlighted code is produced by skylighting with \VERB|...|, including a "language tag" such as `foo`{.default}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants