X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=1c306990f4182d295c57ff5a1b44f33a0c03fdfb;hb=f4648633114b448dadb484b114606ac663073819;hp=5fb9f15dbda4077bdcd3391f8ea69658bea5ecfa;hpb=9ea8f9cbe5824b0642cd6f3a74a31cf81af96ed4;p=luatex-ja%2Fluatexja.git
diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx
index 5fb9f15..1c30699 100644
--- a/doc/luatexja.dtx
+++ b/doc/luatexja.dtx
@@ -44,6 +44,7 @@
\usepackage[margin=25mm,lmargin=30mm,rmargin=30mm,footskip=6mm]{geometry}
\usepackage{luatexja-adjust}\ltjdisableadjust
\parskip=\smallskipamount
+\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
@@ -77,6 +78,7 @@
explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed}
}
% Suppress output from showexpl to stdout.
+\makeatletter
\let\SX@Info\relax
%%%%%%%% colors
@@ -418,13 +420,13 @@ The insertion process of glues/kerns between two Japanese
%<*en>
\paragraph{Directions}
-From this version, \LuaTeX-ja supports vertical writing;
+From version~20150420.0, \LuaTeX-ja supports vertical writing;
but this feature must \emph{not} be confused with $\Omega$-style direction support of \LuaTeX\
itself. ...
%
%<*ja>
\paragraph{çµæ¹å}
-æ¬çããã¯ï¼ä¸å®å®ãªããã\LuaTeX-ja ã«ããã縦çµã¿ããµãã¼ããã¦ããï¼
+20150420.0çããã¯ï¼ä¸å®å®ãªããã\LuaTeX-ja ã«ããã縦çµã¿ããµãã¼ããã¦ããï¼
ãªãï¼\LuaTeX æ¬ä½ãï¼$\Omega$æµã®çµæ¹åããµãã¼ããã¦ãããï¼ããã¨ã¯å
¨ãã®å¥ç©ã§ãããã¨
ã«æ³¨æãã¦ã»ããï¼
\LuaTeX ã®ã³ã¼ã«ããã¯ãå®è£
ã«ããï¼ç¹ã«ç°ãªã£ãçµæ¹åã®ããã¯ã¹ãæ±ãå ´åã«ã¯
@@ -743,6 +745,20 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}.
å¾æ¥æ¥æ¬èªã®æåã³ã¼ãã¨ãã¦ç¨ãããã¦ããEUC-JPãShift-JISã¯ä½¿ç¨ã§ããªãï¼
%
%<*en>
+\item By default, \LuaTeX-ja uses Japanese fonts to typeset Greek and Cyrillic letters,
+ and some Unicode symbols such as \P~and~\S. To change this behavior,
+ put \lstinline!\ltjsetparameter{jacharrange={-2,-3,-8}}! in the preamble.
+ For the detailed description, see Subsection~\ref{ssec-setrange}.
+%
+%<*ja>
+\item
+æ¨æºã§ã¯ï¼\LuaTeX-jaã¯ã®ãªã·ã£æåãããªã«æåï¼ããã«\P ã\S ãªã©ã®è¨å·ãåæãã©ã³ãã使ã£
+ ã¦çµãï¼ã®ãªã·ã£èªãªã©ãæ¬æ ¼çã«çµããªã©ãã®ç¶æ³ãæã¾ãããªãå ´åï¼
+ ããªã¢ã³ãã«ã« \lstinline!\ltjsetparameter{jacharrange={-2,-3,-8}}! ãå
¥ããã¨
+ ä¸è¨ç¨®é¡ã®æåã¯æ¬§æãã©ã³ããç¨ãã¦çµã¾ããããã«ãªãï¼
+ 詳ãã説æã¯\ref{ssec-setrange}ç¯ãåç
§ãã¦ã»ããï¼
+%
+%<*en>
\item \LuaTeX-ja is very slower than \pTeX.
Generally speaking, LuaJIT\TeX\ processes \LuaTeX-ja
about 30\% faster than \LuaTeX, but not always.
@@ -753,9 +769,10 @@ about 30\% faster than \LuaTeX, but not always.
LuaJIT\TeX ãç¨ããã¨\LuaTeX ã®ã ããã1.3åã®é度ã§åãããã§ãããï¼
IPA mjææãªã©ã®å¤§ãããã©ã³ããç¨ããå ´åã«ã¯\LuaTeX ãããé
ããªããã¨ãããï¼
%
+
\item%
%<*en>
-\textbf{Outdated note for MiK\TeX\ users}\quad
+\textbf{(Outdated) note for MiK\TeX\ users}\quad
\LuaTeX-ja requires that several CMap files%
\footnote{\texttt{UniJIS2004-UTF32-\{H,V\}} and \texttt{Adobe-Japan1-UCS2}.}
must be found from \LuaTeX.
@@ -768,7 +785,7 @@ so you will encounter an error like the following:
\LuaTeX-jaãåä½ããããã«ã¯ï¼\emph{å°å
¥ã»æ´æ°å¾ã®ååèµ·åæã«}
\texttt{UniJIS2004-UTF32-\{H,V\}}, \texttt{Adobe-Japan1-UCS2}ã¨ãã3ã¤ã®CMapã
\LuaTeX ã«ãã£ã¦è¦ã¤ãããããã¨ãå¿
è¦ã§ããï¼
-ãããããå¤ãMiK\TeX ã§ã¯ãã®ããã«ãªã£ã¦ããªãã®ã§ï¼æ¬¡ã®ã¨ã©ã¼ãçºçããã ããï¼
+ãããå¤ããã¼ã¸ã§ã³ã®MiK\TeX ã§ã¯ãã®ããã«ãªã£ã¦ããªãã®ã§ï¼æ¬¡ã®ã¨ã©ã¼ãçºçããã ããï¼
%
\begin{lstlisting}
! LuaTeX error ...iles (x86)/MiKTeX 2.9/tex/luatex/luatexja/ltj-rmlgbm.lua
@@ -779,7 +796,8 @@ bad argument #1 to 'open' (string expected, got nil)
If so, please execute a batch file which is written on
\href{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{ the Project Wiki (English)}.
This batch file creates a temporary directory, copy CMaps in it,
-run \LuaTeX-ja in this directory, and finally delete the temporary directory.
+run a test file which loads \LuaTeX-ja in this directory,
+and finally delete the temporary directory.
%
%<*ja>
ãã®ãããªå ´åã«ã¯ï¼
@@ -1087,13 +1105,12 @@ For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ (
%
\begin{itemize}
%<*en>
-\item Commands \cs{fontfamily}, \cs{fontseries},
- \cs{fontshape}, and \cs{selectfont} can be used to change
+\item Commands \cs{fontfamily}, \cs{fontseries}, and \cs{fontshape} can be used to change
attributes of Japanese fonts.
%
%<*ja>
-\item åæãã©ã³ãã®å±æ§ãå¤æ´ããã«ã¯ï¼\cs{fontfamily}, \cs{fontseries}, \cs{fontshape},
- ããã¦ããããåæ ãããããã« \cs{selectfont} ãç¨ããã°ããï¼
+\item åæãã©ã³ãã®å±æ§ãå¤æ´ããã«ã¯ï¼\cs{fontfamily}, \cs{fontseries}, \cs{fontshape} ã使ç¨ããï¼
+ ãã¡ããï¼ããããå®éã«åæ ãããã«ã¯æå㧠\cs{selectfont} ãå®è¡ããå¿
è¦ãããï¼
%
%<*en>
@@ -1154,14 +1171,16 @@ auto select&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\
%<*en>
\item For defining a Japanese font family, use
\cs{DeclareKanjiFamily} instead of
- \cs{DeclareFontFamily}. However, in the present implementation,
- using \cs{DeclareFontFamily} doesn't cause any problem.
+ \cs{DeclareFontFamily}. (In previous version of \LuaTeX-ja,
+ using \cs{DeclareFontFamily} didn't cause any problem. But this no longer applies
+ the current version.)
\item Defining a Japanese font shape can be done by usual \cs{DeclareFontShape}:
%
%<*ja>
\item åæãã©ã³ããã¡ããªã®å®ç¾©ã«ã¯ \cs{DeclareFontFamily} ã®
- 代ããã« \cs{DeclareKanjiFamily} ãç¨ããï¼ãããï¼ç¾å¨ã®
- å®è£
ã§ã¯ \cs{DeclareFontFamily} ãç¨ãã¦ãåé¡ã¯çããªãï¼
+ 代ããã« \cs{DeclareKanjiFamily} ãç¨ããï¼ä»¥åã®
+ å®è£
ã§ã¯ \cs{DeclareFontFamily} ãç¨ãã¦ãåé¡ã¯çããªãã£ããï¼ç¾å¨ã®å®è£
ã§ã¯
+ ããã¯ãããªãï¼
\item åæãã©ã³ãã®ã·ã§ã¤ããå®ç¾©ããã«ã¯ï¼é常㮠\cs{DeclareFontShape} ã使ãã°è¯ãï¼
%
\begin{lstlisting}
@@ -1928,8 +1947,8 @@ parameters, you have to use commands \cs{ltjsetparameter} and
ç¨ããï¼
%
-%\subsection{Editing the Range of \textbf{JAchar}s}
-%\subsection{\textbf{JAchar}ã®ç¯å²ã®è¨å®}
+%\subsection{Range of \textbf{JAchar}s}
+%\subsection{\textbf{JAchar}ã®ç¯å²}
\label{ssec-setrange}
%<*en>
@@ -5821,67 +5840,144 @@ In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the
\item[\cs{fontfamily}\{\}]
%<*en>
As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
-to . Which family will be changed is determined as follows:
+to .
+
+First, Whether Japanese font family will be changed is determined by following conditions.
+We use an auxiliary list~$N_{\mathrm{J}}$.
%
%<*ja>
å
ã
ã®\LaTeXe ã«ããããã®ã¨åæ§ã«ï¼ãã®ã³ãã³ãã¯ç¾å¨ã®ãã©ã³ããã¡ããªï¼æ¬§æï¼
åæï¼\emph{ãããã¯ä¸¡æ¹}ï¼ãã«å¤æ´ããï¼
-ã©ã®ãã¡ããªãå¤æ´ããããã¯ä»¥ä¸ã®ããã«ãã¦æ±ºå®ãããï¼
+ã¾ãï¼åæãã©ã³ããã¡ããªãå¤æ´ããããã¯ä»¥ä¸ã®é åºã§æ±ºå®ãããï¼
+è£å©çã«ãåæãã©ã³ããã¡ããªã§ã¯ãªãããã¡ããªãæ ¼ç´ãããªã¹ã$N_{\mathrm{J}}$ãç¨ããï¼
%
-\begin{itemize}
+\begin{enumerate}
%<*en>
-\item Let current encoding scheme for Japanese fonts be
- . Current Japanese font family will be changed to
- , if one of the following two conditions is met:
+\item If the family~ has been defined already by \cs{DeclareKanjiFamily},
+ current Japanese font family will be changed to .
+ Note that need not be defined under \emph{current} Japanese font encoding.
%
%<*ja>
-\item ç¾å¨ã®åæãã©ã³ãã«å¯¾ããã¨ã³ã³ã¼ãã£ã³ã°ãã§ããã¨ãããï¼
- ç¾å¨ã®åæãã©ã³ããã¡ããªã¯ï¼ä»¥ä¸ã®2ã¤ã®æ¡ä»¶ã®ãã¡ã®1ã¤ãæºãããã¦ããã¨ãã«
- ã«å¤æ´ãããï¼
+\item ãã¡ããªãæ¢ã« \cs{DeclareKanjiFamily} ã«ãã£ã¦å®ç¾©ããã¦ããå ´åï¼
+ åæãã©ã³ããã¡ããªã¯ã«å¤æ´ãããï¼
+ ããã§ï¼ã¯ç¾å¨ã®åæãã©ã³ãã¨ã³ã³ã¼ãã£ã³ã°ã§å®ç¾©ããã¦ããªãã¦ãããï¼
%
-\begin{itemize}
%<*en>
-\item The family under the encoding has been already defined by
- \cs{DeclareKanijFamily}.
+\item If the family~ has been listed in a list~$N_{\mathrm{J}}$, this means
+ that is not a Japanese font family, hence current Japanese font family
+ won't be changed.
%
%<*ja>
-\item ã¨ã³ã³ã¼ãã£ã³ã°ã«ããããã¡ããªã
-æ¢ã« \cs{DeclareKanjiFamily} ã«ãã£ã¦å®ç¾©ããã¦ããï¼
+\item ãã¡ããªããªã¹ã$N_{\mathrm{J}}$ã«æ¢ã«å«ã¾ãã¦ããã°ï¼ããã¯
+ ãåæãã©ã³ããã¡ããªã§ã¯ãªããã¨ãæå³ããã®ã§ï¼åæãã©ã³ããã¡ããªã¯å¤æ´ãããªãï¼
%
%<*en>
-\item A font definition named \texttt{.fd} (the file name is
- all lowercase) exists.
+\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and current Japanese font family
+ won't be changed.
+
+ If the \Pkg{luatexja-fontspec} package is \emph{not} loaded,
+now \LuaTeX-ja looks whether there exists a Japanese font encoding~ such that
+ a font definition named \texttt{.fd} (the file name is
+ all lowercase) exists. If so, current Japanese font family will be changed to
+ ~(the font definition file won't be loaded here).
+ If not, current Japanese font family won't be changed, and
+ is appended to the list~$N_{\mathrm{J}}$.
%
%<*ja>
-\item ãã©ã³ãå®ç¾©ãã¡ã¤ã«\texttt{.fd}ï¼ãã¡ã¤ã«åã¯å
¨ã¦å°æåï¼ãåå¨ããï¼
+\item ãã\Pkg{luatexja-fontspec}ããã±ã¼ã¸ãèªã¿è¾¼ã¾ãã¦ããã°ï¼ããã§çµäºã§ããï¼
+åæãã©ã³ããã¡ããªã¯å¤æ´ãããªããã¨ã«ãªãï¼
+
+ãã\Pkg{luatexja-fontspec}ããã±ã¼ã¸ãèªã¿è¾¼ã¾ãã¦ããªããã°ï¼åæã¨ã³ã³ã¼ãã£ã³ã°ã§
+ãã©ã³ãå®ç¾©ãã¡ã¤ã«\texttt{.fd}ï¼ãã¡ã¤ã«åã¯å
¨ã¦å°æåï¼ãåå¨ãããããªã
+ ã®ããããã©ããã調ã¹ãï¼
+åå¨ããã°ï¼åæãã©ã³ããã¡ããªã¯ã«å¤æ´ãããï¼ãã©ã³ãå®ç¾©ãã¡ã¤ã«ã¯å¤æ´ãããª
+ ãï¼ï¼
+åå¨ããªããã°ï¼ãªã¹ã$N_{\mathrm{J}}$ã«ã追å ããã ãã§ï¼åæãã©ã³ããã¡ããªã¯å¤æ´ãããªãï¼
+
%
-\end{itemize}
+\end{enumerate}
+
%<*en>
-\item Let current encoding scheme for alphabetic fonts be
- . For alphabetic font family, the criterion as above is used.
+Next, whether alphabetic font family will be changed is determined by following conditions.
+We use an auxiliary lists $F_{\mathrm{A}}$~and~$N_{\mathrm{A}}$, and
+patches \cs{DeclareFontEncoding}~and~\cs{DeclareFontFamily} to keep track of alphabetic
+ font encodings~and~families.
%
%<*ja>
-\item ç¾å¨ã®æ¬§æãã©ã³ãã«å¯¾ããã¨ã³ã³ã¼ãã£ã³ã°ãã¨ããï¼
- 欧æãã©ã³ããã¡ããªã«å¯¾ãã¦ãï¼ä¸è¨ã®åºæºãç¨ããããï¼
+次ã«ï¼æ¬§æãã©ã³ããã¡ããªã«ã¤ãã¦ã®å¤å®ãè¿°ã¹ã¦ããï¼
+è£å©çã«ã欧æãã©ã³ããã¡ããªã¨å¤æããããã¡ããªã®ãªã¹ã$F_{\textrm{A}}$ã¨ï¼
+ã欧æãã©ã³ããã¡ããªã§ã¯ãªãããã¡ããªãæ ¼ç´ãããªã¹ã$N_{\mathrm{A}}$ãç¨ããï¼
%
+
+\begin{enumerate}
%<*en>
-\item There is a case which none of the above applies, that is, the font
- family named doesn't seem to be defined neither under the
- encoding , nor under .
-In this case, the default family for font substitution is used for
- alphabetic and Japanese fonts. Note that current encoding will not
- be set to , unlike the original implementation in \LaTeX.
+\item If the family~ has been listed in a list~$F_{\mathrm{A}}$,
+ current alphabetic font family will be changed to .
+ Note that need not be defined under \emph{current} alphabetic font encoding.
%
%<*ja>
-\item ä¸è¨ã®ãããããé©ç¨ãããªãï¼ã¤ã¾ããã¨ã®
- ã©ã¡ãã§ãå®ç¾©ãããªããããªå ´åãããï¼
- ãã®å ´åï¼ä»£æ¿ãã©ã³ãã«ç¨ããããããã©ã«ãã®ãã©ã³ããã¡ããªã欧æãã©ã³ãã¨
- åæãã©ã³ãã«ç¨ããããï¼\LaTeX ã®ãªãªã¸ãã«ã®å®è£
ã¨ã¯ç°ãªãï¼
- ç¾å¨ã®ã¨ã³ã³ã¼ãã£ã³ã°ã¯ã«ã¯è¨å®ãããªããã¨ã«æ³¨æããï¼
+\item ãã¡ããªããªã¹ã$F_{\mathrm{A}}$ã«æ¢ã«å«ã¾ãã¦ããã°ï¼
+ 欧æãã©ã³ããã¡ããªã¯ã«å¤æ´ãããï¼
+ ããã§ï¼ã¯ç¾å¨ã®æ¬§æãã©ã³ãã¨ã³ã³ã¼ãã£ã³ã°ã§å®ç¾©ããã¦ããªãã¦ãããï¼
%
-\end{itemize}%
-%\vspace{-\medskipamount}
+%<*en>
+\item If the family~ has been listed in a list~$N_{\mathrm{A}}$, this means
+ that is not a alphabetic font family, hence current alphabetic font family
+ won't be changed.
+%
+%<*ja>
+\item ãã¡ããªããªã¹ã$N_{\mathrm{A}}$ã«æ¢ã«å«ã¾ãã¦ããã°ï¼ããã¯
+ ã欧æãã©ã³ããã¡ããªã§ã¯ãªããã¨ãæå³ããã®ã§ï¼æ¬§æãã©ã³ããã¡ããªã¯å¤æ´ãããªãï¼
+%
+%<*en>
+\item If there exists an alphabetic font encoding such that the family~ has been
+ defined under it, current alphabetic font family will be changed to , and
+ is appended to the list~$F_{\mathrm{A}}$.
+%
+%<*ja>
+\item ãã欧æãã©ã³ãã¨ã³ã³ã¼ãã£ã³ã°ä¸ã§ãã¡ããªãå®ç¾©ããã¦ããã°ï¼
+ ãªã¹ã$F_{\mathrm{A}}$ã«ã追å ãï¼æ¬§æãã©ã³ããã¡ããªã¯ã«å¤æ´ãããï¼
+%
+%<*en>
+\item Now \LuaTeX-ja looks whether there exists an alphabetic font encoding~ such that
+ a font definition named \texttt{.fd} (the file name is
+ all lowercase) exists. If so, current alphabetic font family will be changed to
+ ~(the font definition file won't be loaded here).
+ If not, current alphabetic font family won't be changed, and
+ is appended to the list~$N_{\mathrm{A}}$.
+%
+%<*ja>
+\item æçµæ®µéã§ã¯ï¼æ¬§æã¨ã³ã³ã¼ãã£ã³ã°ã§
+ãã©ã³ãå®ç¾©ãã¡ã¤ã«\texttt{.fd}ï¼ãã¡ã¤ã«åã¯å
¨ã¦å°æåï¼ãåå¨ãããããªã
+ ã®ããããã©ããã調ã¹ãï¼
+åå¨ããã°ï¼æ¬§æãã©ã³ããã¡ããªã¯ã«å¤æ´ãããï¼ãã©ã³ãå®ç¾©ãã¡ã¤ã«ã¯å¤æ´ãããª
+ ãï¼ï¼
+åå¨ããªããã°ï¼ãªã¹ã$N_{\mathrm{A}}$ã«ã追å ããã ãã§ï¼æ¬§æãã©ã³ããã¡ããªã¯å¤æ´ãããªãï¼
+
+%
+\end{enumerate}
+%<*en>
+Of course, there is a case that ``Japanese font family nor alphabetic font family is changed''.
+In this case, \LuaTeX-ja treats ``the argument is wrong'', so
+the default family for font substitution is used for alphabetic and Japanese fonts.
+%%% Note that current font encoding will not
+%%% be set to , unlike the original implementation in \LaTeX.
+Note that the execution of \cs{DeclareFontFamily} \emph{after} loading of \LuaTeX-ja makes
+the second argument (family) is appended to the list~$F_{\mathrm{A}}$.
+%
+%<*ja>
+ãã¦ï¼å¼æ°ã«ãã£ã¦ã¯ï¼ãåæãã©ã³ããã¡ããªã欧æãã©ã³ããã¡ããªãå¤æ´ããã¾ããã§ããã
+ã¨ããæ代ãããå¾ãï¼
+ ãã®å ´åï¼å¼æ°ã¯ä¸æ£ã ã£ãï¼ã¨ãããã¨ã«ãªãã®ã§ï¼
+代æ¿ãã©ã³ãã«ç¨ããããããã©ã«ãã®ãã©ã³ããã¡ããªã欧æãã©ã³ãã¨
+ åæãã©ã³ãã«ç¨ããããï¼
+%%%LaTeX ã®ãªãªã¸ãã«ã®å®è£
ã¨ã¯ç°ãªãï¼
+%%% ç¾å¨ã®ã¨ã³ã³ã¼ãã£ã³ã°ã¯ã«ã¯è¨å®ãããªããã¨ã«æ³¨æããï¼
+
+ãªãï¼\cs{DeclareFontFamily}ã\LuaTeX-jaã®èªã¿è¾¼ã¿å¾ã«å®è¡ããå ´åã¯ï¼
+第2å¼æ°ï¼ãã¡ããªåï¼ãèªåçã«$F_{\mathrm{A}}$ã«è¿½å ãããï¼
+%
\begin{figure}[!tb]
\begin{LTXexample}[pos=b]