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

LaTeX writer produces erroneous output for striked out code with highlighting #1294

Closed
bjpe opened this issue May 12, 2014 · 0 comments
Closed

Comments

@bjpe
Copy link
Contributor

bjpe commented May 12, 2014

Hi,

I just discovered that the LaTeX writer of the current pandoc-1.12.4 produces erroneous LaTeX code for striked out, highlighted code.

The example file:

~~`void run`~~

`void run`{.java}

~~`void run`{.java}~~

Now pandoc complains:

$ pandoc -o sout.pdf sout.md
! Extra }, or forgotten \endgroup.
\UL@stop ... \UL@putbox \fi \else \egroup \egroup
                                  \UL@putbox \fi   \ifnum \UL@...
l.76 ...\VERB|\DataTypeTok{void} \NormalTok{run}|}

pandoc: Error producing PDF from TeX source

To debug this problem, I tried to convert the file to LaTeX. While the
first two lines are okay, the third line gets translated to

\sout{\VERB|\DataTypeTok{void} \NormalTok{run}|}

for which pdflatex complains the above mentioned error. I manually
extended the LaTeX code by addind a \mbox{...} wrapper to

\sout{\mbox{\VERB|\DataTypeTok{void} \NormalTok{run}|}}

which works fine (adding \text{...} also works). Unfortunately, my LaTeX expertise
is limited, so there may exist an even better solution.

@jgm jgm closed this as completed in 12efffa Jun 20, 2014
jgm added a commit that referenced this issue Apr 8, 2024
soul commands (`ul`, `hl`, `st`) are very fragile and the math
must be handled specially.  In #9597 we improved this for strikethrough
but omitted the other soul environments. This patch generalizes the
fix and a related fix for verbatim (#1294, #5529).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant