OSDN Git Service

lltjp-listings.sty: better alignment of punctuations marks
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 23 Mar 2020 12:55:58 +0000 (21:55 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 23 Mar 2020 12:55:58 +0000 (21:55 +0900)
src/patches/lltjp-listings.sty
test/test13-listings.pdf
test/test13-listings.tex

index 13f75e3..4cd47bb 100644 (file)
@@ -1,5 +1,5 @@
 %
-% lltjp-listings.sty 2018-09-17
+% lltjp-listings.sty 2020-03-23
 %
 
 \NeedsTeXFormat{LaTeX2e}
 % override \lst@FillFixed@
 % \ltj@hst@hss is \ltj@lst@hss@ivs or \ltj@lst@hss@normal,
 % according to vsraw = true or not.
+\def\lst@FillFixed#1{{\null#1\null}\lst@FillFixed@}
 \def\lst@FillFixed@#1{%
-  \ifx\@empty#1\else\ltj@lst@hss#1\expandafter\lst@FillFixed@\fi}
+  \ifx\@empty#1\else\ltj@lst@hss{\null#1\null}\expandafter\lst@FillFixed@\fi}
+\let\lst@FillOutputBox\lst@FillFixed
 
 \directlua{
   local cat_str = luatexbase.catcodetables['string']
@@ -97,7 +99,8 @@
   \else
     \ltj@lst@setletterflag
   \fi
-  \lst@Append#1}
+  \lst@Append#1%
+}
 
 % 半角カナ処理命令
 \def\ltj@lst@ProcessJALetterHalf#1{%
     \fi}
 \endgroup
 
-
 %    \begin{修正事項}{1.3} from jlisting.sty
 % ちょっとした修正
 \gdef\lst@breakProcessOther#1{\lst@ProcessOther#1}
index b369760..7564e4d 100644 (file)
Binary files a/test/test13-listings.pdf and b/test/test13-listings.pdf differ
index 29ea806..10a014d 100644 (file)
@@ -33,7 +33,7 @@
        \fi
 }{}
 \DeclareKanjiFamily{JY3}{koz}{}
-\DeclareFontShape{JY3}{koz}{m}{n}{<-> s * [1.2] KozMinPr6N-Regular:jfm=ujis}{}
+\DeclareFontShape{JY3}{koz}{m}{n}{<-> s * [1.2] HaranoAjiMincho-Regular:jfm=ujis}{}
 \DeclareFontShape{JY3}{koz}{m}{sl}{<-> s * [1.2] psft:Ryumin-Light:jfm=ujis;slant=0.167}{}
 \DeclareFontShape{JY3}{koz}{m}{it}{<-> ssub* koz/m/sl}{}
 \def\mcdefault{koz}
@@ -217,4 +217,25 @@ aiu
 aiu# \textcolor{red}{e} #o#\textcolor{red}{ka}#ki
 \end{lstlisting}
 
+
+\newpage
+\lstset{basewidth=0.75\zw,basicstyle=\ttfamily,doubleletterspace,backgroundcolor=}
+\noindent
+\def\A{\leavevmode\smash{\hbox to 0.75\zw{\kern-.0625mm\vrule height 0pt depth 200pt width 0.125mm\hss}}}%
+\textcolor{cyan}{\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A\A}%
+
+\begin{lstlisting}
+1234567890123456789012345
+123(あいう(カンジabc
+1234567890123456789012345
+123あいう)(カンジabc
+1234567890123456789012345
+123あい:う(カンジabc
+1234567890123456789012345
+:H:
+1234567890123456789012345
+:HHHH:
+1234567890123456789012345
+1234567890123456789012345
+\end{lstlisting}
 \end{document}