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

Error producing PDF with **#;** #4939

Closed
Wandmalfarbe opened this issue Sep 29, 2018 · 4 comments
Closed

Error producing PDF with **#;** #4939

Wandmalfarbe opened this issue Sep 29, 2018 · 4 comments

Comments

@Wandmalfarbe
Copy link
Sponsor Contributor

Original issue here: Wandmalfarbe/pandoc-latex-template#60

Steps to Reproduce

  1. Create a .md file with contents

    **`#;`**
  2. Run pandoc example.md -o example.pdf --from markdown --template default --listings

The Error

Error producing PDF.
! Illegal parameter number in definition of \reserved@a.
<to be read again>
                   ;
l.327 \textbf{\passthrough{\lstinline!#;!}}
@jgm
Copy link
Owner

jgm commented Sep 29, 2018 via email

@Wandmalfarbe
Copy link
Sponsor Contributor Author

It seems that \passthrough is the culprit here. A bit of googling shows that it might has to do with something called fragile and robust commands. But I'm no expert at that.

When I remove the \passthrough, the inline listing is bold. That is propably not the best way to change the font weight of an inline listing, but it works nontheless.

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
  This is the example: \passthrough{\lstinline!#;!}
\item
  This is the example: \textbf{\lstinline!#;!}
\end{enumerate}

screenshot 2018-09-30 12 29 49

@Wandmalfarbe
Copy link
Sponsor Contributor Author

Wandmalfarbe commented Dec 23, 2018

After a bit of digging I think I found the solution. Commit 730796e introduced \passthrough to fix a problem with escaping in the lstinline environment. The mentioned characters %{}\ are always escaped and the environment is wrapped into the dummy environment passthrough.

The listings documentation states in section 4.1 that the character # needs to be escaped too. So adding the character to the list of escaped characters might fix this issue.

@jgm jgm closed this as completed in 2e7cfe1 Jan 26, 2019
@jgm
Copy link
Owner

jgm commented Jan 26, 2019

@Wandmalfarbe you were exactly right.

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