Skip to content

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

Closed
@bjpe

Description

@bjpe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions