LaTeXML
LaTeXML copied to clipboard
Duplicated characters when using listings.sty morestring feature
Build:
\documentclass{article}
\NeedsTeXFormat{LaTeX2e}
\usepackage{listings}
\lstset{
% morestring=[b]{A},
morestring=[b]{B},
}
\begin{document}
\lstinline!A!
\lstinline!B!
\lstinline!xBx!
\end{document}
While the pdfLaTeX build shows a single A and a single B for the first two paragraphs, the LaTeXML build contains a doubled-up BB (the A can also be doubled-up by uncommenting the corresponding morestring line).
The problem was originally reported to me in https://github.com/modelica/ModelicaSpecification/issues/3572, where the use of morestring makes more sense than in the minimal example included here.
Edit: I extended the minimal document with \lstinline!xBx!, which shows that the morestring feature isn't breaking every occurrence of the character, which probably explains why we haven't noted the problem earlier.
Thank you for the report. I have reproduced the bug as stated, indeed a double BB is produced.