X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=ed82e4c8717647597fb302de3696e4efefbe9494;hb=4a6671843cfa3c55146fd48f76d8f1332ca9cfd0;hp=16abb20ed31d79dcdc226ca962242e689a131505;hpb=6d37298f0b6f694b18cd2f7fcd67f74f52b7b96c;p=luatex-ja%2Fluatexja.git
diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx
index 16abb20..ed82e4c 100644
--- a/doc/luatexja.dtx
+++ b/doc/luatexja.dtx
@@ -1,9 +1,9 @@
%<*!showexpl>
%#! lualatex -shell-escape
-% \documentclass[a4paper,titlepage]{article}
-% \documentclass[a4paper,titlepage]{ltjsarticle}
-% \documentclass[a4paper,titlepage]{ltjsarticle}
+%\documentclass[a4paper,titlepage]{article}
+%\documentclass[a4paper,titlepage]{ltjsarticle}
+%\documentclass[a4paper,titlepage]{ltjsarticle}
%%%%%%%%
\makeatletter
@@ -26,14 +26,17 @@
%<*en>
\usepackage[margin=25mm,footskip=6mm]{geometry}
+\usepackage{luatexja-adjust}\ltjdisableadjust
\parskip=\smallskipamount
%
%<*ja>
\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
+\usepackage{luatexja-adjust}
\advance\leftmargini-1\zw\advance\leftmarginii-1\zw
%
%<*zh>
\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
+\usepackage{luatexja-adjust}\ltjdisableadjust
\advance\leftmargini-1\zw\advance\leftmarginii-1\zw
\def\postpartname{ç¼}
\DeclareYokoKanjiEncoding{ZH}{}{}
@@ -145,8 +148,8 @@
\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
\DeclareRobustCommand\LuaTeX{Lua\TeX}
\DeclareRobustCommand\pdfTeX{pdf\TeX}
-\DeclareRobustCommand\pTeX{p\kern-.05em\TeX}
-\DeclareRobustCommand\upTeX{up\kern-.05em\TeX}
+\DeclareRobustCommand\pTeX{p\kern-.15em\TeX}
+\DeclareRobustCommand\upTeX{up\kern-.15em\TeX}
\DeclareRobustCommand\pLaTeX{p\kern-.05em\LaTeX}
\DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
\DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
@@ -369,12 +372,12 @@ The followings are major changes from \pTeX:
%<*en>
\item The insertion process of glues/kerns between two Japanese
characters and between a Japanese character and other characters
- (we refer these glues/kerns as \textbf{JAglue}) is rewritten from
+ (we refer glues/kerns of both kinds as \textbf{JAglue}) is rewritten from
scratch.
%
%<*ja>
-\item 2ã¤ã®åææåã®éï¼åææåã¨æ¬§ææåã®éã«å
¥ãã°ã«ã¼ï¼ã«ã¼ã³
- ï¼\textbf{JAglue}ã¨å¼ã¶ï¼ã®æ¿å
¥å¦çã0ããæ¸ãç´ããã¦ããï¼
+\item 2ã¤ã®åææåã®éãï¼åææåã¨æ¬§ææåã®éã«å
¥ãã°ã«ã¼ï¼ã«ã¼ã³
+ ï¼ä¸¡è
ããããã¦\textbf{JAglue}ã¨å¼ã¶ï¼ã®æ¿å
¥å¦çã0ããæ¸ãç´ããã¦ããï¼
%
%<*zh>
\item æå¨æ¥æå符åå
¶ä»å符è¨ä¹é´çè¶/åºæ ¼ï¼æ们å°æ¤ç§°ä¸º\textbf{JAglue}ï¼æ¯éæ°å®ç°çã
@@ -1532,25 +1535,25 @@ Use bold gothic as bold mincho.
%
\item[90jis]
%<*en>
-Use 90JIS glyphs if possible.
+Use fonts with 90JIS glyphs if possible.
%
%<*ja>
-åºæ¥ãéã90JISã®åå½¢ã使ãï¼
+åºæ¥ãéã90JISã®åå½¢ãæ¡ç¨ãã¦ãããã©ã³ãã使ãï¼
%
\item[jis2004]
%<*en>
-Use JIS2004 glyphs if possible.
+Use fonts with JIS2004 glyphs if possible.
%
%<*ja>
-åºæ¥ãéãJIS2004ã®åå½¢ã使ãï¼
+åºæ¥ãéãJIS2004ã®åå½¢ãæ¡ç¨ãã¦ãããã©ã³ãã使ãï¼
%
\item[jis]
%<*en>
-Use the JFM \texttt{jfm-jis.lua}, instead of the default JFM of
-\LuaTeX-ja, \texttt{jfm-ujis.lua}.
+Use the JFM \texttt{jfm-jis.lua}, instead of \texttt{jfm-ujis.lua}, which is the default JFM of
+\LuaTeX-ja.
%
%<*ja>
-ç¨ããJFMã\texttt{jfm-jis.lua}ã¨ããï¼ãã®ãªãã·ã§ã³ããªãæã¯
+ç¨ããJFMãï¼JISãã©ã³ãã¡ããªãã¯é¡ä¼¼ã®ï¼\texttt{jfm-jis.lua}ã«ããï¼ãã®ãªãã·ã§ã³ããªãæã¯
\LuaTeX-jaæ¨æºã®\texttt{jfm-ujis.lua}ãç¨ããããï¼
%
\end{list}
@@ -1618,7 +1621,6 @@ as a substitute for \textit{rounded gothic}.
Settings for Hiragino fonts:
%
%<*ja>
-ã¢ãªãµã¯ã»ãã©ã®ãç¨ã®è¨å®ã¯ãã®ãããªãã¨ã¯è¡ã£ã¦ããªãï¼
ã¾ããã©ã®ããã©ã³ãããï¼
%
% ãããã¯æã£ã¦ããããã§ã¯ãªãã®ã§ï¼ãã©ã³ãåã
@@ -2120,7 +2122,7 @@ This range consist of the following Unicode ranges, \emph{except characters in t
\item \texttt{U+0180}--\texttt{U+024F}: ã©ãã³æåæ¡å¼µB
\item \texttt{U+0250}--\texttt{U+02AF}: IPAæ¡å¼µï¼å½éé³å£°è¨å·ï¼
\item \texttt{U+02B0}--\texttt{U+02FF}: åé²ãä¼´ã修飾æå
-\item \texttt{U+0300}--\texttt{U+036F}: ãã¤ã¢ã¯ãªãã£ã«ã«ãã¼ã¯ï¼åæå¯è½ï¼
+\item \texttt{U+0300}--\texttt{U+036F}: åæå¯è½ãªèå¥è¨å·
\item \texttt{U+1E00}--\texttt{U+1EFF}: ã©ãã³æåæ¡å¼µè¿½å
%
%<*zh>
@@ -2140,7 +2142,7 @@ This range consist of the following Unicode ranges, \emph{except characters in t
fonts) has some of these characters.
%
%<*ja>
-\item[ç¯å²2${}^{\text{J}}$] ã®ãªã·ã£æåã¨ããªã«æåï¼JIS~X~0208ï¼ãããã£ã¦å¤ãã®
+\item[ç¯å²2${}^{\text{J}}$] ã®ãªã·ã£æåã¨ããªã«æåï¼JIS~X~0208ï¼ãããã£ã¦ã»ã¨ãã©ã®
åæãã©ã³ãï¼ã¯ãããã®æåãæã¤ï¼
%
%<*zh>
@@ -2857,9 +2859,9 @@ JFMã®ååãæå®ããï¼ãã以åã«æå®ãããJFMãèªã¿è¾¼ã¾
\toprule
&\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
\midrule
-%Example~1\footnotemark
-%ä¾1\footnotemark
-%ä¾1\footnotemark
+%Example~1\cite{min10}
+%ä¾1\cite{min10}
+%ä¾1\cite{min10}
&\r{ujis}&\r{jis}&\r{min}\\
%Example~2
%ä¾2
@@ -2871,8 +2873,6 @@ Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
\end{center}
\ltjsetparameter{jacharrange={-3}}
\end{table}
-\footnotetext{from: ä¹é¨å³å·±, min10ãã©ã³ãã«ã¤ãã¦.
-\texttt{http://argent.shinshu-u.ac.jp/\~{\ }otobe/tex/files/min10.pdf}.}
%\paragraph{Note: kern feature}
%\paragraph{注æï¼kern feature}
@@ -3380,7 +3380,27 @@ Furthermore, the glyph is shifted according to values of fields
\item[kern={\{[$j$]=, ...\}}]
-\item[glue={\{[$j$]=\{, , \}, ...\}}]
+\item[glue={\{[$j$]=\{, , , []\}, ...\}}]
+%<*ja>
+æåã¯ã©ã¹$i$ã®æåã¨$j$ã®æåã®éã«æ¿å
¥ãããkernãglueã®éãæå®ããï¼
+
+ ã¯\texttt{luatexja-adjust.sty} ã«ããåªå
é ä½ä»ã
+ è¡é·èª¿æ´ï¼\ref{ssec-adj}ç¯ï¼ãæå¹ãªã¨ãã®ã¿æå³ãæã¤ï¼
+ãã®ãã£ã¼ã«ãã¯çç¥å¯è½ã§ããï¼è¡èª¿æ´å¦çã«ããããã®glueã®åªå
+ 度ã$-2$ãã$+2$ã®éã®æ´æ°ã§æå®ããï¼ã®çç¥æã®å¤
+ ã¯0ã§ããï¼ç¯å²å¤ã®å¤ãæå®ãããã¨ãã®åä½ã¯æªå®ç¾©ã§ããï¼ï¼
+
+%
+
+\item[end\_stretch=]
+\item[end\_shrink=]
+%<*ja>
+ãããã®ãã£ã¼ã«ãã¯çç¥å¯è½ã§ããï¼
+åªå
é ä½ä»ãè¡é·èª¿æ´ãæå¹ã§ããï¼ãã¤ç¾å¨ã®æåã¯ã©ã¹ã®æåãè¡
+ æ«ã«æ¥ãæã«ï¼è¡é·ãè©°ãã調æ´ã»ä¼¸ã°ã調æ´ã®ã
+ ãã«ãã®æåã¨è¡æ«ã®éã«æ¿å
¥å¯è½ãªã«ã¼ã³ã®å¤§ãããæå®ããï¼
+%
+
\end{list}
%<*ja>
@@ -4480,7 +4500,9 @@ See Subsections~\ref{ssec-jfont} and \ref{ssec-psft} for details.
ããã3ã¤ã®ãã¼ã¯ãããã \verb+\jfont+ ããªããã£ãã«å¯¾ãã
\texttt{cid}, \texttt{jfm}, \texttt{jfmvar}ãã¼ã¨ãããã対å¿ããï¼
\texttt{CID} ã¯ä¸ã® \texttt{NoEmbed} ã¨åããã¦ç¨ããããã¨ãã®ã¿æå¹ã§ããï¼
-詳細ã¯\ref{ssec-jfont}ç¯ã¨\ref{ssec-psft}ç¯ãåç
§ï¼
+\verb+\jfont+ ããªããã£ãã«å¯¾ãã
+\texttt{cid}, \texttt{jfm}, \texttt{jfmvar}ãã¼ã®è©³ç´°ã¯\ref{ssec-jfont}ç¯
+ ã¨\ref{ssec-psft}ç¯ãåç
§ï¼
%
\item[NoEmbed]
@@ -4573,6 +4595,83 @@ JFMã®\texttt{chars}ãã¼ãã«ã®ã¨ã³ããªã¨ã㦠\verb+'AJ1-xxx'+ ã®å½¢
使ããããã«ãªãï¼ããã¯Adobe-Japan1ã«ãããCIDçªå·ã \verb+xxx+ ã®æåã表ãï¼
%
+\subsection{\texttt{luatexja-adjust.sty}}
+\label{ssec-adj}
+\begin{figure}[t]
+\def\sq{%
+ \hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
+ ã\hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
+ \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
+\def\sb{\hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
+ â \hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
+ \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
+\newbox\gridbox
+\def\outbox#1{{\Large%
+ \ltjsetparameter{kanjiskip=0pt plus .2\zw minus .2\zw}%
+ \setbox\gridbox=\hbox to 20\zw{\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb}%
+ \hbox{\textcolor{cyan!50!white}{\copy\gridbox}\hskip-20\zw%
+ \vbox{\hsize=20\zw\noindent\leftskip0pt\rightskip0pt\parfillskip0pt#1}\vrule}%
+}}
+
+{\centering
+\begin{tabular}{lc}
+\toprule
+no adjustment&\outbox{以ä¸ã®åçã¯ï¼ãå
é¤åçãã¨ããå¼ã°ããã\hskip-.5\zw\null}\\
+without priority&%
+\ltjdisableadjust
+\outbox{以ä¸ã®åçã¯ï¼ãå
é¤åçãã¨ããå¼ã°ããã}%
+\ltjenableadjust\\
+with priority&%
+\outbox{以ä¸ã®åçã¯ï¼ãå
é¤åçãã¨ããå¼ã°ããã}
+%\ltjdisableadjust
+\\
+\bottomrule
+\end{tabular}\par}
+\smallskip
+
+Note: the value of
+\Param{kanjiskip} is 0\,pt${}^{+1/5\,\mathrm{em}}_{-1/5\,\mathrm{em}}$ in this figure,
+for making the difference obvious.
+%\caption{è¡é·èª¿æ´}\label{fig-adj}
+%\caption{Line adjustment}\label{fig-adj}
+\end{figure}
+
+
+%<*en>
+...
+%
+%<*ja>
+\pTeX ã§ã¯ï¼è¡é·èª¿æ´ã«ããã¦åªå
度ã®æ¦å¿µãåå¨ããªãã£ãããï¼å³
+\ref{fig-adj}ä¸æ®µã«ãããåè§åã®å端ã¯ï¼å³\ref{fig-adj}ä¸æ®µã®ããã«ï¼éµ
+æ¬å¼§å¨è¾ºã®ç©ºç½ã¨åæé空ç½(\Param{kanjiskip})ã®ä¸¡æ¹ã«ãã£ã¦è² æ
ãããï¼ã
+ããï¼ãæ¥æ¬èªçµçå¦çã®è¦ä»¶ã\cite{jlreq}ãJIS~X~4051~\cite{x4051}ã«ãã
+ã¦ã¯ï¼ãã®ãããªç¶æ³ã§ã¯å端ã¯éµæ¬å¼§å¨è¾ºã®ç©ºç½ã®ã¿ã§è² æ
ãï¼ãã®ä»ã®åæ
+æåã¯ãã¿çµã§çµã¾ããï¼å³\ref{fig-adj}ä¸æ®µï¼ãã¨ã«ãªã£ã¦ããï¼ãã®è¿½å
+ããã±ã¼ã¸ã¯\cite{jlreq}ã\cite{x4051}ã«ãããè¦å®ã®ãããªï¼åªå
é ä½ä»ã
+ã®è¡é·èª¿æ´ãæä¾ããï¼è©³ç´°ãªä»æ§ã«ã¤ãã¦ã¯\ref{sec-adjspec}ãåç
§ï¼
+
+
+\texttt{luatexja-adjust.sty}ã¯ï¼ä»¥ä¸ã®å½ä»¤ãæä¾ããï¼ãããã¯ãã¹ã¦ã°ãã¼ãã«ã«å¹åãçºæ®ããï¼
+
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
+\item[\char92ltjdisableadjust]
+åªå
é ä½ä»ãã®è¡é·èª¿æ´ãç¡å¹åããï¼
+
+\item[\char92ltjenableadjust]
+åªå
é ä½ä»ãã®è¡é·èª¿æ´ãæå¹åããï¼
+
+\item[åªå
度è¨å®â¦â¦]
+
+\end{list}
+
+
+
+
+
+%
+
+
+
%\part{Implementations}
%\part{å®è£
}
\label{part-imp}
@@ -5278,7 +5377,7 @@ u
%\subsection{æ¦è¦}
%\subsection{æ¦è¦}
-\LuaTeX-jaã«ãããåæå¦çã°ã«ã¼ã®æ¿å
¥æ¹æ³ã¯ï¼\pTeX ã®ããã¨ã¯å
¨ãç°ãªãï¼
+\LuaTeX-jaã«ããã \textbf{JAglue} ã®æ¿å
¥æ¹æ³ã¯ï¼\pTeX ã®ããã¨ã¯å
¨ãç°ãªãï¼
\pTeX ã§ã¯æ¬¡ã®ãããªä»æ§ã§ãã£ãï¼
\begin{itemize}
\item JFMã°ã«ã¼ã®æ¿å
¥ã¯ï¼åææåã表ããã¼ã¯ã³ãå
ã«æ°´å¹³ãªã¹ãã«ï¼æåã表ãï¼ã
@@ -5921,43 +6020,122 @@ $\mathit{Nq}.\mathit{tail}$ã¯ç¡æå³ãªã®ã§ï¼
\section{psft}
+%\section{Patch for the \Pkg{listings} package}
+%\section{\Pkg{listings} ããã±ã¼ã¸ã¸ã®å¯¾å¿}
+
+%<*en>
+It is well-known that the \Pkg{listings} package outputs weird results
+for Japanese input.
+The \Pkg{listings} package makes most of letters active and assigns
+output command for each letter \cite{listings}.
+But Japanese characters are not included in these activated letters.
+For \pTeX{} series, there is no method to make Japanese characters active;
+a patch \Pkg{jlisting.sty} \cite{jlisting} resolves the problem forcibly.
+%
%<*ja>
-\section{\Pkg{listings} ããã±ã¼ã¸ã¸ã®å¯¾å¿}
\Pkg{listings} ããã±ã¼ã¸ãï¼ãã®ã¾ã¾ã§ã¯æ¥æ¬èªãã¾ã¨ãã«åºåã§ããªããã¨
-ã¯ããç¥ããã¦ããï¼ãã¡ãã¨æ´å½¢ãã¦åºåããããã«ï¼\Pkg{listings}ããã±ã¼
+ã¯ããç¥ããã¦ããï¼ãã¡ãã¨æ´å½¢ãã¦åºåããããã«ï¼\Pkg{listings}ããã±ã¼
ã¸ã¯å
é¨ã§ãã»ã¨ãã©ã®æåããã¢ã¯ãã£ãã«ãï¼åæåã«å¯¾ãã¦ãã®æåã®åº
-åå½ä»¤ãå²ãå½ã¦ã¦ãã (\cite{listings})ï¼
+åå½ä»¤ãå²ãå½ã¦ã¦ãã \cite{listings}ï¼
ãããï¼ããã§ã¢ã¯ãã£ãã«ããæåã®ä¸ã«ï¼åææ
-åããªãããã§ããï¼p\TeX ç³»åã§ã¯ï¼åææåãã¢ã¯ãã£ãã«ããææ³ããªãï¼
+åããªãããã§ããï¼\pTeX ç³»åã§ã¯ï¼åææåãã¢ã¯ãã£ãã«ããææ³ããªãï¼
\Pkg{jlisting.sty} ã¨ããããã\cite{jlisting}ãç¨ãããã¨ã§ç¡çãã解決ãã¦ããï¼
+%
+%<*en>
+In \LuaTeX-ja, the problem is resolved by using \verb+process_input_buffer+ callback.
+The callback function inserts the output command before each letter above U+0080.
+This method can omits the process to make all Japanese characters active
+(most of the activated characters are not used in many cases).
+%
+%<*ja>
\LuaTeX-jaã§ã¯ï¼\verb+process_input_buffer+ ã³ã¼ã«ããã¯ãå©ç¨ãããã¨ã§ï¼
ãåè¡ã«åºç¾ããU+0080以éã®æåã«å¯¾ãã¦ï¼ãããã®åºåå½ä»¤ãåç½®ãããã¨ããæ¹æ³ãã¨ã£ã¦ããï¼
ããã«ããï¼ï¼å
¥åã«ã¯ä½¿ç¨ããã¦ããªããããããªãï¼åææåãããã¹ã¦ã¢ã¯ãã£ãåããæéããªãï¼
è¦éããè¯ãå®è£
ã«ãªã£ã¦ããï¼
+%
+%<*en>
+If \Pkg{listings.sty} and \LuaTeX-ja were loaded,
+then the patch \Pkg{lltjp-listings.sty} is loaded automatically at \verb+\begin{document}+.
+%
+%<*ja>
\LuaTeX-ja ã§å©ç¨ããã \Pkg{listings} ããã±ã¼ã¸ã¸ã®ããã \Pkg{lltjp-listings.sty} ã¯ï¼
\Pkg{listings.sty} ã¨\LuaTeX-jaãèªã¿è¾¼ãã§ããã°ï¼
\verb+\begin{document}+ ã®ç®æã«ããã¦èªåçã«èªã¿è¾¼ã¾ããã®ã§ï¼é常ã¯ãã¾ã
æèããå¿
è¦ã¯ãªãï¼
+%
+
+%\paragraph{Class of characters}
+%\paragraph{æå種}
-\paragraph{æå種}
+%<*en>
+Roughly speaking, the \Pkg{listings} package processes input as follows:
+%
+%<*ja>
\Pkg{listings} ããã±ã¼ã¸ã®å
é¨ã§ã¯ï¼å¤§éæã«è¨ãã¨
+%
\begin{enumerate}
+%<*en>
+\item Collects \textit{letters} and \textit{digits}, which can be used for the name of identifiers.
+%
+%<*ja>
\item èå¥åã¨ãã¦ä½¿ããæå (``letter'',~``digit'') ãã¡ã
éããï¼
+%
+
+%<*en>
+\item When reading an \textit{other}, outputs the collected string (with modification, if needed).
+%
+%<*ja>
\item letterã§ãdigitã§ããªãæåãç¾ããæã«ï¼åéããæååãï¼å¿
è¦ãªã修飾ãã¦ï¼åºåããï¼
+%
+
+%<*en>
+\item Collects \textit{others}.
+%
+%<*ja>
\item ä»åº¦ã¯éã«ï¼letterã§ãªãæåãã¡ãletterãç¾ããã¾ã§éããï¼
+%
+
+%<*en>
+\item When reading a \textit{letter} or a \textit{digit}, outputs the collected string.
+%
+%<*ja>
\item letterãåºç¾ãããéããæååãåºåããï¼
+%
+
+%<*en>
+\item Turns back to 1.
+%
+%<*ja>
\item 1.ã«æ»ãï¼
+%
\end{enumerate}
+%<*en>
+By the above process, line breaks inside of an identifier is blocked.
+A flag \verb+\lst@ifletter+ shows whether the last character can be used
+for the name of identifiers or not.
+%
+%<*ja>
ã¨ããå¦çãè¡ããã¦ããï¼ããã«ããï¼èå¥åã®éä¸ã§ã¯è¡åå²ãè¡ãããªãããã«ãªã£ã¦ããï¼
ç´åã®æåãèå¥åã¨ãã¦ä½¿ãããå¦ã㯠\verb+\lst@ifletter+ ã¨ãããã©ã°ã«æ ¼ç´ããã¦ããï¼
+%
+%<*en>
+For Japanese characters, line breaks are permitted on both sides
+except for parentheses, dashes, etc.
+To process Japanese characters,
+\Pkg{lltjp-listings.sty} introduces a new flag \verb+\lst@kanji+, which indicates
+whether the last character is Japanese character or not.
+For illustration, we introduce the following classes of character:
+%
+%<*ja>
ãã¦ï¼æ¥æ¬èªã®å¦çã§ããï¼æ®ã©ã®åææåã®åå¾ã§ã¯è¡åå²ãå¯è½ã§ãããï¼ãã®ä¸æ¹ã§
æ¬å¼§é¡ãé³å¼ããªã©ã§ã¯ç¦åå¦çãå¿
è¦ãªãã¨ããï¼\Pkg{lltjp-listings.sty} ã§ã¯ï¼
ç´åãåææåã§ãããã示ããã©ã° \verb+\lst@kanji+ ãæ°ãã«å°å
¥ããï¼
以éï¼èª¬æã®ããã«ä»¥ä¸ã®ããã«æåãåé¡ããï¼
+%
\begin{center}
\small
\begin{tabular}{lccccc}
@@ -5965,23 +6143,50 @@ $\mathit{Nq}.\mathit{tail}$ã¯ç¡æå³ãªã®ã§ï¼
&Letter&Other&Kanji&Open&Close\\\midrule
\verb+\lst@ifletter+&T&F&T&F&T\\
\verb+\lst@ifkanji+&F&F&T&T&F\\
-æå³&èå¥åä¸ã®æå&ãã®ä»æ¬§ææå&æ®ã©ã®åææå&éãæ¬å¼§é¡&éãæ¬å¼§é¡\\
+%Meaning&identifier char&other alphabet&most of Japanese char&open paren&close paren\\
+%æå³&èå¥åä¸ã®æå&ãã®ä»æ¬§ææå&æ®ã©ã®åææå&éãæ¬å¼§é¡&éãæ¬å¼§é¡\\
\bottomrule
\end{tabular}
\end{center}
+%<*en>
+Note that \textit{digits} in the \Pkg{listings} package can be Letter or
+Other according to circumstances.
+%
+%<*ja>
ãªãï¼æ¬æ¥ã®\Pkg{listings} ããã±ã¼ã¸ã§ã®åé¡``digit''ã¯ï¼
åºç¾ç¶æ³ã«ãã£ã¦ï¼ä¸ã®è¡¨ã®Letterã¨Otherã®ã©ã¡ãã«ããªãããï¼
ã¾ãï¼Kanjiã¨Close㯠\verb+\lst@ifletter+ 㨠\verb+\lst@ifkanji+ ã®å¤ãä¸è´ãã¦ãããï¼
ããã¯ééãã§ã¯ãªãï¼
+%
+%<*en>
+For example, let us consider the case an Open comes after a Letter.
+Since an Open represents Japanese open parenthesis,
+it is preferred to be permitted to insert line break after the Letter.
+Therefore, the collected string is output in this case.
+The following table summarizes $5\times 5=25$ cases:
+%
+%<*ja>
ä¾ãã°ï¼Letterã®ç´å¾ã«Openãæ¥ãå ´åãèããï¼
æå種Openã¯åæéãæ¬å¼§é¡ãæ³å®ãã¦ããã®ã§ï¼Letterã®ç´å¾ã§ã¯è¡åå²ãå¯è½ã§ãããã¨ãæã¾ããï¼
ãã®ããï¼ãã®å ´åã§ã¯ï¼ãã§ã«åéããã¦ããæååãåºåãããã¨ã§è¡åå²ã許容ããããã«ããï¼
åãããã«ï¼$5\times 5=25$éãå
¨ã¦ã«ã¤ãã¦æ¸ãã¨ï¼æ¬¡ã®ããã«ãªãï¼
+%
\begin{center}
\small
\begin{tabular}{llccccc}
\toprule
+%<*en>
+&&\multicolumn{4}{c}{Next}\\\cmidrule(lr){3-7}
+&&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
+&\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
+&Letter&collects&\multicolumn{3}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+&Other&outputs&collects&\multicolumn{2}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+Last&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+&Open&\multicolumn{5}{c}{\hrulefill \ collects\ \hrulefill}\\
+&Close&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+%
+%<*ja>
&&\multicolumn{4}{c}{å¾ãå´ã®æå}\\\cmidrule(lr){3-7}
&&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
&\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
@@ -5990,74 +6195,212 @@ $\mathit{Nq}.\mathit{tail}$ã¯ç¡æå³ãªã®ã§ï¼
æ&Kanji&\multicolumn{4}{c}{\hrulefill \ åºå\ \hrulefill}&åé\\
å&Open&\multicolumn{5}{c}{\hrulefill \ åé\ \hrulefill}\\
種&Close&\multicolumn{4}{c}{\hrulefill \ åºå\ \hrulefill}&åé\\
+%
\bottomrule
\end{tabular}
\end{center}
-ä¸ã®è¡¨ã«ããã¦ï¼
+%In the above table,
+%ä¸ã®è¡¨ã«ããã¦ï¼
\begin{itemize}
-\item ãåºåãã¯ï¼ããã¾ã§ã«éããæååãåºåï¼âããã§è¡åå²å¯è½ï¼ãæå³ããï¼
-\item ãåéãã¯ï¼å¾å´ã®æåãï¼ç¾å¨åéãããæååã«è¿½å ï¼è¡åå²ä¸å¯ï¼ãæå³ããï¼
+%\item ``outputs'' means to output the collected string (i.e., line breaking is permitted there).
+%\item ãåºåãã¯ï¼ããã¾ã§ã«éããæååãåºåï¼âããã§è¡åå²å¯è½ï¼ãæå³ããï¼
+
+%\item ``collects'' means to append the next character to the collected string (i.e., line breaking is prohibited there).
+%\item ãåéãã¯ï¼å¾å´ã®æåãï¼ç¾å¨åéãããæååã«è¿½å ï¼è¡åå²ä¸å¯ï¼ãæå³ããï¼
\end{itemize}
-\paragraph{åææåæ±ãã¨ãªãæå}
+%\paragraph{Classification of characters}
+%\paragraph{åææåæ±ãã¨ãªãæå}
+
+%<*en>
+Characters are classified according to \Param{jacharrange} parameter (see Section \ref{ssec-setrange}):
+%
+%<*ja>
\Pkg{listings} ããã±ã¼ã¸ã«ããã¦åææåã¨æ±ããã
ï¼åã«è¿°ã¹ãKanji, Openï¼ãããã¯ãéãæ¬å¼§é¡ãåé¡ï¼ãå¦ãã¯ï¼
é常ã®\textbf{JAchar}/\textbf{Alchar}ã®ç¯å²ã®è¨å®ï¼\ref{ssec-setrange}ç¯ï¼ã«å¾ã£ã¦è¡ãããï¼
+%
\begin{itemize}
-\item ï¼U+0080以éã®ï¼\textbf{ALchar}ã¯ï¼ãã¹ã¦Letteræ±ãã§ããï¼
-\item ï¼U+0080以éã®ï¼\textbf{JAchar}ã«ã¤ãã¦ã¯ï¼ä»¥ä¸ã®é åºã«å¾ã£ã¦æå種ã決ããï¼
+%\item \textbf{ALchars} above U+0080 are Letter.
+%\item ï¼U+0080以éã®ï¼\textbf{ALchar}ã¯ï¼ãã¹ã¦Letteræ±ãã§ããï¼
+
+%\item \textbf{JAchars} are classified in the order as follows:
+%\item ï¼U+0080以éã®ï¼\textbf{JAchar}ã«ã¤ãã¦ã¯ï¼ä»¥ä¸ã®é åºã«å¾ã£ã¦æå種ã決ããï¼
\begin{enumerate}
-\item \Param{prebreakpenalty} ã0以ä¸ã®æåã¯Openæ±ãã§ããï¼
-\item \Param{postbreakpenalty} ã0以ä¸ã®æåã¯Closeæ±ãã§ããï¼
-\item ä¸ã®2æ¡ä»¶ã®ã©ã¡ãã«ãå½ã¦ã¯ã¾ããªãã£ãæåã¯ï¼Kanjiæ±ãã§ããï¼
+%\item Characters whose \Param{prebreakpenalty} is greater than or equal to 0 are Open.
+%\item \Param{prebreakpenalty} ã0以ä¸ã®æåã¯Openæ±ãã§ããï¼
+
+%\item Characters whose \Param{postbreakpenalty} is greater than or equal to 0 are Close.
+%\item \Param{postbreakpenalty} ã0以ä¸ã®æåã¯Closeæ±ãã§ããï¼
+
+%\item Characters that don't satisfy the above two conditions are Kanji.
+%\item ä¸ã®2æ¡ä»¶ã®ã©ã¡ãã«ãå½ã¦ã¯ã¾ããªãã£ãæåã¯ï¼Kanjiæ±ãã§ããï¼
\end{enumerate}
+\end{itemize}
+
+%<*en>
+The width of halfwidth kana (U+FF61--U+FF9F) is same as the width of \textbf{ALchar}; the width of the other \textbf{JAchars} is double the width of \textbf{ALchar}.
+%
+%<*ja>
ãªãï¼åè§ã«ã(U+FF61--U+FF9F)以å¤ã®\textbf{JAchar}ã¯æ¬§ææå2æååã®å¹
ãã¨ããã®ã¨ã¿ãªãããï¼
åè§ã«ãã¯æ¬§ææå1æååã®å¹
ã¨ãªãï¼
-\end{itemize}
+%
+%<*en>
+The classification process is executed every time a character appears in
+listing environments.
+%
+%<*ja>
ãããã®æå種決å®ã¯ï¼å®éã« \texttt{lstlisting} ç°å¢ãªã©ã®å
é¨ã§æåãåºã¦ãããã³ã«è¡ãããï¼
+%
+
+%<*ja>
+\section{åæã®è¡é·è£æ£æ¹æ³}
+\label{sec-adjspec}
+\texttt{luatexja-adjust.sty} ã§æä¾ãããåªå
é ä½ä»ãã®è¡é·èª¿æ´ã®è©³ç´°ãè¿°
+ã¹ãï¼å¤§ã¾ãã«è¿°ã¹ãã¨ï¼æ¬¡ã®ããã«ãªãï¼
+\begin{itemize}
+\item é常ã®\TeX ã®è¡åå²æ¹æ³ã«å¾ã£ã¦ï¼æ®µè½ãè¡åå²ããï¼ãã®æ®µéã§ã¯ï¼è¡
+ é·ã«å端ãåºãå ´åï¼ãã®å端åã¯\Param{xkanjiskip}ï¼
+ \Param{kanjiskip}ï¼JFMã°ã«ã¼ã®å
¨ã¦ã§ï¼åªå
é ä½ãªãï¼è² æ
ãããï¼
+\item ãã®å¾ï¼\texttt{post\_linebreak\_filter} callbackã使ãï¼\textbf{段
+ è½ä¸ã®åè¡ãã¨ã«}ï¼è¡æ«æåã®ä½ç½®ã調æ´ãããï¼åªå
度ä»ãã®è¡é·èª¿æ´
+ ãå®ç¾ããããã«ã°ã«ã¼ã®ä¼¸ç¸®åº¦ã調æ´ããï¼
+\texttt{luatexja-adjust.sty} ã®ä½ç¨ã¯ï¼ãã®callbackã追å ããã ãã§ããï¼
+ ãã®ç« ã®æ®ãã§ã¯callbackã§ã®å¦çã«ã¤ãã¦è§£èª¬ããï¼
+\end{itemize}
+
+\paragraph{æºåï¼åè¨ä¼¸ç¸®éã®è¨ç®}
+ã°ã«ã¼ã®ä¼¸ç¸®åº¦ï¼\texttt{plus} ã \texttt{minus} ã§æå®ããã¦ããå¤ï¼ã«ã¯ï¼
+æéå¤ã®ä»ã«ï¼\texttt{fi}ï¼\texttt{fil}ï¼\texttt{fill}ï¼\texttt{filll}ã¨
+ãã4ã¤ã®ç¡é大ã¬ãã«ï¼å¾ãã®æ¹ã»ã©å¤§ããï¼ãããï¼è¡ã®èª¿æ´ã«
+\texttt{fi} ãªã©ã®\textbf{ç¡é大ã¬ãã«ã®ä¼¸ç¸®åº¦ãç¨ãããã¦ããå ´åã¯ï¼ã
+ã®è¡ã«å¯¾ãã¦ã®å¦çãä¸æ¢}ããï¼
+
+ãã£ã¦ï¼ä»¥éï¼åé¡ã«ãã¦ããè¡ã®è¡é·èª¿æ´ã¯ä¼¸ç¸®åº¦ãæéé·ã®ã°ã«ã¼ãç¨ãã¦
+è¡ããã¦ããã¨ãã¦è¯ãï¼ã¾ãï¼æ®µè½ä¸ã®è¡ä¸ã®ã°ã«ã¼ã
+\begin{itemize}
+\item ä¸ã®ã©ãã«ã該å½ããªãã°ã«ã¼
+\item å欧æé空ç½(\Param{xkanjiskip})
+\item JFMã°ã«ã¼ï¼åªå
度å¥ã«ã¾ã¨ããããï¼
+\item åæé空ç½(\Param{kanjiskip})
+\end{itemize}
+ã®$1+1+5+1=8$ã¤ã«é¡å¥ãï¼ããããã®ç¨®å¥ãã¨ã«è¨±å®¹ããã¦ãã伸縮度ã®åè¨ãè¨ç®ããï¼
+ã¾ãï¼è¡é·ã¨èªç¶é·ã¨ã®å·®ã®çµ¶å¯¾å¤ãè¨ç®ãï¼ããã\textit{total}ã¨ããï¼
+
+\subsection{è¡æ«æåã®ä½ç½®èª¿æ´}
+ã¾ãï¼è¡æ«ãåææåã§ãã£ãå ´åï¼ãããåãããã¨ã«ãã£ã¦ï¼\textbf{JAglue} ãè² æ
ãã調æ´éã
+å°ãªããããã¨ããï¼
%
+
%<*en>
-\section{Patch for the \Pkg{listings} package}
+\section{Advanced line-adjustment for Japanese characters}
\dots
%
+
+
+
\begin{thebibliography}{99}
\addcontentsline{toc}{section}{\refname}
\bibitem{texbytopic}
Victor Eijkhout, \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
\bibitem{listings} C.\ Heinz, B.\ Moses. The \textsf{Listings} Package.
-\bibitem{jlisting} Thor Watanabe. Listings\ -\ MyTeXpert.\newblock
+\bibitem{jlisting} Thor Watanabe. Listings\ -\ MyTeXpert. \newblock
\url{http://mytexpert.sourceforge.jp/index.php?Listings}
+\bibitem{min10} ä¹é¨å³å·±ï¼min10ãã©ã³ãã«ã¤ãã¦ï¼
+\url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf}
+\bibitem{jlreq} W3C Japanese Layout Task Force~(ed), Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock
+\url{http://www.w3.org/TR/jlreq/}%
+% \\æ¥æ¬èªè¨³ã®æ¸ç±çï¼W3Cæ¥æ¬èªçµçã¿ã¹ã¯ãã©ã¼ã¹ï¼ç·¨ï¼ï¼ãW3Cæè¡ãã¼ã æ¥æ¬èªçµçå¦çã®è¦ä»¶ãï¼æ±äº¬é»æ©å¤§å¦åºçå±ï¼2012ï¼
+\bibitem{x4051} æ¥æ¬å·¥æ¥è¦æ ¼(Japanese Industrial Standard) JIS~X~4051,
+æ¥æ¬èªææ¸ã®çµçæ¹æ³(Formatting rules for Japanese documents), 1993, 1995, 2004.
\end{thebibliography}
\newpage
\appendix
-%<*ja>
-\section{\LuaTeX-jaã«ãããJIS~X~0213éæ¼¢åã®catcode}
+%\section{The category code of non-kanji characters defined in JIS~X~0213}
+%\section{\LuaTeX-jaã«ãããJIS~X~0213éæ¼¢åã®catcode}
+
+%<*en>
+In these tables, the default catcode (\LuaTeX-ja) and kcatcode ((u)\pTeX) of non-kanji
+characters defined in JIS~X~0213 from row 1 to row 13 is summarized.
+Each character is printed as follows:
+%
+%<*ja>
ããã§ã¯ï¼JIS~X~0213ã®éæ¼¢åé¨åï¼ç¬¬1åºã第13åºï¼ã®ãã¡ï¼
ã©ã®æåã(u)\pTeX ã\LuaTeX-jaã§å¶å¾¡ç¶´å
ã«ä½¿ç¨å¯è½ãã表ã«ãã¦ã¾ã¨ããï¼
åæåã¯
+%
\begin{center}
\tt\fboxsep=1pt\fbox{\hbox to \zw{\gt ã\hss}}\,\scriptsize LUP
\end{center}
+%<*ja>
ã®ããã«è¡¨ç¤ºãã¦ããï¼åæåã¯æ¬¡ã®æå³ãæã£ã¦ããï¼
-ãã®è¡¨ã®çæã¯ï¼JIS X 0208ã®ç¯å²å
ã®æåã«ã¤ãã¦ã¯\verb+\jis+å½ä»¤ã使ã£ã¦è¡ãªã£ã¦ããï¼
+ãã®è¡¨ã®çæã¯ï¼JIS~X~0208ã®ç¯å²å
ã®æåã«ã¤ãã¦ã¯\verb+\jis+å½ä»¤ã使ã£ã¦è¡ãªã£ã¦ããï¼
+%
+%<*en>
+The tables are generated by using \verb+\jis+ command for characters included in
+JIS~X~0208.
+Each character in the tables means:
+%
\begin{itemize}
+%<*en>
+\item The background of a character regarded as \textbf{ALchar} in \LuaTeX-ja
+ is colored light blue.
+%
+%<*ja>
\item èæ¯ãèãéãå¡ããã¦ããæåã¯ï¼
\LuaTeX-ja ã®æ¨æºã§\textbf{ALchar}ã¨ãã¦èªèããã¦ããæåã§ããï¼
+%
+
+%<*en>
+\item The first letter {\tt L} means that the character is available for
+ the name of a control sequence in \XeTeX{} and \LuaTeX-ja (its catcode is 11).
+%
+%<*ja>
\item 1æåç®ã® {\tt L} ã¯ï¼\XeTeX ã\LuaTeX-jaã«ããã¦ãã®æåãå¶å¾¡ç¶´å
ã«
使ç¨å¯è½ï¼catcodeã11ï¼ã§ãããã¨ã表ãã¦ããï¼
+%
+
+%<*en>
+\item The second letter {\tt U} means that the character is available for
+ the name of a control sequence in \upTeX{} (its kcatcode is 16 or 17).
+ \upTeX{} regards these characters as Japanese character.
+%
+%<*ja>
\item 2æåç®ã®{\tt U} ã¯ï¼\upTeX ã«ããã¦ãã®æåãå¶å¾¡ç¶´å
ã«ä½¿ç¨å¯è½ï¼kcatcodeã¯16,~17ï¼ã§ãããã¨ã
表ãã¦ããï¼ãã®ç¯å²å
ã§ã¯ï¼\upTeX ã¯æ¨æºã§å
¨æåãåææåã¨ãã¦æ±ãããã§ããï¼
+%
+
+%<*en>
+\item The third letter {\tt P} means that the character is available for
+ the name of a control sequence in \pTeX{} (its kcatcode is 16 or 17).
+%
+%<*ja>
\item 3æåç®ã® {\tt P} ã¯ï¼\pTeX ã«ããã¦ãã®æåãå¶å¾¡ç¶´å
ã«ä½¿ç¨å¯è½ï¼kcatcodeã¯16,~17ï¼ã§ãããã¨ã
表ãã¦ããï¼
+%
+
+%<*en>
+\item If the third letter is {\tt -} (or the character is printed in red),
+ the character is not included in JIS~X~0208.
+ Therefore, you can consider the character is not available.
+%
+%<*ja>
\item 3æåç®ã{\tt -}ã¨ãªã£ã¦ãããã®ï¼æ¬ä½ã®æåã赤身ããã£ã¦ããï¼ã¯ï¼
JIS~X~0208ã«ãªããã使ç¨ä¸è½ã¨èãã¦è¯ããã®ã§ããï¼
+%
+
+%<*en>
+\item The kana for bidakuon in row 4 and 5 are omitted.
+%
+%<*ja>
\item 第4åºã¨ç¬¬5åºã«ããï¼é¼»æ¿é³ã®ä»®åã«ã¤ãã¦ã¯çç¥ããï¼
+%
\end{itemize}
@@ -6383,7 +6726,9 @@ JIS~X~0208ã«ãªããã使ç¨ä¸è½ã¨èãã¦è¯ããã®ã§ããï¼
}
\def\test#1{{%
-\subsection*{第#1åº}\tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
+%\subsection*{Row #1}
+%\subsection*{第#1åº}
+\tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
\begin{tabular}{ccccccccccccccccc}\toprule&"0&"1&"2&"3&"4&"5&"6&"7&"8&"9&"A&"B&"C&"D&"E&"F\\
\out{#1}{2}\out{#1}{3}\out{#1}{4}\out{#1}{5}\out{#1}{6}\out{#1}{7}\bottomrule
\end{tabular}\par}\medskip}
@@ -6391,8 +6736,6 @@ JIS~X~0208ã«ãªããã使ç¨ä¸è½ã¨èãã¦è¯ããã®ã§ããï¼
\test{1}\test{2}\test{3}\test{4}\test{5}\test{6}\test{7}\test{8}
\test{9}\test{10}\test{11}\test{12}\test{13}
-%
-
\section{Package versions used in this document}
This document was typeset using the following packages: