OSDN Git Service

lltjp-listings.sty: more escape
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 17 Sep 2018 12:01:21 +0000 (21:01 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 17 Sep 2018 12:01:21 +0000 (21:01 +0900)
src/patches/lltjp-listings.sty
test/test13-listings.pdf
test/test13-listings.tex

index e54cb00..3f7c220 100644 (file)
          #3\catcode\ltjlineendcomment=9\lst@escapebegin\expandafter\lst@next%"
          \fi}%
         {}}
+\def\ltj@lst@emptygrp{{}}
 \def\ltj@lst@escape@setup#1{%
   \begingroup\lccode`\~=`#1\lowercase{%
   \gdef\lst@next##1~{%
      \let\lst@arg\@empty\ltj@lst@remove@jacmd{##1}%
-     \expandafter\expandafter\expandafter\scantokens\expandafter{\lst@arg\relax}%
+     \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter
+          \scantokens\expandafter\expandafter\expandafter{\expandafter\ltj@lst@emptygrp\lst@arg\empty}%
      ~}%
   }\endgroup
 }
index 7585388..b369760 100644 (file)
Binary files a/test/test13-listings.pdf and b/test/test13-listings.pdf differ
index 7e69c05..29ea806 100644 (file)
@@ -214,7 +214,7 @@ aiu
 \textbf{Escape character}
 \begin{lstlisting}[escapechar=\#,basicstyle=\ttfamily]
 1234567890123457890
-aiu#\textcolor{red}{e} #o#\textcolor{red}{ka}#ki
+aiu# \textcolor{red}{e} #o#\textcolor{red}{ka}#ki
 \end{lstlisting}
 
 \end{document}