From 0255a64e9f1a509c4dcbff89ce31605f0ead52eb Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Mon, 3 Feb 2014 10:00:02 +0900 Subject: [PATCH] updated manual. --- doc/luatexja.dtx | 41 +++++++++++++++++++++++++++++++++-------- src/luatexja.lua | 47 ++++++++++++++++++++++------------------------- 2 files changed, 55 insertions(+), 33 deletions(-) diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 98ba0c8..212e7f2 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -1956,8 +1956,11 @@ adopted in the whole paragraph or the whole hbox. \ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt}, xkanjiskip={0.25\zw plus 1pt minus 1pt}} \end{lstlisting} - %<*en> +Here \verb+\zw+ is a internal dimension +which stores fullwidth of the current Japanese font. +This \verb+\zw+ can be used as the unit \texttt{zw} in \pTeX. + It may occur that JFM contains the data of ``ideal width of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}'' and/or ``ideal width of \Param{\hyperlink{fld:xks}{xkanjiskip}}''. @@ -1965,6 +1968,9 @@ To use these data from JFM, set the value of \Param{\hyperlink{fld:kanjiskip}{ka \Param{\hyperlink{fld:xks}{xkanjiskip}} to \verb+\maxdimen+. % %<*ja> +ここで,\verb+\zw+ は現在の和文フォントの全角幅を表す長さであり, +\pTeX における長さ単位 \texttt{zw} と同じように使用できる. + JFMは「望ましい\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値」や 「望ましい\Param{\hyperlink{fld:xks}{xkanjiskip}}の値」を持っていることがある. これらのデータを使うためには,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}や% @@ -2642,7 +2648,6 @@ letter-spacing and the width of italic correction are not correct: \S あいう\/ABC \end{LTXexample} - %\subsection{Prefix \texttt{psft}} %\subsection{\texttt{psft}プリフィックス} \label{ssec-psft} @@ -4479,10 +4484,21 @@ Avant Garde (OT1/pag/m/n) に変わっていることがわかる. \userelfont\selectfont あいうabc \end{LTXexample} -%\section{Extensions} -%\section{拡張} +%<*en> +\section{Addons} +\LuaTeX-ja has several addon packages. +These addons are written as \LaTeX\ packages, but +\Pkg{luatexja-otf}~and~\Pkg{luatexja-adjust} can be loaded in plain \LuaTeX +by \verb+\input+. +% +%<*ja> +\section{拡張} +\LuaTeX-jaには(動作には必須ではないが)自由に読み込める拡張が付属している. +これらは\LaTeX のパッケージとして制作しているが, +\Pkg{luatexja-otf}と\Pkg{luatexja-adjust}についてはplain \LuaTeX でも\ +\verb+\input+ で読み込み可能である. +% \subsection{\texttt{luatexja-fontspec.sty}} - %<*en> As described in Subsection~\ref{ssec-fontspec}, this optional package provides the counterparts for several commands defined in the @@ -4542,11 +4558,14 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}. \label{ssec-ltjotf} %<*en> This optional package supports typesetting characters in -Adobe-Japan1. the package \Pkg{luatexja-otf} offers the following 2~low-level +Adobe-Japan1 character collection +(or other CID character collecton, if the font is supported). +The package \Pkg{luatexja-otf} offers the following 2~low-level commands: % %<*ja> -この追加パッケージはAdobe-Japan1の文字の出力をサポートする. +この追加パッケージはAdobe-Japan1(フォント自身が持っていれば, +別のCID文字セットでも可)の文字の出力をサポートする. \Pkg{luatexja-otf}は以下の2つの低レベルコマンドを提供する: % \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw} @@ -4570,6 +4589,13 @@ but please remind remarks below. % \end{list} +%<*ja> +このパッケージは,\texttt{ajmacros.sty}(\Pkg{otf}パッケージ付属のマクロ集,井上浩一氏作)から +漢字コードをUTF8にしたり,plain \LuaTeX でも利用可能するという +修正を加えた \texttt{luatexja-ajmacros.sty} も自動的に読み込む. +そのため,マクロ集にある \verb+\aj半角+ などのマクロもそのまま使用可能である. +% + %\paragraph{Remarks} %\paragraph{注意} %<*en> @@ -4598,7 +4624,6 @@ ordinary characters in the following points: % \end{itemize} - %\paragraph{Additional syntax of JFM} %\paragraph{JFMへの記法の追加} diff --git a/src/luatexja.lua b/src/luatexja.lua index 153bd7a..7c235fc 100644 --- a/src/luatexja.lua +++ b/src/luatexja.lua @@ -57,44 +57,45 @@ userid_table.IHB = luatexbase.newuserwhatsitid('inhibitglue', 'luatexja') -- \ userid_table.STCK = luatexbase.newuserwhatsitid('stack_marker', 'luatexja') -- スタック管理 userid_table.BPAR = luatexbase.newuserwhatsitid('begin_par', 'luatexja') -- 「段落始め」 +------------------------------------------------------------------------ +-- FIX node.remove +------------------------------------------------------------------------ do local node_remove, node_next, node_prev = node.remove, node.next, node.prev function luatexja.node_remove (head, current) if head==current then - local q, r = node_next(current), node_prev(current) - current.next = nil - if q then q.prev = r end - if r and node_next(r)==current then -- r is "real prev" - r.next = q - end - return q, q + local q, r = node_next(current), node_prev(current) + current.next = nil + if q then q.prev = r end + if r and node_next(r)==current then + r.next = q + end + return q, q else - return node_remove(head, current) + return node_remove(head, current) end end - local Dnode = node.direct or node if Dnode~=node then local Dnode_remove = Dnode.remove local Dnode_next, Dnode_prev = Dnode.getnext, node.getprev local getfield, setfield = Dnode.getfield, Dnode.setfield function luatexja.Dnode_remove (head, current) - if head==current then - local q, r = Dnode_next(current), Dnode_prev(current) - setfield(current, 'next', nil) - if q then setfield(q, 'prev', r) end - if r and Dnode_next(r) == current then -- r is "real prev" - setfield(r, 'next', q) - end - return q, q - else - return Dnode_remove(head, current) - end + if head==current then + local q, r = Dnode_next(current), Dnode_prev(current) + setfield(current, 'next', nil) + if q then setfield(q, 'prev', r) end + if r and Dnode_next(r) == current then + setfield(r, 'next', q) + end + return q, q + else + return Dnode_remove(head, current) + end end else luatexja.Dnode_remove = luatexja.node_remove end - end --- 定義終わり @@ -119,10 +120,6 @@ local attr_icflag = luatexbase.attributes['ltj@icflag'] local attr_uniqid = luatexbase.attributes['ltj@uniqid'] local cat_lp = luatexbase.catcodetables['latex-package'] - ----- table: charprop_stack_table [stack_level].{pre|post|xsp}[chr_code] - - -- Three aux. functions, bollowed from tex.web local unity=65536 -- 2.11.0