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

Mangled verbatim line environment #168

Closed
jpbrucker opened this issue Mar 14, 2019 · 3 comments
Closed

Mangled verbatim line environment #168

jpbrucker opened this issue Mar 14, 2019 · 3 comments

Comments

@jpbrucker
Copy link

It seems like commit 761ce84 ("added standard styles for verbatim markup") introduced a regression on some verbatim environments. I first noticed this with lstlistings but could reproduce the issue using verbatim. When doing a diff of the following files with latexdiff 1.3.0, the resulting .tex doesn't compile.

verbatim-1.tex

\documentclass{report}
\begin{document}
\begin{verbatim}
1
\end{verbatim}
\begin{verbatim}
2
\end{verbatim}
\end{document}

verbatim-2.tex

\documentclass{report}
\begin{document}
\begin{verbatim}
3
\end{verbatim}
\end{document}

result.tex

...
\begin{document}
\DIFmodbegin
\begin{DIFverbatim}[alsolanguage=DIFcode]
%DIF < 1
\end{DIFverbatim}
\DIFmodend
%DIFDELCMD < \begin{verbatim}
%DIFDELCMD < %%%
%DIF < DIFVRB 2
\DIFdelend %DIF > DIFVRB 3
\end{verbatim}
\end{document}

Fails with:

! LaTeX Error: \begin{document} ended by \end{verbatim}.

git bisect pointed to commit 761ce84 as the first one mangling the output

@ftilmann
Copy link
Owner

I can confirm this as a bug; thanks for finding the offending commit. Clearly something is going very wrong. Will require some investigation as I don't really want to roll back this commit, which is providing useful functionality and in most cases seems to work.

@ftilmann
Copy link
Owner

@jpbrucker not sure if you are still interested in this old thread, but I managed to fix the problem for the MWE (albeit with an additional empty line added, and change to the internal organisation of the verbatim environment. The fix is more a patch-up, but it did work for the MWE and didn't break any of the other test cases for verbatim environment. However, it might or might not work with more complicated documents, and might also have unwanted effects.

@jpbrucker
Copy link
Author

Great, thanks for fixing it!

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

2 participants