OSDN Git Service

trailed whitespace at the end of a line
[luatex-ja/luatexja.git] / test / test13-listings.tex
index efaf11f..bc748d7 100644 (file)
@@ -1,8 +1,10 @@
 %#!lualatex
 \documentclass{article}
 
-\usepackage{luatexja}
-\usepackage{palatino,listings,color,showexpl}
+\usepackage{luatexja-fontspec}
+\usepackage{listings,color,showexpl}
+\usepackage{luatexja-otf}
+\directlua{luatexja.otf.enable_ivs()}
 \usepackage
 [
        papersize={100mm,100mm},
 
 \lstset
 {
-       language=sh,
+       language=sh, extendedchars=false,
        backgroundcolor=\color[gray]{.75},
        breaklines=true,
-    basewidth={0.55\zw, 0.45em},
+        explpreset={columns=fixed},
+    basewidth={0.5\zw, 0.45em},
        numbers=left,numberstyle=\tiny, numbersep=2pt,
 }
 
        }
        \fi
 }{}
-\DeclareFontShape{JY3}{mc}{m}{sl}{<-> s * [0.92489] psft:Ryumin-Light:jfm=ujis;slant=0.167}{}
-\DeclareFontShape{JY3}{mc}{m}{it}{<-> ssub* mc/m/sl}{}
+\DeclareKanjiFamily{JY3}{koz}{}
+\DeclareFontShape{JY3}{koz}{m}{n}{<-> s * [0.92489] KozMinPr6N-Regular:jfm=ujis}{}
+\DeclareFontShape{JY3}{koz}{m}{sl}{<-> s * [0.92489] psft:Ryumin-Light:jfm=ujis;slant=0.167}{}
+\DeclareFontShape{JY3}{koz}{m}{it}{<-> ssub* koz/m/sl}{}
+\def\mcdefault{koz}
+
+\setmainfont{TeX Gyre Pagella}
+\setmonofont{TeX Gyre Cursor}
 \begin{document}
+
 This test file is based on a.tex\footnote{This can be downloaded from {\tt https://gist.github.com/1574793}.} by x19290.
 
 
@@ -53,14 +63,13 @@ letter/word to 0\,pt.
 #!/bin/sh
 #長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い
 長い長い長い長い長い長い長い長い長い長い長い長い,長い長い長い長い長い長い
+#長い長い長い長い長い長い長い長い長い長い長い長い,長い長い長い長い長い長い
 #I.長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長いI
 長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い
 #IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII
 IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII IIII
 \end{env}
 
-Note that any \emph{kinsoku shori} is not performed inside \textsf{lstlisting} environment,
-as the line~3 in output above. We leave it to further development.
 \newpage
 
 \textbf{SOLVED}: LuaTeX-ja specific problem:
@@ -98,4 +107,49 @@ the first line of the listing is not rendered.
 長い長い長い長い長い長い長い長い長い長い長い長い)(長い
 \end{env}
 
+\newpage
+\textbf{Ticket \#29604}
+
+\setmonofont{DejaVu Sans Mono}
+\ltjsetparameter{jacharrange={-2,-3,-8}}
+ギリシャ文字欧文扱い
+
+\begin{lstlisting}[basewidth=.5em,basicstyle=\tt, emph={TeX}, emphstyle=\color{red}]
+01234567890123456789
+!あ!漢!α!×!
+\TeX はギリシャ文字のΤ-Ε-Χ(タウ・イプシロン・カイ)であるから、……
+\TeX is an abbreviation of τέχνη (ΤΕΧΝΗ – technē).
+\end{lstlisting}
+
+\ltjsetparameter{jacharrange={+2,+8,+3}}
+ギリシャ文字和文扱い
+
+\begin{lstlisting}[basewidth=.5em,basicstyle=\tt, emph={TeX}, emphstyle=\color{red}]
+01234567890123456789
+!あ!漢!α!×!
+\TeX はギリシャ文字のΤ-Ε-Χ(タウ・イプシロン・カイ)であるから、……
+\TeX is an abbreviation of τέχνη (ΤΕΧΝΗ – technē).
+\end{lstlisting}
+
+\newpage
+IVS対応1: \texttt{vsraw=false} (default)
+
+\begin{LTXexample}[escapechar=\%, basicstyle=\tt]
+1234567890
+1葛󠄀城,葛󠄁飾
+󠄀a
+\end{LTXexample}
+
+IVS対応2: \texttt{vsraw=true}
+
+\begin{LTXexample}[escapechar=\%,vsraw, basicstyle=\tt]
+1234567890
+1葛󠄀城,葛󠄁飾アイウ
+\end{LTXexample}
+
+\begin{lstlisting}[escapechar=\%,vsraw, basewidth=1\zw, basicstyle=\tt]
+1234567890
+1あ,23
+1あ2,3
+\end{lstlisting}
 \end{document}