• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョンc0cd4f9f4a662b50e47fb55858ecadb23e8f8517 (tree)
日時2011-10-12 14:02:49
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

Merge branch 'kitagawa_test' into tc11-docs

変更サマリ

差分

Binary files a/doc/man-en.pdf and b/doc/man-en.pdf differ
Binary files /dev/null and b/doc/man-ja.pdf differ
--- a/doc/manual.dtx
+++ b/doc/manual.dtx
@@ -2,30 +2,39 @@
22
33 %<*en>
44 \documentclass[a4paper,titlepage]{article}
5-\usepackage[margin=20mm]{geometry}
5+\usepackage[margin=20mm,footskip=5mm]{geometry}
66 %</en>
77 %<*ja>
88 \documentclass[a4paper,titlepage]{bxjsarticle}
9-\setpagelayout*{margin=20mm}
9+\setpagelayout*{margin=20mm,footskip=5mm}
1010 \def\headfont{\normalfont\bfseries}
1111 % \def\headfont{\sffamily\gtfamily} is needed in ordinal documents
1212 %</ja>
1313
14-\usepackage{amsmath,amssymb,xcolor,pict2e}
14+\usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float}
1515 \usepackage{booktabs,listings,lltjlisting,showexpl,multicol}
1616 \usepackage{luatexja-otf}
17-\usepackage[unicode=true]{hyperref}
17+\usepackage[unicode=false]{hyperref}
1818 \usepackage[all]{xy}
1919 \SelectTips{cm}{}
2020
2121 \DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
2222 \DeclareRobustCommand\LuaTeX{Lua\TeX}
23+\DeclareRobustCommand\pdfTeX{pdf\TeX}
2324 \DeclareRobustCommand\pTeX{p\kern-.05em\TeX}
2425 \DeclareRobustCommand\upTeX{p\kern-.05em\TeX}
2526 \DeclareRobustCommand\pLaTeX{p\kern-.05em\LaTeX}
2627 \DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
2728 \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
2829
30+\theoremstyle{definition}
31+\newtheorem{defn}{Definition}
32+
33+\newenvironment{cslist}{%
34+ \leftskip2em\parindent=0pt\def\makelabel##1{{\tt\char92##1}}
35+ \def\{{\char`\{}\def\}{\char`\}}
36+ \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
37+}{}
2938
3039 \makeatletter
3140 \long\def\@makecaption#1#2{%
@@ -88,6 +97,7 @@ Japanese documents when using \LuaTeX.
8897 %</ja>
8998
9099 \subsection{Backgrounds}
100+%<*en>
91101 Traditionally, ASCII \pTeX, an extension of \TeX, and its derivatives
92102 are used to typeset Japanese documents in \TeX. \pTeX\ is an engine
93103 extension of \TeX: so it can produce high-quality Japanese documents
@@ -106,13 +116,50 @@ using Lua `callbacks', users can customize the internal processing of
106116 \LuaTeX. So there is no need to modify sources of engines to
107117 support Japanese typesetting: to do this, we only have to write Lua
108118 scripts for appropriate callbacks.
109-
119+%</en>
120+%<*ja>
121+従来,「\TeX を用いて日本語組版を行う」といったとき,エンジンとしては
122+ASCII \pTeX やそれの拡張物が用いられることが一般的であった.\pTeX は\TeX
123+のエンジン拡張であり,(少々仕様上不便な点はあるものの)商業印刷の分野に
124+も用いられるほどの高品質な日本語組版を可能としている.だが,それは弱点に
125+もなってしまった:\pTeX という(組版的に)満足なものがあったため,海外で
126+行われている数々の\TeX の拡張──例えば\eTeX や\pdfTeX ──や,TrueType,
127+OpenType, Unicodeといった計算機で日本語を扱う際の状況の変化に追従すること
128+を怠ってしまったのだ.
129+
130+ここ数年,若干状況は改善されてきた.現在手に入る大半の\pTeX バイナリでは
131+外部UTF-8入力が利用可能となり,さらにUnicode化を推進し,\pTeX の内部処理
132+までUnicode化した\upTeX も開発されている.また,\pTeX に\eTeX 拡張をマー
133+ジした\epTeX も登場し,\TeX\ Live\ 2011では\pLaTeX が\epTeX の上で動作す
134+るようになった.だが,\pdfTeX 拡張(pdf直接出力やmicro-typesetting)を
135+\pTeX に対応させようという動きはなく,海外とのgapは未だにあるのが現状であ
136+る.
137+
138+しかし,\LuaTeX の登場で,状況は大きく変わることになった.Luaコードで
139+`callback'を書くことにより,\LuaTeX の内部処理に割り込みをかけることが可
140+能となった.これは,エンジン拡張という真似をしなくても,Luaコードとそれに
141+関する\TeX マクロを書けば,エンジン拡張とほぼ同程度のことができるようになっ
142+たということを意味する.\LuaTeX-jaは,このアプローチによってLuaコード・
143+\TeX マクロによって日本語組版を\LuaTeX の上で実現させようという目的で開発
144+が始まったパッケージである.
145+%</ja>
110146
111147 \subsection{Major Changes from \pTeX}
148+%<*en>
112149 The \LuaTeX-ja package is under much influence of \pTeX\ engine. The initial
113150 target of development was to implement features of \pTeX. However,
114151 \emph{\LuaTeX-ja is not a just porting of \pTeX; unnatural
115152 specifications/behaviors of \pTeX\ were not adopted}.
153+%</en>
154+
155+%<*ja>
156+\LuaTeX-jaは,\pTeX に多大な影響を受けている.初期の開発目標は,\pTeX の機
157+能をLuaコードにより実装することであった.しかし,開発が進むにつれ,\pTeX
158+の完全な移植は不可能であり,また\pTeX における実装がいささか不可解になっ
159+ているような状況も発見された.そのため,\textbf{\LuaTeX-ja は,もはや
160+\pTeX の完全な移植は目標とはしない.\pTeX における不自然な仕様・挙動があ
161+れば,そこは積極的に改める.}
162+%</ja>
116163
117164 The followings are major changes from \pTeX:
118165 \begin{itemize}
@@ -177,18 +224,23 @@ We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts
177224 This project is hosted by SourceForge.JP.
178225
179226 \paragraph{Members}\
180-% \begin{multicols}{2}
181-% \begin{itemize}
182-% \item Hironori KITAGAWA
183-% \item Kazuki MAEDA
184-% \item Takayuki YATO
185-% \item Yusuke KUROKI
186-% \item Noriyuki ABE
187-% \item Munehiro YAMAMOTO
188-% \item Tomoaki HONDA
189-% \par\
190-% \end{itemize}
191-% \end{multicols}
227+%<*en>
228+\begin{multienumerate}
229+\def\labelenumi{$\bullet$}
230+\mitemxxx{Hironori KITAGAWA}{Kazuki MAEDA}{Takayuki YATO}
231+\mitemxxx{Yusuke KUROKI}{Noriyuki ABE}{Munehiro YAMAMOTO}
232+\mitemx{Tomoaki HONDA}
233+\end{multienumerate}
234+%</en>
235+%<*ja>
236+\begin{multienumerate}
237+\def\labelenumi{$\bullet$}
238+\mitemxxx{Hironori KITAGAWA}{Kazuki MAEDA}{Takayuki YATO}
239+\mitemxxx{Yusuke KUROKI}{Noriyuki ABE}{Munehiro YAMAMOTO}
240+\mitemx{Tomoaki HONDA}
241+\end{multienumerate}
242+%</ja>
243+
192244
193245 % \paragraph{Acknowledgments} -- 挿入するならここ
194246
@@ -332,7 +384,7 @@ supports some of functions in \texttt{OTF} package.
332384 %lltjlisting.sty要修正?:↑「森」の直後で改行.
333385
334386
335-\subsection{Changing Fonts}
387+\subsection{Changing Fonts}\label{ssub-chgfnt}
336388 \paragraph{Remark: Japanese Characters in Math Mode}
337389 Since \pTeX\ supports Japanese characters in math mode, there are
338390 sources like the following:
@@ -382,18 +434,31 @@ of \pLaTeXe\ (in {\tt plfonts.dtx}).
382434 \verb+\fontshape+ and \verb+\selectfont+ can be used to change
383435 attributes of Japanese fonts.
384436 \begin{center}
385-\begin{tabular}{ccccc}
437+\begin{tabular}{cccccc}
386438 \toprule
387-&\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}\\\midrule
439+&\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule
388440 alphabetic fonts
389-&\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+\\
441+&\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
442+&\verb+\useroman+\\
390443 Japanese fonts
391-&\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+\\
392-both&---&--&\verb+\fontseries+&\verb+\fontshape+\\
393-auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---\\
444+&\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
445+&\verb+\usekanji+\\
446+both&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
447+auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
394448 \bottomrule
395449 \end{tabular}
396450 \end{center}
451+
452+%<*ja>
453+ここで,\verb+\fontencoding{<encoding>}+は,引数により和文側か欧文側かの
454+ どちらかが切り替わる.例えば,次の入力で最初の\verb+\fontencoding+
455+ の呼び出しは和文フォントのエンコーディングを\texttt{JT3}に変更し,
456+ 2回目の呼びだしでは欧文フォント側を\texttt{T1}へと変更する.
457+\begin{verbatim}
458+\fontencoding{JY3}\fontencoding{T1}
459+\end{verbatim}
460+%</ja>
461+
397462 \item For defining a Japanese font family, use \verb+\DeclareKanjiFamily+
398463 instead of \verb+\DeclareFontFamily+.
399464 \end{itemize}
@@ -464,8 +529,7 @@ setting of \LuaTeX-ja):
464529 \begin{verbatim}
465530 \ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
466531 \end{verbatim}
467-
468-
532+The argument to {\sf jacharrange} parameter is a list of integer. Negative interger $-n$ in the list means that `the character range~$n$ is ...'.
469533
470534 \paragraph{Default Setting}
471535 Lua\TeX-ja predefines eight character ranges for convinience. They are
@@ -522,30 +586,30 @@ This range consist of the following Unicode ranges, \emph{except characters in t
522586 \end{multicols}
523587 \item[Range~3${}^{\text{J}}$] Punctuations and Miscellaneous symbols. The block list is
524588 indicated in Table~\ref{table-rng3}.
525-\begin{table}[p]
589+\begin{table}[!tb]
526590 \caption{Unicode blocks in predefined character range~3.}\label{table-rng3}
527591 \catcode`\"=13\def"#1#2#3#4{{\tt U+#1#2#3#4}}%"
528-\begin{center}
529-\begin{tabular}{ll}
530-"2000--"206F&General Punctuation\\
592+\begin{center}\small
593+\begin{tabular}{llll}
594+"2000--"206F&General Punctuation&
531595 "2070--"209F&Superscripts and Subscripts\\
532-"20A0--"20CF&Currency Symbols\\
533-"20D0--"20FF&Combining Diacritical Marks for Symbols\\
534-"2100--"214F&Letterlike Symbols\\
596+"20A0--"20CF&Currency Symbols&
597+"20D0--"20FF&Comb.\ Diacritical Marks for Symbols\\
598+"2100--"214F&Letterlike Symbols&
535599 "2150--"218F&Number Forms\\
536-"2190--"21FF&Arrows\\
600+"2190--"21FF&Arrows&
537601 "2200--"22FF&Mathematical Operators\\
538-"2300--"23FF&Miscellaneous Technical\\
602+"2300--"23FF&Miscellaneous Technical&
539603 "2400--"243F&Control Pictures\\
540-"2500--"257F&Box Drawing\\
604+"2500--"257F&Box Drawing&
541605 "2580--"259F&Block Elements\\
542-"25A0--"25FF&Geometric Shapes\\
606+"25A0--"25FF&Geometric Shapes&
543607 "2600--"26FF&Miscellaneous Symbols\\
544-"2700--"27BF&Dingbats\\
608+"2700--"27BF&Dingbats&
545609 "2900--"297F&Supplemental Arrows-B\\
546-"2980--"29FF&Miscellaneous Mathematical Symbols-B\\
610+"2980--"29FF&Misc.\ Mathematical Symbols-B&
547611 "2B00--"2BFF&Miscellaneous Symbols and Arrows\\
548-"E000--"F8FF&Private Use Area\\
612+"E000--"F8FF&Private Use Area&
549613 "FB00--"FB4F&Alphabetic Presentation Forms
550614 \end{tabular}
551615 \end{center}
@@ -562,48 +626,48 @@ This range consist of the following Unicode ranges, \emph{except characters in t
562626 \end{lstlisting}
563627 \item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
564628 \item[Range~6${}^{\text{J}}$] Characters used in Japanese. The block list is indicated in Table~\ref{table-rng6}.
565-\begin{table}[p]
629+\begin{table}[!tb]
566630 \caption{Unicode blocks in predefined character range~6.}\label{table-rng6}
567631 \catcode`\"=13\def"#1#2#3#4{{\tt U+#1#2#3#4}}%"
568-\begin{center}
569-\begin{tabular}{ll}
570-"2460--"24FF&Enclosed Alphanumerics\\
632+\begin{center}\small
633+\begin{tabular}{llll}
634+"2460--"24FF&Enclosed Alphanumerics&
571635 "2E80--"2EFF&CJK Radicals Supplement\\
572-"3000--"303F&CJK Symbols and Punctuation\\
636+"3000--"303F&CJK Symbols and Punctuation&
573637 "3040--"309F&Hiragana\\
574-"30A0--"30FF&Katakana\\
638+"30A0--"30FF&Katakana&
575639 "3190--"319F&Kanbun\\
576-"31F0--"31FF&Katakana Phonetic Extensions\\
640+"31F0--"31FF&Katakana Phonetic Extensions&
577641 "3200--"32FF&Enclosed CJK Letters and Months\\
578-"3300--"33FF&CJK Compatibility\\
642+"3300--"33FF&CJK Compatibility&
579643 "3400--"4DBF&CJK Unified Ideographs Extension A\\
580-"4E00--"9FFF&CJK Unified Ideographs\\
644+"4E00--"9FFF&CJK Unified Ideographs&
581645 "F900--"FAFF&CJK Compatibility Ideographs\\
582-"FE10--"FE1F&Vertical Forms\\
646+"FE10--"FE1F&Vertical Forms&
583647 "FE30--"FE4F&CJK Compatibility Forms\\
584-"FE50--"FE6F&Small Form Variants\\
648+"FE50--"FE6F&Small Form Variants&
585649 "{20}000--"{2F}FFF&(Supplementary Ideographic Plane)
586650 \end{tabular}
587651 \end{center}
588652 \end{table}
589653 \item[Range~7${}^{\text{J}}$] Characters used in CJK languages, but not included in Adobe-Japan1-6.
590654 The block list is indicated in Table~\ref{table-rng7}.
591-\begin{table}[p]
655+\begin{table}[!tb]
592656 \caption{Unicode blocks in predefined character range~7.}\label{table-rng7}
593657 \catcode`\"=13\def"#1#2#3#4{{\tt U+#1#2#3#4}}%"
594-\begin{center}
595-\begin{tabular}{ll}
596-"1100--"11FF&Hangul Jamo\\
658+\begin{center}\small
659+\begin{tabular}{llll}
660+"1100--"11FF&Hangul Jamo&
597661 "2F00--"2FDF&Kangxi Radicals\\
598-"2FF0--"2FFF&Ideographic Description Characters\\
662+"2FF0--"2FFF&Ideographic Description Characters&
599663 "3100--"312F&Bopomofo\\
600-"3130--"318F&Hangul Compatibility Jamo\\
664+"3130--"318F&Hangul Compatibility Jamo&
601665 "31A0--"31BF&Bopomofo Extended\\
602-"31C0--"31EF&CJK Strokes\\
666+"31C0--"31EF&CJK Strokes&
603667 "A000--"A48F&Yi Syllables\\
604-"A490--"A4CF&Yi Radicals\\
668+"A490--"A4CF&Yi Radicals&
605669 "A830--"A83F&Common Indic Number Forms\\
606-"AC00--"D7AF&Hangul Syllables\\
670+"AC00--"D7AF&Hangul Syllables&
607671 "D7B0--"D7FF&Hangul Jamo Extended-B
608672 \end{tabular}
609673 \end{center}
@@ -777,15 +841,40 @@ The followings are JFMs shipped with Lua\TeX-ja:
777841 \item[\tt jfm-min.lua] A counterpart for \verb+min10.tfm+, which is one
778842 of the default Japanese font metric shipped with \pTeX. There
779843 are notable difference between this JFM and other 2~JFMs, as
780- showed below:
781-
782-何かいい例.単純に「min10にはバグあり」ではなく,プロポーショナルな側面も見せたいよね
783-(乙部さんのmin10.pdfの例を使う?)
844+ shown in Table~\ref{tab-difjfm}.
784845 \end{description}
785846
786-\item[jfmvar=<string>] ...
847+\item[jfmvar=<string>] Sometimes there is a need that
787848 \end{list}
788849
850+\begin{table}[t]
851+\caption{Differences between JFMs shipped with \LuaTeX-ja}
852+\label{tab-difjfm}
853+\begin{center}
854+\def\r#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
855+\setbox0=\vtop{\hsize=7\zw\noindent ◆◆◆◆◆◆◆
856+ある日モモちゃんがお使いで迷子になって泣きました.}\copy0
857+\vrule height 0pt depth \dp0}}
858+\def\s#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
859+\setbox0=\vtop{\hsize=7\zw\noindent ちょっと!何}\copy0}}
860+\def\t#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 19.24432pt \g
861+\setbox0=\hbox{漢}%
862+\vrule width 0.4pt height\ht0 depth\dp0\kern-.2pt\copy0
863+\kern-\wd0\vrule width\wd0height .2pt depth .2pt
864+\kern-\wd0\raise\ht0\hbox{\vrule width\wd0height .2pt depth .2pt}%
865+\kern-\wd0\lower\dp0\hbox{\vrule width\wd0height .2pt depth .2pt}%
866+\kern-.2pt\vrule width 0.4pt height\ht0 depth \dp0}}
867+\begin{tabular}{rccc}
868+\toprule
869+&\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
870+\midrule
871+Example~1&\r{ujis}&\r{jis}&\r{min}\\
872+Example~2&\s{ujis}&\s{jis}&\s{min}\\
873+Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
874+\bottomrule
875+\end{tabular}
876+\end{center}
877+\end{table}
789878
790879 \paragraph{Note: kern feature}\label{para-kern}
791880 Some fonts have information for inter-glyph spacing. However, this
@@ -860,10 +949,8 @@ This field is a list of characters which are in this character
860949 than 0 (hence, the character class~0 contains most of
861950 \textbf{JAchar}s). In the list, a character can be
862951 specified by its code number, or by the character itself
863- (as a string of length~1).
864-
865-In addition to those `real' characters, the following `imaginary
866- characters' can be specified in the list:
952+ (as a string of length~1). Moreover, there are `imaginary
953+ characters' which specified in the list. We will describe these later.
867954
868955 \item[width=<length>, height=<length>, depth=<length>, italic=<length>]\ (required)
869956
@@ -886,7 +973,7 @@ In most cases, \texttt{left} and \texttt{down} fields are~0, while
886973 it is not uncommon that the \texttt{align} field is \texttt{'middle'} or \texttt{'right'}.
887974 For example, setting the \texttt{align} field to \texttt{'right'} is practically needed
888975 when the current character class is the class for opening delimiters'.
889-\begin{figure}[tb]
976+\begin{figure}[!tb]
890977 \begin{minipage}{0.4\textwidth}%
891978 \begin{center}\unitlength=10pt\small
892979 \begin{picture}(15,12)(-1,-4)
@@ -962,6 +1049,78 @@ the `real' glyph is centered horizontally (the green rectangle).
9621049 \item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>\}, ...\}}]
9631050 \end{list}
9641051
1052+%<*en>
1053+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
1054+\item['lineend'] An ending of a line.
1055+\item['diffmet'] Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
1056+\item['boxbdd'] The beginning/ending of a horizontal box, and the beginging of a noindented paragraph.
1057+\item['parbdd'] The beginning of an (indented) paragraph.
1058+\item['jcharbdd'] A boundary between \textbf{JAchar} and anything else
1059+ (such as \textbf{ALchar}, kern, glue, ...).
1060+\item[$-1$] The left/right boundary of an inline math formula.
1061+\end{list}
1062+%</en>
1063+
1064+%<*ja>
1065+上で説明した通り,\texttt{chars}フィールド中にはいくつかの「特殊文字」も
1066+指定可能である.これらは,大半が\pTeX のJFMグルーの挿入処理ではみな「文字
1067+クラス0の文字」として扱われていた文字であり,その結果として\pTeX より細か
1068+い組版調整ができるようになっている.以下のその一覧を述べる:
1069+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
1070+\item['lineend'] 行の終端を表す.
1071+\item['diffmet']
1072+
1073+\item['boxbdd'] hboxの先頭と末尾,及びインデントされていない
1074+ (\verb+\noindent+で開始された)段落の先頭を表す.
1075+\item['parbdd'] 通常の(\verb+\noindent+で開始されていない)段落の先頭.
1076+\item['jcharbdd'] 和文文字と「その他のもの」(欧文文字,glue,kern等)との境界.
1077+\item[$-1$] 行中数式と地の文との境界.
1078+\end{list}
1079+
1080+\paragraph{\pTeX 用和文フォントメトリックの移植}
1081+以下に,\pTeX 用和文フォントメトリックを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
1082+\begin{itemize}
1083+\item 実際に出力される和文フォントのサイズがdesign sizeとなる.
1084+このため,例えば$1\,\textrm{zw}$がdesign sizeの0.962216倍であるJISフォン
1085+ トメトリック等を移植する場合は,
1086+\begin{itemize}
1087+\item JFM中の全ての数値を$1/0.962216$倍しておく.
1088+\item \TeX ソース中で使用するところで,サイズ指定を0.962216倍にする.
1089+ \LaTeX でのフォント宣言なら,例えば次のように:
1090+\begin{verbatim}
1091+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] psft:Ryumin-Light:jfm=jis}{}
1092+\end{verbatim}
1093+\end{itemize}
1094+\item 上に述べた特殊文字は,\texttt{'boxbdd'}を除き文字クラスを全部0とする
1095+ (JFM中に単に書かなければよい).
1096+\item \texttt{'boxbdd'}については,それのみで一つの文字クラスを形成し,その
1097+ 文字クラスに関してはglue/kernの設定はしない.
1098+
1099+これは,\pTeX では,
1100+ hboxの先頭・末尾とインデントされていない(\verb+\noindent+で開始さ
1101+ れた)段落の先頭にはJFMグルーは入らないという仕様を実現させるためである.
1102+\item \pTeX の組版を再現させようというのが目的であれば以上の注意を守れば十分である.
1103+
1104+ところで,\pTeX では通常の段落の先頭にJFMグルーが残るという仕様があるので,
1105+ 段落先頭の開き括弧は全角二分下がりになる.全角下がりを実現させるに
1106+ は,段落の最初に手動で\verb+\inhibitglue+を追加するか,あるいは
1107+ \verb+\everypar+のhackを行い,それを自動化させるしかなかった.
1108+
1109+一方,\LuaTeX-jaでは,\texttt{'parbdd'}によって,それがJFM側で調整できるよ
1110+うになった.例えば,\LuaTeX-ja同梱のJFMのように,\texttt{'boxbdd'}と同じ文字クラスに
1111+\texttt{'parbdd'}を入れれば全角下がりとなる.
1112+
1113+\begin{LTXexample}
1114+\jfont\g=psft:Ryumin-Light:jfm=test \g
1115+\parindent1\zw\noindent{}◆◆◆◆◆
1116+\par{}「◆◆←二分下がり
1117+\par{}【◆◆←全角下がり
1118+\par{}〔◆◆←全角二分下がり
1119+\end{LTXexample}
1120+\end{itemize}
1121+
1122+%</ja>
1123+
9651124 \subsection{Math Font Family}
9661125 \TeX\ handles fonts in math formulas by 16~font families\footnote{Omega,
9671126 Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX can handles 256~families, but
@@ -971,11 +1130,13 @@ an external package is needed to support this in plain \TeX\ and
9711130
9721131 \LuaTeX-ja's handling of Japanese fonts in math formulas is similar;
9731132 Table~\ref{tab-math} shows counterparts to \TeX's primitives for math
974-font families.
1133+font families. There is no relation between the value of
1134+\verb+\fam+ and that of \verb+\jfam+; with appropreate settings,
1135+you can set both \verb+\fam+ and \verb+\jfam+ to~the same value.
9751136
976-\begin{table}[tb]
977-\label{tab-math}
1137+\begin{table}[!tb]
9781138 \caption{Primitives for Japanese math fonts.}
1139+\label{tab-math}
9791140 \begin{center}\def\{{\char`\{}\def\}{\char`\}}
9801141 \begin{tabular}{lll}
9811142 \toprule
@@ -990,6 +1151,82 @@ scriptscript size&\tt\textsf{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\ve
9901151 \end{center}
9911152 \end{table}
9921153
1154+\subsection{Callbacks}
1155+Like \LuaTeX\ itself, \LuaTeX-ja also has callbacks. These callbacks can
1156+be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks
1157+\begin{list}{}%
1158+{\def\makelabel#1{\bfseries#1}}
1159+\item[\texttt{luatexja.load\_jfm} callback]
1160+With this callback you can overwrite JFMs.
1161+
1162+\begin{verbatim}
1163+function (<table> jfm_info, <string> jfm_name)
1164+ return <table> new_jfm_info
1165+end
1166+\end{verbatim}
1167+
1168+The argument \verb+jfm_info+ contains a table similar to the table in a JFM file, except
1169+this argument has \texttt{chars} field which contains character codes
1170+ whose character class is not~0.
1171+
1172+An example of this callback is the \texttt{ltjarticle} class, with
1173+ forcefully assigning character class~0 to \texttt{'parbdd'}
1174+ in the JFM \texttt{jfm-min.lua}. This callback doesn't
1175+ replace any code of \LuaTeX-ja.
1176+
1177+\item[\texttt{luatexja.define\_font} callback]
1178+This callback and the next callback form a pair, and you can assign letters which don't have
1179+ fixed codepoints in Unicode to non-zero character classes.
1180+This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
1181+\begin{verbatim}
1182+function (<table> jfont_info, <number> font_number)
1183+ return <table> new_jfont_info
1184+end
1185+\end{verbatim}
1186+
1187+You may assume that \verb+jfont_info+ has the following fields:
1188+\begin{description}
1189+\item[\tt jfm] The index number of JFM.
1190+\item[\tt size] Font size in a scaled point (${}=2^{-16}\,\textrm{pt}$).
1191+\item[\tt var] The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
1192+\end{description}
1193+
1194+The returned table \verb+new_jfont_info+ also should include these three fields.
1195+The \verb+font_number+ is a font number.
1196+
1197+A good example of this and the next callbacks is \texttt{luatexja-otf}
1198+ package, supporting \verb+"AJ1-xxx"+ form for Adobe-Japan1
1199+ CID characters in a JFM. This callback doesn't replace any
1200+ code of \LuaTeX-ja.
1201+
1202+
1203+\item[\texttt{luatexja.find\_char\_class} callback]
1204+This callback is called just when \LuaTeX-ja inready to determine which
1205+ character class a character \verb+chr_code+ belongs.
1206+A function used in this callback should be in the following form:
1207+\begin{lstlisting}[numbers=left]
1208+function (<number> char_class, <table> jfont_info, <number> chr_code)
1209+ if char_class~=0 then return char_class
1210+ else
1211+ ....
1212+ return (<number> new_char_class or 0)
1213+ end
1214+end
1215+\end{lstlisting}
1216+
1217+The argument \verb+char_class+ is the result of \LuaTeX-ja's default
1218+ routine or previous function calls in this callback, hence
1219+ this argument may not be 0. Moreover, the returned
1220+ \verb+new_char_class+ should be as same as \verb+char_class+ when \verb+char_class+
1221+ is not~0, otherwise you will overwrite the \LuaTeX-ja's
1222+ default routine.
1223+
1224+This callback doesn't replace any code of \LuaTeX-ja.
1225+
1226+
1227+
1228+\end{list}
1229+
9931230
9941231
9951232 \section{Parameters}
@@ -1027,7 +1264,9 @@ character other than space~`{\tt\char32}'~(U+0020) has the category code
10271264 12~(other), while the space has 10~(space).
10281265
10291266 \subsection{List of Parameters}
1030-In the following list of parameters, [\verb+\cs+] indicates the counterpart in \pTeX, and each symbol has the following meaning:
1267+The following is the list of parameters which can be specificated by the
1268+\verb+\ltjsetparameter+ command. [\verb+\cs+] indicates the counterpart
1269+in \pTeX, and symbols beside each parameter has the following meaning:
10311270 \begin{itemize}
10321271 \item No mark: values at the end of the paragraph or the hbox are
10331272 adopted in the whole paragraph/hbox.
@@ -1050,8 +1289,38 @@ At the present version, the lowermost bit of <natural number> indicates
10501289 (see the description of \textsf{jcharwidowpenalty} above).
10511290
10521291
1053-\item[\textsf{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]
1292+\item[\textsf{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
1293+%<*ja>
1294+文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
1295+ この文字の前に挿入/追加されるペナルティの量を指定する.
1296+
1297+例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,標準で読み込まれる
1298+ \texttt{luatexja-kinsoku.tex}において
1299+\begin{verbatim}
1300+\ltjsetparameter{prebreakpenalty={`〙,10000}}
1301+\end{verbatim}
1302+と,最大値の10000が指定されている.他にも,小書きのカナなど,絶対禁止とい
1303+ うわけではないができれば行頭にはきて欲しくない場合に,0と
1304+ 10000の間の値を指定するのも有用であろう.
1305+\begin{verbatim}
1306+\ltjsetparameter{prebreakpenalty={`ゕ,150}}
1307+\end{verbatim}
1308+%</ja>
1309+
10541310 \item[\textsf{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
1311+%<*ja>
1312+文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
1313+ この文字の後に挿入/追加されるペナルティの量を指定する.
1314+
1315+\pTeX では,\verb+\prebreakpenalty+, \verb+\postbreakpenalty+において,
1316+\begin{itemize}
1317+\item 一つの文字に対して,pre, postどちらか一つしか指定することができなかっ
1318+ た(後から指定した方で上書きされる).
1319+\item pre, post合わせて256文字分の情報を格納することしかできなかった.
1320+\end{itemize}
1321+という制限があったが,\LuaTeX-ja ではこれらの制限は解消されている.
1322+%</ja>
1323+
10551324 \item[\textsf{jatextfont}\,=\{<jfam>,<jfont\_cs>\}] [\verb+\textfont+ in \TeX]
10561325 \item[\textsf{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}] [\verb+\scriptfont+ in \TeX]
10571326 \item[\textsf{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}] [\verb+\scriptscriptfont+ in \TeX]
@@ -1072,13 +1341,18 @@ This is the default value.
10721341
10731342 \item[\textsf{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
10741343
1075-Setting whether inserting \textsf{xkanjiskip} is allowed before/after a \textbf{ALchar} whose character code is <chr\_code>.
1344+Setting whether inserting \textsf{xkanjiskip} is allowed before/after a
1345+ \textbf{ALchar} whose character code is <chr\_code>.
10761346 The followings are allowed for <mode>:
10771347 \begin{description}
1078-\item[0, \texttt{inhibit}] Insertion of \textsf{xkanjiskip} is inhibited before the charater, nor after the charater.
1079-\item[1, \texttt{preonly}] Insertion of \textsf{xkanjiskip} is allowed before the charater, but not after.
1080-\item[2, \texttt{postonly}] Insertion of \textsf{xkanjiskip} is allowed after the charater, but not before.
1081-\item[3, \texttt{allow}] Insertion of \textsf{xkanjiskip} is allowed before the charater and after the charater.
1348+\item[0, \texttt{inhibit}] Insertion of \textsf{xkanjiskip} is inhibited
1349+ before the charater, nor after the charater.
1350+\item[1, \texttt{preonly}] Insertion of \textsf{xkanjiskip} is allowed
1351+ before the charater, but not after.
1352+\item[2, \texttt{postonly}] Insertion of \textsf{xkanjiskip} is allowed
1353+ after the charater, but not before.
1354+\item[3, \texttt{allow}] Insertion of \textsf{xkanjiskip} is allowed both
1355+ before the charater and after the charater.
10821356 This is the default value.
10831357 \end{description}
10841358 Note that parameters \textsf{jaxspmode} and \textsf{alxspmode} use a common table.
@@ -1105,7 +1379,8 @@ The allowed arguments are the followings:
11051379
11061380
11071381 \section{Other Primitives}
1108-\subsection{Compatibility with \pTeX}
1382+\subsection{Primitives for Compatibility}
1383+The following primtives are implemented for compatibility with \pTeX:
11091384 \begin{list}{}{\def\makelabel{\ttfamily\char92 }}
11101385 \item[kuten]
11111386 \item[jis]
@@ -1134,7 +1409,7 @@ With the help of this example, we remark the specification of \verb+\inhibitglue
11341409 \item The call of \verb+\inhibitglue+ in the (restricted) horizontal
11351410 mode is only effective on the spot; does not get over boundary of
11361411 paragraphs. Moreover, \verb+\inhibitglue+ cancels ligatures and
1137- kernings, as shown in l.~4 of above example.
1412+ kernings, as shown in line~4 of above example.
11381413 \item The call of \verb+\inhibitglue+ in math mode is just ignored.
11391414 \end{itemize}
11401415
@@ -1142,6 +1417,67 @@ With the help of this example, we remark the specification of \verb+\inhibitglue
11421417 \subsection{Patch for NFSS2}
11431418 As described in Subsection~\ref{ssec-ltx}, \LuaTeX-ja simply adopted
11441419 \texttt{plfonts.dtx} in \pLaTeXe\ for the Japanese patch for NFSS2.
1420+For an convinience, we will describe
1421+commands which are not described in Subsection~\ref{ssub-chgfnt}.
1422+
1423+\begin{cslist}%
1424+\item[DeclareYokoKanjiEncoding\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
1425+In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families
1426+ and Japanese font families is only made by its
1427+ encoding. For example, encodings OT1 and T1 are for
1428+ alphabetic font families, and a Japanese font family cannot
1429+ have these encodings. This command defines a new encoding
1430+ scheme for Japanese font family (in horizontal direction).
1431+
1432+\item[DeclareKanjiEncodingDefaults\{<text-settings>\}\{<math-settings>\}]
1433+\item[DeclareKanjiSubstitution\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}]
1434+\item[DeclareErrorKanjiFont\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}\{<size>\}]
1435+
1436+The above 3~commands are just the counterparts for \verb+DeclareFontEncodingDefaults+ and~others.
1437+
1438+\item[reDeclareMathAlphabet\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
1439+和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
1440+具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>と,和文数式用フォ
1441+ ントファミリ変更の命令<ja-cmd>の2つを同時に行う命令として
1442+ <unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
1443+ <al-cmd>に同じものを指定する,すなわち,<al-cmd>に和文側も変
1444+ 更させるようにするのが一般的と思われる.
1445+
1446+本コマンドの使用については,\pLaTeX 配布中の\texttt{plfonts.dtx}に詳しく
1447+ 注意点が述べられているので,そちらを参照されたい.
1448+
1449+\item[DeclareRelationFont\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\
1450+ \hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
1451+%<*en>
1452+This command sets the `accompanied' alphabetic font family (given by the latter 4~arguments)
1453+with respect to a Japanese font family given by the former 4~arguments.
1454+%</en>
1455+%<*ja>
1456+いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントファミリに対して,
1457+そのフォントに対応する「従属欧文」フォントファミリを後半の4引数により与える.
1458+%</ja>
1459+\item[SetRelationFont]
1460+This command is almost same as \verb+\DeclareRelationFont+, except that this command does a local
1461+assignment, where \verb+\DeclareRelationFont+ does a global assignment.
1462+\item[userelfont]
1463+Change current alphabetic font encoding/family/\dots\ to the `accompanied' alphabetic
1464+ font family with respect to current Japanese font family,
1465+ which was set by
1466+ \verb+\DeclareRelationFont+ or \verb+SetRelationFont+.
1467+Like \verb+\fontfamily+, \verb+\selectfont+ is required to take an effect.
1468+
1469+\item[adjustbaseline]
1470+...
1471+\end{cslist}
1472+
1473+As closing this subsection, we shall introduce an example of
1474+\verb+SetRelationFont+ and \verb+\userelfont+:
1475+\begin{LTXexample}
1476+\gtfamily{}あいうabc
1477+\SetRelationFont{JY3}{gt}{m}{n}{OT1}{pag}{m}{n}
1478+\userelfont\selectfont{}あいうabc
1479+\end{LTXexample}
1480+
11451481
11461482 \subsection{Cropmark/`tombow'}
11471483
@@ -1207,23 +1543,22 @@ There is also a unit called `歯' which equals to $0.25\,\textrm{mm}$ and
12071543 fonts in scaled point ($2^{-16}\,\textrm{pt}$).
12081544 \attr{ltj@autospc} Whether the auto insertion of \textsf{kanjiskip} is allowed at the node.
12091545 \attr{ltj@autoxspc} Whether the auto insertion of \textsf{xkanjiskip} is allowed at the node.
1210-\attr{ltj@icflag} For distinguishing `kinds' of the node. To this
1211- attribute, one of the following value is
1212- assigned:
1546+\attr{ltj@icflag} An attribute for distinguishing `kinds' of a node. One of the following value is
1547+ assigned to this attribute:
12131548 \begin{description}
1214-\item[ITALIC (1)] Glues from an itaric correction
1549+\item[\textit{italic} (1)] Glues from an itaric correction
12151550 (\verb+\/+). This distinction of origins of glues
12161551 (from explicit \verb+\kern+, or from \verb+\/+)
12171552 is needed in the insertion process of \textsf{xkanjiskip}.
1218-\item[PACKED (2)]
1219-\item[KINSOKU (3)] Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
1220-\item[FROM\_JFM (4)] Glues/kerns from JFM.
1221-\item[LINE\_END (5)] Kerns for ...
1222-\item[KANJI\_SKIP (6)] Glues for \textsf{kanjiskip}.
1223-\item[XKANJI\_SKIP (7)] Glues for \textsf{xkanjiskip}.
1224-\item[PROCESSED (8)] Nodes which is already processed by ...
1225-\item[IC\_PROCESSED (9)] Glues from an itaric correction, but also already processed.
1226-\item[BOXBDD (15)] Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
1553+\item[\textit{packed} (2)]
1554+\item[\textit{kinsoku} (3)] Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
1555+\item[\textit{from\_jfm} (4)] Glues/kerns from JFM.
1556+\item[\textit{line\_end} (5)] Kerns for ...
1557+\item[\textit{kanji\_skip} (6)] Glues for \textsf{kanjiskip}.
1558+\item[\textit{xkanji\_skip} (7)] Glues for \textsf{xkanjiskip}.
1559+\item[\textit{processed} (8)] Nodes which is already processed by ...
1560+\item[\textit{ic\_processed} (9)] Glues from an itaric correction, but also already processed.
1561+\item[\textit{boxbdd} (15)] Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
12271562 \end{description}
12281563 \attr{ltj@kcat$i$} Where $i$~is a natural number which is less than~7.
12291564 These 7~attributes store bit~vectors indicating which character block is regarded as a block of \textbf{JAchar}s.
@@ -1332,8 +1667,7 @@ This problem is resolved by using
13321667
13331668 \section{Linebreak after Japanese Character}\label{sec-lbreak}
13341669 \subsection{Reference: Behavior in \pTeX}
1335-(NOT COMPLETED)
1336-
1670+%<*en>
13371671 In~\pTeX, a linebreak after a Japanese character doesn't emit a space,
13381672 since words are not separated by spaces in Japanese writings. However,
13391673 this feature isn't fully implemented in \LuaTeX-ja due to the
@@ -1355,8 +1689,36 @@ processor. State~$K$ is similar to state~$M$, and is entered after
13551689 Japanese characters. The diagram of state transitions are indicated in
13561690 Figure~\ref{fig-ptexipro}. Note that \pTeX\ doesn't leave state~$K$
13571691 after `beginning/ending of a group' characters.
1358-\begin{figure}[tb]
1359-\label{fig-ptexipro}
1692+%</en>
1693+
1694+%<*ja>
1695+欧文では文章の改行は単語間でしか行わない.そのため,\TeX では,(文字の直後の)改行は
1696+空白文字と同じ扱いとして扱われる.一方,和文ではほとんどどどこでも改行が可能なため,
1697+\pTeX では和文文字の直後の改行は単純に無視されるようになっている.
1698+
1699+このような動作は,\pTeX が\TeX からエンジンとして拡張されたことによって可能になったことである.
1700+\pTeX の入力処理部は,\TeX におけるそれと同じように,有限オートマトンとして記述することができ,
1701+以下に述べるような4状態を持っている.
1702+
1703+\begin{itemize}
1704+\item State~$N$: 行の開始.
1705+\item State~$S$: 空白読み飛ばし.
1706+\item State~$M$: 行中.
1707+\item State~$K$: 行中(和文文字の後).
1708+\end{itemize}
1709+また,状態遷移は,図\label{fig-ptexipro}のようになっており,図中の数字は
1710+カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり,
1711+図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同
1712+じものになる.
1713+
1714+この図から分かることは,
1715+\begin{quote}
1716+行が和文文字(とグループ境界文字)で終わっていれば,改行は無視される
1717+\end{quote}
1718+ということである.
1719+%</ja>
1720+
1721+\begin{figure}[!tb]
13601722 \begin{gather*}
13611723 \def\sp{\text{\tt\char32}}
13621724 \xymatrix{&&
@@ -1379,10 +1741,12 @@ after `beginning/ending of a group' characters.
13791741 \item Category codes 9~(ignored), 14~(comment)~and~15~(invalid) are omitted in above diagram.
13801742 \end{itemize}
13811743 \caption{State transitions of \pTeX's input processor.}
1744+\label{fig-ptexipro}
13821745 \end{figure}
13831746
13841747
13851748 \subsection{Behavior in \LuaTeX-ja}
1749+%<*en>
13861750 States in the input processoe of \LuaTeX\ is the same as that of \TeX,
13871751 and they can't be customized by any callbacks. Hence, we can only use
13881752 \verb+process_input_buffer+ and \verb+token_filter+ callbacks for to
@@ -1394,11 +1758,11 @@ token \emph{in the input processor}. So we can use only the
13941758 \verb+process_input_buffer+ callback. This means that suppressing a
13951759 space must be done \emph{just before} an input line is read.
13961760
1397-Considering these situations, handling of a end-of-line in \LuaTeX-ja are as follows:
1761+Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
13981762 \begin{quote}
13991763 A character U+FFFFF (its category code is set to 14~(comment) by
1400-\LuaTeX-ja) is appended to an input line, before \LuaTeX\ actually
1401-process it, if and only if the following two conditions are satisfied:
1764+\LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
1765+process it}, if and only if the following two conditions are satisfied:
14021766 \begin{enumerate}
14031767 \item The category code of the character $\langle${return}$\rangle$
14041768 (whose character code is 13) is 5~(end-of-line).
@@ -1408,11 +1772,158 @@ process it, if and only if the following two conditions are satisfied:
14081772 \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
14091773 \]
14101774 \end{enumerate}
1775+\end{quote}
1776+
1777+\paragraph{Remark}
1778+The following example shows the major difference from the behavior of \pTeX:
1779+\begin{LTXexample}
1780+\ltjsetparameter{autoxspacing=false}
1781+\ltjsetparameter{jacharrange={-6}}xあ
1782+y\ltjsetparameter{jacharrange={+6}}zあ
1783+u
1784+\end{LTXexample}
1785+\begin{itemize}
1786+\item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `あ'
1787+(this `あ' considered as an \textbf{JAchar} at the ending of line~1).
1788+\item There is no space between `あ' (in the line~3) and `u', since the
1789+ line~3 ends with an \textbf{ALchar}
1790+(the letter `あ' considered as an \textbf{ALchar} at the ending of line~2).
1791+\end{itemize}
1792+%</en>
1793+
1794+%<*ja>
1795+\LuaTeX の入力処理部は\TeX のそれと全く同じであり,callbackによりユーザが
1796+カスタマイズすることはできない.このため,改行抑制の目的でユーザが利用で
1797+きそうなcallbackとしては,\verb+process_input_buffer+や
1798+\verb+token_filter+に限られてしまう.しかし,\TeX の入力処理部をよく見る
1799+と,後者も役には経たないことが分かる:改行文字は,入力処理部によってトー
1800+クン化される時に,カテゴリーコード10の32番文字へと置き換えられてしまうた
1801+め,\verb+token_filter+で非標準なトークン読み出しを行おうとしても,空白文
1802+字由来のトークンと,改行文字由来のトークンは区別できないのだ.
1803+
1804+すると,我々のとれる道は,\verb+process_input_buffer+を用いて
1805+\LuaTeX の入力処理部に引き渡される前に入力文字列を編集するというものしかない.
1806+以上を踏まえ,\LuaTeX-jaにおける「和文文字直後の改行抑制」の処理は,次のようになっている:
14111807
1808+\begin{quote}
1809+各入力行に対し,\textbf{その入力行が読まれる前の内部状態で}
1810+以下の2条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
1811+\footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.}
1812+を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
1813+\begin{enumerate}
1814+\item 改行文字(文字コード13番)のカテゴリーコードが5~(end-of-line)である.
1815+\item 入力行は次の「正規表現」にマッチしている:
1816+\[
1817+ (\text{any char})^*(\textbf{JAchar})
1818+ \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
1819+\]
1820+\end{enumerate}
14121821 \end{quote}
14131822
1823+この仕様は,前節で述べた\pTeX の仕様にできるだけ近づけたものとなっている.最初の条件は,
1824+\texttt{verbatim}系環境などの日本語対応マクロを書かなくてすませるためのものである.
1825+しかしながら,完全に同じ挙動が実現できたわけではない.
1826+差異は,次の例が示すように,和文文字の範囲を変更した行の改行において見られる:
1827+\begin{LTXexample}
1828+\ltjsetparameter{autoxspacing=false}
1829+\ltjsetparameter{jacharrange={-6}}xあ
1830+y\ltjsetparameter{jacharrange={+6}}zあ
1831+u
1832+\end{LTXexample}
1833+もし\pTeX とまったく同じ挙動を示すならば,出力は
1834+「\hbox{\ltjsetparameter{autoxspacing=false}x yzあu}」となるべきである.しかし,実際には
1835+上のように異なる挙動となっている.
1836+\begin{itemize}
1837+\item 2行目は「あ」という和文文字で終わる(2行目を処理する前の時点では,
1838+ 「あ」は和文文字扱いである)ため,直後の改行文字は無視される.
1839+\item 3行目は「あ」という欧文文字で終わる(2行目を処理する前の時点では,
1840+ 「あ」は欧文文字扱いである)ため,直後の改行文字は空白に置き換わる.
1841+\end{itemize}
1842+このため,トラブルを避けるために,和文文字の範囲を\verb+\ltjsetparameter+で編集した場合,
1843+その行はそこで改行するようにした方がいいだろう.
1844+%</ja>
1845+
1846+
14141847 \section{Insertion of JFM glues, \textsf{kanjiskip} and \textsf{xkanjiskip}}
1415-This is the longest section of the document.
1848+\subsection{Overview}
1849+%<*en>
1850+NOT COMPLETED
1851+%</en>
1852+
1853+%<*ja>
1854+\LuaTeX-ja における和文処理グルーの挿入方法は,\pTeX のそれとは全く異なる.
1855+\pTeX では次のような仕様であった:
1856+\begin{itemize}
1857+\item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
1858+追加する過程で行われる.
1859+\item \textsf{xkanjiskip}の挿入は,hboxへのパッケージングや行分割前に行われる.
1860+\item \textsf{kanjiskip}はノードとしては挿入されない.パッケージングや行分割の計算時に
1861+「和文文字を表す2つの<char\_node>の間には\textsf{kanjiskip}がある」ものとみなされる.
1862+\end{itemize}
1863+しかし,\LuaTeX-jaでは,hboxへのパッケージングや行分割前に全ての
1864+\textbf{JAglue},即ちJFMグルー・\textsf{xkanjiskip}・\textsf{kanjiskip}の
1865+3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
1866+カーニング処理がノードベースになったことに対応する変更である.
1867+
1868+\LuaTeX-jaにおける\textbf{JAglue}挿入処理では,下の図\ref{fig-clu}のよう
1869+に「塊」を単位にして行われる.大雑把にいうと,「塊」は文字とそれに付随す
1870+るノード達(アクセント位置補正用のkernや,イタリック補正)をまとめたもの
1871+であり,2つの塊の間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
1872+には関係しないものがある.そのため,……
1873+%</ja>
1874+
1875+% \begin{figure}[!tb]
1876+% \unitlength=10mm
1877+% \end{figure}
1878+
1879+\subsection{Definition of a `cluster'}
1880+
1881+\begin{defn}
1882+A \emph{cluster} is a list of nodes in one of the following forms, with the \textit{id} of it:
1883+\begin{enumerate}
1884+\item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$. These
1885+ nodes come from a hbox which is already packaged, by unpackaging
1886+ (\verb+\unhbox+).
1887+ The \textit{id} is \textit{id\_pbox}.
1888+\item A inline math formula, including two \textit{math\_node}s at the boundary of it:
1889+HOGE
1890+ The \textit{id} is \textit{id\_math}.
1891+\item A \textit{glyph\_node} with nodes which relate with it:
1892+HOGE
1893+The \textit{id} is \textit{id\_jglyph} or
1894+\textit{id\_glyph}, according to whether the \textit{glyph\_node}
1895+represents a Japanese character or not.
1896+\item An box-like node, that is, an hbox, an vbox and an rule (\verb+\vrule+).
1897+The \textit{id} is \textit{id\_hlist} if the node is an
1898+ hbox which is not shifted vertically, or \textit{id\_box\_like}
1899+ otherwise.
1900+\item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
1901+The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
1902+ and \textit{id\_disc}, respectively.
1903+%Just a node which will \dots, \textit{i.e.}, a node which is \emph{not} one of the following:
1904+%\textit{ins\_node}, \textit{mark\_node}, \textit{adjust\_node}, \textit{whatsit\_node}
1905+%and \textit{penalty\_node}.
1906+\end{enumerate}
1907+We denote a cluster by \textit{Np}, \textit{Nq} and \textit{Nr}.
1908+\end{defn}
1909+
1910+Internally, a cluster is represented by a table $\textit{Np}$ with the following fields.
14161911
1417-jfmglue.tex の内容をここに入れる
1912+\begin{description}
1913+\def\makelabel#1{\textbf{\textit{#1}}}
1914+\item[first, last] The first/last node of the cluster.
1915+\item[id] The \textit{id} in above definition.
1916+\item[nuc]
1917+
1918+% jachar
1919+\item[auto\_kspc, auto\_xspc]
1920+\item[xspc\_before, xspc\_after]
1921+
1922+% alchar, jachar
1923+\item[pre, post]
1924+\item[char]
1925+\item[class]
1926+\item[lend]
1927+\item[met, var]
1928+\end{description}
14181929 \end{document}
--- a/doc/manual.ins
+++ b/doc/manual.ins
@@ -3,6 +3,6 @@
33 \askforoverwritefalse
44 \generate{\file{man-ja.tex}{\from{manual.dtx}{ja}}
55 \file{man-en.tex}{\from{manual.dtx}{en}}}
6-%\immediate\write18{lualatex man-ja}
6+\immediate\write18{lualatex man-ja}
77 \immediate\write18{lualatex man-en}
88 \endbatchfile
--- a/src/jfm-jis.lua
+++ b/src/jfm-jis.lua
@@ -86,7 +86,7 @@ luatexja.jfont.define_jfm {
8686 },
8787
8888 [99] = { -- box末尾
89- chars = {'boxbdd'},
89+ chars = {'boxbdd', 'parbdd'},
9090 },
9191
9292 }
\ No newline at end of file
--- a/src/jfm-min.lua
+++ b/src/jfm-min.lua
@@ -255,7 +255,6 @@ luatexja.jfont.define_jfm {
255255 },
256256
257257 [99] = { -- box末尾
258- chars = {'boxbdd'},
258+ chars = {'boxbdd', 'parbdd'},
259259 },
260-
261-}
\ No newline at end of file
260+}
--- a/src/jfm-ujis.lua
+++ b/src/jfm-ujis.lua
@@ -1,6 +1,6 @@
11 -- -*- coding: utf-8 -*-
22 -- jfm-ujis.lua: LuaTeX-ja 標準 JFM
3--- besed on upnmlminr-h.tfm (a metric in UTF/OTF package used by upTeX).
3+-- based on upnmlminr-h.tfm (a metric in UTF/OTF package used by upTeX).
44
55 luatexja.jfont.define_jfm {
66 dir = 'yoko',
@@ -133,7 +133,7 @@ luatexja.jfont.define_jfm {
133133 },
134134
135135 [99] = { -- box末尾
136- chars = {'boxbdd'},
136+ chars = {'boxbdd', 'parbdd'},
137137 },
138138
139139 }
\ No newline at end of file
--- a/src/ltjclasses/ltjarticle.cls
+++ b/src/ltjclasses/ltjarticle.cls
@@ -52,7 +52,6 @@
5252 \@tempcnta\hour \multiply\@tempcnta 60\relax
5353 \minute\time \advance\minute-\@tempcnta
5454 \newif\if@stysize \@stysizefalse
55-\newif\if@enablejfam \@enablejfamtrue
5655 \newif\if@mathrmmc \@mathrmmcfalse
5756 \DeclareOption{a4paper}{\setcounter{@paper}{1}%
5857 \setlength\paperheight {297mm}%
@@ -140,7 +139,8 @@
140139 \if@compatibility
141140 \@mathrmmctrue
142141 \else
143- \DeclareOption{disablejfam}{\@enablejfamfalse}
142+ \DeclareOption{disablejfam}{%
143+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
144144 \DeclareOption{mathrmmc}{\@mathrmmctrue}
145145 \fi
146146 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
@@ -148,6 +148,15 @@
148148 \ExecuteOptions{a4paper,10pt,oneside,onecolumn,final}
149149 \ProcessOptions\relax
150150 \input{ltjsize1\@ptsize.clo}
151+\directlua{luatexbase.add_to_callback('luatexja.load_jfm',
152+ function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
153+ 'ltj.jclasses_load_jfm', 1)}
154+{\jfont\g=psft:Ryumin-Light:jfm=min } % loading jfm-min.lua
155+\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
156+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.962216] psft:Ryumin-Light:jfm=min}{}
157+\DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.962216] psft:GothicBBB-Medium:jfm=min;jfmvar=goth}{}
158+\ltjglobalsetparameter{differentjfm=both}
159+\directlua{luatexbase.remove_from_callback('luatexja.load_jfm', 'ltj.jclasses_load_jfm')}
151160 \if@stysize
152161 \setlength\columnsep{2\Cwd}
153162 \else
--- a/src/ltjclasses/ltjbook.cls
+++ b/src/ltjclasses/ltjbook.cls
@@ -54,7 +54,6 @@
5454 \@tempcnta\hour \multiply\@tempcnta 60\relax
5555 \minute\time \advance\minute-\@tempcnta
5656 \newif\if@stysize \@stysizefalse
57-\newif\if@enablejfam \@enablejfamtrue
5857 \newif\if@mathrmmc \@mathrmmcfalse
5958 \DeclareOption{a4paper}{\setcounter{@paper}{1}%
6059 \setlength\paperheight {297mm}%
@@ -148,7 +147,8 @@
148147 \if@compatibility
149148 \@mathrmmctrue
150149 \else
151- \DeclareOption{disablejfam}{\@enablejfamfalse}
150+ \DeclareOption{disablejfam}{%
151+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
152152 \DeclareOption{mathrmmc}{\@mathrmmctrue}
153153 \fi
154154 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
@@ -156,6 +156,15 @@
156156 \ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright}
157157 \ProcessOptions\relax
158158 \input{ltjbk1\@ptsize.clo}
159+\directlua{luatexbase.add_to_callback('luatexja.load_jfm',
160+ function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
161+ 'ltj.jclasses_load_jfm', 1)}
162+{\jfont\g=psft:Ryumin-Light:jfm=min } % loading jfm-min.lua
163+\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
164+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.962216] psft:Ryumin-Light:jfm=min}{}
165+\DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.962216] psft:GothicBBB-Medium:jfm=min;jfmvar=goth}{}
166+\ltjglobalsetparameter{differentjfm=both}
167+\directlua{luatexbase.remove_from_callback('luatexja.load_jfm', 'ltj.jclasses_load_jfm')}
159168 \if@stysize
160169 \setlength\columnsep{2\Cwd}
161170 \else
--- a/src/ltjclasses/ltjclasses.dtx
+++ b/src/ltjclasses/ltjclasses.dtx
@@ -8,9 +8,9 @@
88 % This file is part of the pLaTeX2e system.
99 % -----------------------------------------
1010 %
11-% \fi
11+% \fi
1212 %
13-% \CheckSum{4465}
13+% \CheckSum{4475}
1414 %% \CharacterTable
1515 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
1616 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -153,8 +153,11 @@
153153 % 全ての変更点を知りたい場合は、|jclasses.dtx| と |ltjclasses.dtx| で |diff| を
154154 % とって下さい。
155155 % \begin{itemize}
156-% \item |disablejfam| オプションが効かなくしてあります。互換性のためにオプション
157-% 自体は残してあります.
156+% \item |disablejfam| オプションを無効化。もし
157+% \begin{quotation}
158+% |! LaTeX Error: Too many math alphabets used in version ****.|
159+% \end{quotation}
160+% のエラーが起こった場合は、|lualatex-math| パッケージを読み込んでみて下さい。
158161 % \item 出力 PDF の用紙サイズが自動的に設定されるようにしてあります。
159162 % \item \cs{if西暦}、\cs{西暦}、\cs{和暦}をそれぞれ\cs{ifSeireki}, \cs{Seireki},
160163 % \cs{Wareki} に変更してあります。これはデフォルトの漢字のカテゴリコードが12で
@@ -250,13 +253,7 @@
250253 % \end{macrocode}
251254 % \end{macro}
252255 %
253-% \begin{macro}{\if@enablejfam}
254-% \changes{v1.1b}{1997/01/28}{Add \cs{if@enablejfam}}
255-% 日本語ファミリを宣言するために用いるフラグです。
256-% 互換性のために残してあるもので、実際には用いられません。
257-% \begin{macrocode}
258-\newif\if@enablejfam \@enablejfamtrue
259-% \end{macrocode}
256+% \begin{macro}{\if@mathrmmc}
260257 % 和欧文両対応の数式文字コマンドを有効にするときに用いるフラグです。
261258 % マクロの展開順序が複雑になるのを避けるため、
262259 % デフォルトではfalseとしてあります。
@@ -454,7 +451,9 @@
454451 % p\TeX では数式ファミリの数が16個だったので日本語ファミリ宣言を抑制する
455452 % |disablejfam| オプションが用意されていましたが、Lua\TeX では Omega 拡張が
456453 % 取り込まれて数式ファミリは256個まで使用できるため、このオプションは必要ありません。
457-% しかし、互換性のために残しておきます。
454+% ただし、\LaTeXe カーネルでは未だに数式ファミリの数は16個に制限されているので、
455+% 実際に使用可能な数式ファミリの数を増やすためには |lualatex-math| パッケージを
456+% 読み込む必要があることに注意が必要です。
458457 %
459458 % |mathrmmc|オプションは、
460459 % |\mathrm|と|\mathbf|を和欧文両対応にするためのクラスオプションです。
@@ -463,7 +462,8 @@
463462 \if@compatibility
464463 \@mathrmmctrue
465464 \else
466- \DeclareOption{disablejfam}{\@enablejfamfalse}
465+ \DeclareOption{disablejfam}{%
466+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
467467 \DeclareOption{mathrmmc}{\@mathrmmctrue}
468468 \fi
469469 % \end{macrocode}
@@ -510,6 +510,32 @@
510510 %
511511 % \section{フォント}
512512 %
513+% Lua\LaTeX-jaの標準では、OTFパッケージ由来のメトリックが使われるようになっています。
514+% 本クラスでは、「p\TeX の組版と互換性をできだけ持たせる」例を提示するため、
515+% \begin{itemize}
516+% \item メトリックを\texttt{min10.tfm}ベースの\texttt{jfm-min.lua}に変更。
517+% \item 明朝とゴシックは両方とも\texttt{jfm-min.lua}を用いるが、
518+% 和文処理用グルー挿入時には「違うメトリックを使用」として思わせる。
519+% \item p\TeX と同様に、「異なるメトリックの2つの和文文字」の間には、両者から定める
520+% グルーを両方挿入する。
521+% \item calllback を利用し、標準で用いる\texttt{jfm-min.lua}を、段落始めの括弧が全角二分下がりになるように内部で変更している。
522+%
523+% \end{itemize}
524+%
525+% \begin{macrocode}
526+%<*article|report|book>
527+\directlua{luatexbase.add_to_callback('luatexja.load_jfm',
528+ function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
529+ 'ltj.jclasses_load_jfm', 1)}
530+{\jfont\g=psft:Ryumin-Light:jfm=min } % loading jfm-min.lua
531+\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
532+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.962216] psft:Ryumin-Light:jfm=min}{}
533+\DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.962216] psft:GothicBBB-Medium:jfm=min;jfmvar=goth}{}
534+\ltjglobalsetparameter{differentjfm=both}
535+\directlua{luatexbase.remove_from_callback('luatexja.load_jfm', 'ltj.jclasses_load_jfm')}
536+%</article|report|book>
537+% \end{macrocode}
538+%
513539 % ここでは、\LaTeX{}のフォントサイズコマンドの定義をしています。
514540 % フォントサイズコマンドの定義は、次のコマンドを用います。
515541 %
Binary files a/src/ltjclasses/ltjclasses.pdf and b/src/ltjclasses/ltjclasses.pdf differ
--- a/src/ltjclasses/ltjreport.cls
+++ b/src/ltjclasses/ltjreport.cls
@@ -53,7 +53,6 @@
5353 \@tempcnta\hour \multiply\@tempcnta 60\relax
5454 \minute\time \advance\minute-\@tempcnta
5555 \newif\if@stysize \@stysizefalse
56-\newif\if@enablejfam \@enablejfamtrue
5756 \newif\if@mathrmmc \@mathrmmcfalse
5857 \DeclareOption{a4paper}{\setcounter{@paper}{1}%
5958 \setlength\paperheight {297mm}%
@@ -146,7 +145,8 @@
146145 \if@compatibility
147146 \@mathrmmctrue
148147 \else
149- \DeclareOption{disablejfam}{\@enablejfamfalse}
148+ \DeclareOption{disablejfam}{%
149+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
150150 \DeclareOption{mathrmmc}{\@mathrmmctrue}
151151 \fi
152152 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
@@ -154,6 +154,15 @@
154154 \ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,openany}
155155 \ProcessOptions\relax
156156 \input{ltjsize1\@ptsize.clo}
157+\directlua{luatexbase.add_to_callback('luatexja.load_jfm',
158+ function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
159+ 'ltj.jclasses_load_jfm', 1)}
160+{\jfont\g=psft:Ryumin-Light:jfm=min } % loading jfm-min.lua
161+\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
162+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s * [0.962216] psft:Ryumin-Light:jfm=min}{}
163+\DeclareFontShape{JY3}{gt}{m}{n}{<-> s * [0.962216] psft:GothicBBB-Medium:jfm=min;jfmvar=goth}{}
164+\ltjglobalsetparameter{differentjfm=both}
165+\directlua{luatexbase.remove_from_callback('luatexja.load_jfm', 'ltj.jclasses_load_jfm')}
157166 \if@stysize
158167 \setlength\columnsep{2\Cwd}
159168 \else
--- a/src/ltjsclasses/ltjsarticle.cls
+++ b/src/ltjsclasses/ltjsarticle.cls
@@ -179,7 +179,8 @@
179179 &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
180180 \tabskip\z@skip\cr
181181 }}
182-\DeclareOption{disablejfam}{\@enablejfamfalse}
182+\DeclareOption{disablejfam}{%
183+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
183184 \newif\ifdraft
184185 \DeclareOption{draft}{\drafttrue \setlength\overfullrule{5pt}}
185186 \DeclareOption{final}{\draftfalse \setlength\overfullrule{0pt}}
@@ -189,7 +190,10 @@
189190 \jisfontfalse
190191 \newif\ifptexjis
191192 \ptexjisfalse
192-\DeclareOption{winjis}{}\DeclareOption{uplatex}{} % These 2 options are ignored.
193+\DeclareOption{winjis}{%
194+ \ClassWarningNoLine{\@currname}{The class option 'winjis' is obsolete}}
195+\DeclareOption{uplatex}{%
196+ \ClassWarningNoLine{\@currname}{The class option 'uplatex' is obsolete}}
193197 \DeclareOption{mingoth}{\mingothtrue}
194198 \DeclareOption{ptexjis}{\ptexjistrue}
195199 \DeclareOption{jis}{\jisfonttrue}
@@ -836,8 +840,8 @@
836840 \hskip -\@tempskipa
837841 \else
838842 \clubpenalty \@clubpenalty
839- \everypar{\everyparhook}%
840- \fi\everyparhook}%
843+ \everypar{}%
844+ \fi}%
841845 \else
842846 \par \nobreak
843847 \vskip \@tempskipa
@@ -1349,113 +1353,6 @@
13491353 \parindent 1\zw
13501354 \noindent
13511355 \llap{\@makefnmark\hskip0.3\zw}#1}
1352-\def\@inhibitglue{%
1353- \futurelet\@let@token\@@inhibitglue}
1354-\def\@@inhibitglue{%
1355- \ifx\@let@token「
1356- \inhibitglue
1357- \else
1358- \ifx\@let@token(
1359- \inhibitglue
1360- \else
1361- \ifx\@let@token『
1362- \inhibitglue
1363- \else
1364- \ifx\@let@token[
1365- \inhibitglue
1366- \fi
1367- \fi
1368- \fi
1369- \fi}
1370-\let\everyparhook=\@inhibitglue
1371-\AtBeginDocument{\everypar{\everyparhook}}
1372-\def\@doendpe{%
1373- \@endpetrue
1374- \def\par{%
1375- \@restorepar\everypar{\everyparhook}\par\@endpefalse}%
1376- \everypar{{\setbox\z@\lastbox}\everypar{\everyparhook}\@endpefalse\everyparhook}}
1377-\def\@item[#1]{%
1378- \if@noparitem
1379- \@donoparitem
1380- \else
1381- \if@inlabel
1382- \indent \par
1383- \fi
1384- \ifhmode
1385- \unskip\unskip \par
1386- \fi
1387- \if@newlist
1388- \if@nobreak
1389- \@nbitem
1390- \else
1391- \addpenalty\@beginparpenalty
1392- \addvspace\@topsep
1393- \addvspace{-\parskip}%
1394- \fi
1395- \else
1396- \addpenalty\@itempenalty
1397- \addvspace\itemsep
1398- \fi
1399- \global\@inlabeltrue
1400- \fi
1401- \everypar{%
1402- \@minipagefalse
1403- \global\@newlistfalse
1404- \if@inlabel
1405- \global\@inlabelfalse
1406- {\setbox\z@\lastbox
1407- \ifvoid\z@
1408- \kern-\itemindent
1409- \fi}%
1410- \box\@labels
1411- \penalty\z@
1412- \fi
1413- \if@nobreak
1414- \@nobreakfalse
1415- \clubpenalty \@M
1416- \else
1417- \clubpenalty \@clubpenalty
1418- \everypar{\everyparhook}%
1419- \fi\everyparhook}%
1420- \if@noitemarg
1421- \@noitemargfalse
1422- \if@nmbrlist
1423- \refstepcounter\@listctr
1424- \fi
1425- \fi
1426- \sbox\@tempboxa{\makelabel{#1}}%
1427- \global\setbox\@labels\hbox{%
1428- \unhbox\@labels
1429- \hskip \itemindent
1430- \hskip -\labelwidth
1431- \hskip -\labelsep
1432- \ifdim \wd\@tempboxa >\labelwidth
1433- \box\@tempboxa
1434- \else
1435- \hbox to\labelwidth {\unhbox\@tempboxa}%
1436- \fi
1437- \hskip \labelsep}%
1438- \ignorespaces}
1439-\def\@afterheading{%
1440- \@nobreaktrue
1441- \everypar{%
1442- \if@nobreak
1443- \@nobreakfalse
1444- \clubpenalty \@M
1445- \if@afterindent \else
1446- {\setbox\z@\lastbox}%
1447- \fi
1448- \else
1449- \clubpenalty \@clubpenalty
1450- \everypar{\everyparhook}%
1451- \fi\everyparhook}}
1452-\def\@gnewline #1{%
1453- \ifvmode
1454- \@nolnerr
1455- \else
1456- \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
1457- \inhibitglue \ignorespaces
1458- \fi}
14591356 \def\Shou#1{\hbox{$\m@th$%
14601357 \csname S@\f@size\endcsname
14611358 \fontsize\sf@size\z@
--- a/src/ltjsclasses/ltjsbook.cls
+++ b/src/ltjsclasses/ltjsbook.cls
@@ -183,7 +183,8 @@
183183 &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
184184 \tabskip\z@skip\cr
185185 }}
186-\DeclareOption{disablejfam}{\@enablejfamfalse}
186+\DeclareOption{disablejfam}{%
187+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
187188 \newif\ifdraft
188189 \DeclareOption{draft}{\drafttrue \setlength\overfullrule{5pt}}
189190 \DeclareOption{final}{\draftfalse \setlength\overfullrule{0pt}}
@@ -193,7 +194,10 @@
193194 \jisfontfalse
194195 \newif\ifptexjis
195196 \ptexjisfalse
196-\DeclareOption{winjis}{}\DeclareOption{uplatex}{} % These 2 options are ignored.
197+\DeclareOption{winjis}{%
198+ \ClassWarningNoLine{\@currname}{The class option 'winjis' is obsolete}}
199+\DeclareOption{uplatex}{%
200+ \ClassWarningNoLine{\@currname}{The class option 'uplatex' is obsolete}}
197201 \DeclareOption{mingoth}{\mingothtrue}
198202 \DeclareOption{ptexjis}{\ptexjistrue}
199203 \DeclareOption{jis}{\jisfonttrue}
@@ -842,8 +846,8 @@
842846 \hskip -\@tempskipa
843847 \else
844848 \clubpenalty \@clubpenalty
845- \everypar{\everyparhook}%
846- \fi\everyparhook}%
849+ \everypar{}%
850+ \fi}%
847851 \else
848852 \par \nobreak
849853 \vskip \@tempskipa
@@ -1424,113 +1428,6 @@
14241428 \parindent 1\zw
14251429 \noindent
14261430 \llap{\@makefnmark\hskip0.3\zw}#1}
1427-\def\@inhibitglue{%
1428- \futurelet\@let@token\@@inhibitglue}
1429-\def\@@inhibitglue{%
1430- \ifx\@let@token「
1431- \inhibitglue
1432- \else
1433- \ifx\@let@token(
1434- \inhibitglue
1435- \else
1436- \ifx\@let@token『
1437- \inhibitglue
1438- \else
1439- \ifx\@let@token[
1440- \inhibitglue
1441- \fi
1442- \fi
1443- \fi
1444- \fi}
1445-\let\everyparhook=\@inhibitglue
1446-\AtBeginDocument{\everypar{\everyparhook}}
1447-\def\@doendpe{%
1448- \@endpetrue
1449- \def\par{%
1450- \@restorepar\everypar{\everyparhook}\par\@endpefalse}%
1451- \everypar{{\setbox\z@\lastbox}\everypar{\everyparhook}\@endpefalse\everyparhook}}
1452-\def\@item[#1]{%
1453- \if@noparitem
1454- \@donoparitem
1455- \else
1456- \if@inlabel
1457- \indent \par
1458- \fi
1459- \ifhmode
1460- \unskip\unskip \par
1461- \fi
1462- \if@newlist
1463- \if@nobreak
1464- \@nbitem
1465- \else
1466- \addpenalty\@beginparpenalty
1467- \addvspace\@topsep
1468- \addvspace{-\parskip}%
1469- \fi
1470- \else
1471- \addpenalty\@itempenalty
1472- \addvspace\itemsep
1473- \fi
1474- \global\@inlabeltrue
1475- \fi
1476- \everypar{%
1477- \@minipagefalse
1478- \global\@newlistfalse
1479- \if@inlabel
1480- \global\@inlabelfalse
1481- {\setbox\z@\lastbox
1482- \ifvoid\z@
1483- \kern-\itemindent
1484- \fi}%
1485- \box\@labels
1486- \penalty\z@
1487- \fi
1488- \if@nobreak
1489- \@nobreakfalse
1490- \clubpenalty \@M
1491- \else
1492- \clubpenalty \@clubpenalty
1493- \everypar{\everyparhook}%
1494- \fi\everyparhook}%
1495- \if@noitemarg
1496- \@noitemargfalse
1497- \if@nmbrlist
1498- \refstepcounter\@listctr
1499- \fi
1500- \fi
1501- \sbox\@tempboxa{\makelabel{#1}}%
1502- \global\setbox\@labels\hbox{%
1503- \unhbox\@labels
1504- \hskip \itemindent
1505- \hskip -\labelwidth
1506- \hskip -\labelsep
1507- \ifdim \wd\@tempboxa >\labelwidth
1508- \box\@tempboxa
1509- \else
1510- \hbox to\labelwidth {\unhbox\@tempboxa}%
1511- \fi
1512- \hskip \labelsep}%
1513- \ignorespaces}
1514-\def\@afterheading{%
1515- \@nobreaktrue
1516- \everypar{%
1517- \if@nobreak
1518- \@nobreakfalse
1519- \clubpenalty \@M
1520- \if@afterindent \else
1521- {\setbox\z@\lastbox}%
1522- \fi
1523- \else
1524- \clubpenalty \@clubpenalty
1525- \everypar{\everyparhook}%
1526- \fi\everyparhook}}
1527-\def\@gnewline #1{%
1528- \ifvmode
1529- \@nolnerr
1530- \else
1531- \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
1532- \inhibitglue \ignorespaces
1533- \fi}
15341431 \def\Shou#1{\hbox{$\m@th$%
15351432 \csname S@\f@size\endcsname
15361433 \fontsize\sf@size\z@
--- a/src/ltjsclasses/ltjsclasses.dtx
+++ b/src/ltjsclasses/ltjsclasses.dtx
@@ -22,7 +22,7 @@
2222 % -----------------------------------------
2323 %
2424 % \fi
25-% \CheckSum{5224}
25+% \CheckSum{5037}
2626 %% \CharacterTable
2727 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
2828 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -94,7 +94,7 @@
9494 % \end{tabular}
9595 % \end{quote}
9696 %
97-% |ltjclasses| と大きく違うのは以下の点です。
97+% |ltjclasses| と違うのは以下の点です。
9898 %
9999 % \paragraph{サイズオプションの扱いが違う}
100100 %
@@ -107,20 +107,23 @@
107107 % 43ポイント,12Q,14Qの指定を可能にしています。
108108 %
109109 % \subsection{\texttt{jsclasses.dtx} からの主な変更点}
110-% 全ての変更点を知りたい場合は、|jsclasses.dtx| と |ltjsclasses.dtx| で |diff| を
110+% 全ての変更点を知りたい場合は,|jsclasses.dtx| と |ltjsclasses.dtx| で |diff| を
111111 % とって下さい。
112-% なお,オプションで無効にしたものがいくつかありますが,互換性のために
113-% オプション自体は残してあります(つまり,削除されたオプションが指定されていても
114-% コンパイルは通る)。
115112 % \begin{itemize}
116-% \item フォントメトリック関係のオプション |winjis| は単に無視されます.
117-% \item 標準では|jfm-ujis.lua|(Lua\TeX-ja標準のメトリック,OTFパッケージのものがベース)を使用します.
118-% \item up\TeX 関係のオプションを削除してあります。
119-% \item |disablejfam| オプションが無効になっています。
120-% ←本当にそれでいい? \LaTeX カーネルレベルではまだ16個のままのような気がします.
113+% \item フォントメトリック関係のオプション |winjis| は単に無視されます。
114+% \item 標準では |jfm-ujis.lua|(Lua\TeX-ja標準のメトリック,OTFパッケージのものがベース)を使用します。
115+% \item |uplatex| オプションを削除してあります。
116+% \item |disablejfam| オプションが無効になっています。もし
117+% \begin{quotation}
118+% |! LaTeX Error: Too many math alphabets used in version ****.|
119+% \end{quotation}
120+% のエラーが起こった場合は,|lualatex-math| パッケージを読み込んでみて下さい。
121121 % \item |papersize| オプションの指定に関わらず PDF のページサイズは適切に
122122 % 設定されます。
123-% \item 「\texttt{amsmath} との衝突の回避」のコードは,上流で既に対処されている上に
123+% \item Lua\TeX-ja 同梱のメトリックを用いる限りは,段落の頭にグルーは挿入されません。
124+% そのため,オリジナルの |jsclasses.dtx| 内にあったhack(|\everyparhook|)は不要になったので,
125+% 削除しました。
126+% \item 「\texttt{amsmath} との衝突の回避」のコードは,上流で既に対処されているうえ,
124127 % これがあると |grfext.sty| を読み込んだ際にエラーを引き起こすので削除しました。
125128 % \item |\小|,|\上小|,|\if西暦|,|\西暦|,|\和暦|をそれぞれ
126129 % |\Shou|, |\UeShou|, |\ifSeireki|, |\Seireki|, |\Wareki| に変更してあります。
@@ -479,11 +482,13 @@
479482 %
480483 % p\TeX では数式中では16通りのフォントしか使えませんでしたが,Lua\TeX では
481484 % Omega 拡張が取り込まれていて256通りのフォントが使えます。
482-% そのためこのオプションは無効にしてありますが,互換性のためにオプション自体は
483-% 残しておきます。
485+% ただし,\LaTeXe カーネルでは未だに数式ファミリの数は16個に制限されているので,
486+% 実際に使用可能な数式ファミリの数を増やすためには |lualatex-math| パッケージを
487+% 読み込む必要があることに注意が必要です。
484488 %
485489 % \begin{macrocode}
486-\DeclareOption{disablejfam}{\@enablejfamfalse}
490+\DeclareOption{disablejfam}{%
491+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
487492 % \end{macrocode}
488493 %
489494 % \paragraph{ドラフト}
@@ -503,7 +508,7 @@
503508 % というオプションを指定します。
504509 % p\TeX でよく利用される \texttt{jis} フォントメトリックと互換のメトリックを使いたい場合は,
505510 % \texttt{ptexjis} というオプションを指定します。
506-% \texttt{winjis} メトリックは用済みのため,\texttt{winjis} オプションは無視されます.
511+% \texttt{winjis} メトリックは用済みのため,\texttt{winjis} オプションは無視されます。
507512 %
508513 % \begin{macrocode}
509514 \newif\ifmingoth
@@ -512,7 +517,10 @@
512517 \jisfontfalse
513518 \newif\ifptexjis
514519 \ptexjisfalse
515-\DeclareOption{winjis}{}\DeclareOption{uplatex}{} % These 2 options are ignored.
520+\DeclareOption{winjis}{%
521+ \ClassWarningNoLine{\@currname}{The class option 'winjis' is obsolete}}
522+\DeclareOption{uplatex}{%
523+ \ClassWarningNoLine{\@currname}{The class option 'uplatex' is obsolete}}
516524 \DeclareOption{mingoth}{\mingothtrue}
517525 \DeclareOption{ptexjis}{\ptexjistrue}
518526 \DeclareOption{jis}{\jisfonttrue}
@@ -705,9 +713,9 @@
705713 % \pTeX (アスキーが日本語化した\TeX )では,例えば従来のフォントメトリック
706714 % \texttt{min10} やJISフォントメトリックでは「公称10ポイントの和文フォントは,
707715 % 実際には9.62216ptで出力される(メトリック側で0.962216倍される)」という
708-% 仕様になっています.
709-% 一方,Lua\TeX-jaの提供するメトリックでは,そのようなことはありません.
710-% 公称10ポイントの和文フォントは,10ポイントで出力されます.
716+% 仕様になっています。
717+% 一方,Lua\TeX-jaの提供するメトリックでは,そのようなことはありません。
718+% 公称10ポイントの和文フォントは,10ポイントで出力されます。
711719 %
712720 % この|ltjsclasses|でも,派生元の|jsclasses|と同じように,
713721 % この公称10ポイントのフォントをここでは13級に縮小して
@@ -803,9 +811,9 @@
803811 % \end{macrocode}
804812 %%
805813 % Lua\TeX-jaでは和文組版に伴うグルーはノードベースで挿入するようになり,また
806-% 欧文・和文間のグルーとイタリック補正は干渉しないようになりました.
814+% 欧文・和文間のグルーとイタリック補正は干渉しないようになりました。
807815 % まだ「和文の斜体」についてはLua\LaTeX カーネル側でまともな対応がされていませんが,
808-% |jsclasses.dtx|で行われていた|\textmc|, |\textgt|の再定義は不要のように思われます.
816+% |jsclasses.dtx|で行われていた|\textmc|, |\textgt|の再定義は不要のように思われます。
809817 %
810818 % 新クラスでも数式内で日本語が使えるようにしました。
811819 %
@@ -2387,7 +2395,6 @@
23872395 \@tempskipa -\@tempskipa \@afterindentfalse
23882396 \fi
23892397 \if@nobreak
2390-% \everypar{\everyparhook}% これは間違い
23912398 \everypar{}%
23922399 \else
23932400 \addpenalty\@secpenalty
@@ -2411,7 +2418,6 @@
24112418 %
24122419 % |\@sect| と |\@xsect| は,
24132420 % 前のアキがちょうどゼロの場合にもうまくいくように,多少変えてあります。
2414-% |\everyparhook| も挿入しています。
24152421 %
24162422 % \begin{macrocode}
24172423 \def\@sect#1#2#3#4#5#6[#7]#8{%
@@ -2455,6 +2461,8 @@
24552461 % 二つ挿入した |\everyparhook| のうち後者が |\paragraph| 類の後で2回実行され,
24562462 % それ以降は前者が実行されます。
24572463 %
2464+% [2011-10-05] Lua\TeX-jaでは|\everyparhook|は不要なので削除。
2465+%
24582466 % \begin{macrocode}
24592467 \def\@xsect#1{%
24602468 % 見出しの後ろの空きを \@tempskipa にセット
@@ -2474,8 +2482,8 @@
24742482 \hskip -\@tempskipa
24752483 \else
24762484 \clubpenalty \@clubpenalty
2477- \everypar{\everyparhook}%
2478- \fi\everyparhook}%
2485+ \everypar{}%
2486+ \fi}%
24792487 \else
24802488 \par \nobreak
24812489 \vskip \@tempskipa
@@ -4666,151 +4674,6 @@
46664674 % \end{macrocode}
46674675 % \end{macro}
46684676 %
4669-% \section{段落の頭へのグルー挿入禁止}
4670-%
4671-% 段落頭のかぎかっこなどを見かけ1字半下げから全角1字下げに直します。
4672-%
4673-% \begin{macrocode}
4674-\def\@inhibitglue{%
4675- \futurelet\@let@token\@@inhibitglue}
4676-\def\@@inhibitglue{%
4677- \ifx\@let@token「
4678- \inhibitglue
4679- \else
4680- \ifx\@let@token(
4681- \inhibitglue
4682- \else
4683- \ifx\@let@token『
4684- \inhibitglue
4685- \else
4686- \ifx\@let@token[
4687- \inhibitglue
4688- \fi
4689- \fi
4690- \fi
4691- \fi}
4692-\let\everyparhook=\@inhibitglue
4693-\AtBeginDocument{\everypar{\everyparhook}}
4694-% \end{macrocode}
4695-%
4696-% これだけではいけないようです。あちこちに |\everypar| を初期化するコマンドが
4697-% 隠されていました。
4698-%
4699-% まず,環境の直後の段落です。
4700-%
4701-% \begin{macrocode}
4702-\def\@doendpe{%
4703- \@endpetrue
4704- \def\par{%
4705- \@restorepar\everypar{\everyparhook}\par\@endpefalse}%
4706- \everypar{{\setbox\z@\lastbox}\everypar{\everyparhook}\@endpefalse\everyparhook}}
4707-% \end{macrocode}
4708-%
4709-% |\item| 命令の直後です。
4710-%
4711-% \begin{macrocode}
4712-\def\@item[#1]{%
4713- \if@noparitem
4714- \@donoparitem
4715- \else
4716- \if@inlabel
4717- \indent \par
4718- \fi
4719- \ifhmode
4720- \unskip\unskip \par
4721- \fi
4722- \if@newlist
4723- \if@nobreak
4724- \@nbitem
4725- \else
4726- \addpenalty\@beginparpenalty
4727- \addvspace\@topsep
4728- \addvspace{-\parskip}%
4729- \fi
4730- \else
4731- \addpenalty\@itempenalty
4732- \addvspace\itemsep
4733- \fi
4734- \global\@inlabeltrue
4735- \fi
4736- \everypar{%
4737- \@minipagefalse
4738- \global\@newlistfalse
4739- \if@inlabel
4740- \global\@inlabelfalse
4741- {\setbox\z@\lastbox
4742- \ifvoid\z@
4743- \kern-\itemindent
4744- \fi}%
4745- \box\@labels
4746- \penalty\z@
4747- \fi
4748- \if@nobreak
4749- \@nobreakfalse
4750- \clubpenalty \@M
4751- \else
4752- \clubpenalty \@clubpenalty
4753- \everypar{\everyparhook}%
4754- \fi\everyparhook}%
4755- \if@noitemarg
4756- \@noitemargfalse
4757- \if@nmbrlist
4758- \refstepcounter\@listctr
4759- \fi
4760- \fi
4761- \sbox\@tempboxa{\makelabel{#1}}%
4762- \global\setbox\@labels\hbox{%
4763- \unhbox\@labels
4764- \hskip \itemindent
4765- \hskip -\labelwidth
4766- \hskip -\labelsep
4767- \ifdim \wd\@tempboxa >\labelwidth
4768- \box\@tempboxa
4769- \else
4770- \hbox to\labelwidth {\unhbox\@tempboxa}%
4771- \fi
4772- \hskip \labelsep}%
4773- \ignorespaces}
4774-% \end{macrocode}
4775-%
4776-% 二つ挿入した |\everyparhook| のうち後者が |\section| 類の直後に2回,
4777-% 前者が3回目以降に実行されます。
4778-%
4779-% \begin{macrocode}
4780-\def\@afterheading{%
4781- \@nobreaktrue
4782- \everypar{%
4783- \if@nobreak
4784- \@nobreakfalse
4785- \clubpenalty \@M
4786- \if@afterindent \else
4787- {\setbox\z@\lastbox}%
4788- \fi
4789- \else
4790- \clubpenalty \@clubpenalty
4791- \everypar{\everyparhook}%
4792- \fi\everyparhook}}
4793-% \end{macrocode}
4794-%
4795-% |\@gnewline| についてはちょっと複雑な心境です。
4796-% もともとのp\LaTeXe は段落の頭にグルーが入る方で統一されていました。
4797-% しかし |\\| の直後にはグルーが入らず,不統一でした。
4798-% そこで |\\| の直後にもグルーを入れるように直していただいた経緯があります。
4799-% しかし,ここでは逆にグルーを入れない方で統一したいので,
4800-% また元に戻してしまいました。
4801-%
4802-% しかし単に戻すだけでも駄目みたいなので,ここでも最後にグルーを消しておきます。
4803-%
4804-% \begin{macrocode}
4805-\def\@gnewline #1{%
4806- \ifvmode
4807- \@nolnerr
4808- \else
4809- \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
4810- \inhibitglue \ignorespaces
4811- \fi}
4812-% \end{macrocode}
4813-%
48144677 % \section{いろいろなロゴ}
48154678 %
48164679 % \LaTeX 関連のロゴを作り直します。
Binary files a/src/ltjsclasses/ltjsclasses.pdf and b/src/ltjsclasses/ltjsclasses.pdf differ
--- a/src/ltjsclasses/ltjskiyou.cls
+++ b/src/ltjsclasses/ltjskiyou.cls
@@ -179,7 +179,8 @@
179179 &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
180180 \tabskip\z@skip\cr
181181 }}
182-\DeclareOption{disablejfam}{\@enablejfamfalse}
182+\DeclareOption{disablejfam}{%
183+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
183184 \newif\ifdraft
184185 \DeclareOption{draft}{\drafttrue \setlength\overfullrule{5pt}}
185186 \DeclareOption{final}{\draftfalse \setlength\overfullrule{0pt}}
@@ -189,7 +190,10 @@
189190 \jisfontfalse
190191 \newif\ifptexjis
191192 \ptexjisfalse
192-\DeclareOption{winjis}{}\DeclareOption{uplatex}{} % These 2 options are ignored.
193+\DeclareOption{winjis}{%
194+ \ClassWarningNoLine{\@currname}{The class option 'winjis' is obsolete}}
195+\DeclareOption{uplatex}{%
196+ \ClassWarningNoLine{\@currname}{The class option 'uplatex' is obsolete}}
193197 \DeclareOption{mingoth}{\mingothtrue}
194198 \DeclareOption{ptexjis}{\ptexjistrue}
195199 \DeclareOption{jis}{\jisfonttrue}
@@ -820,8 +824,8 @@
820824 \hskip -\@tempskipa
821825 \else
822826 \clubpenalty \@clubpenalty
823- \everypar{\everyparhook}%
824- \fi\everyparhook}%
827+ \everypar{}%
828+ \fi}%
825829 \else
826830 \par \nobreak
827831 \vskip \@tempskipa
@@ -1336,113 +1340,6 @@
13361340 \parindent 1\zw
13371341 \noindent
13381342 \llap{\@makefnmark\hskip0.3\zw}#1}
1339-\def\@inhibitglue{%
1340- \futurelet\@let@token\@@inhibitglue}
1341-\def\@@inhibitglue{%
1342- \ifx\@let@token「
1343- \inhibitglue
1344- \else
1345- \ifx\@let@token(
1346- \inhibitglue
1347- \else
1348- \ifx\@let@token『
1349- \inhibitglue
1350- \else
1351- \ifx\@let@token[
1352- \inhibitglue
1353- \fi
1354- \fi
1355- \fi
1356- \fi}
1357-\let\everyparhook=\@inhibitglue
1358-\AtBeginDocument{\everypar{\everyparhook}}
1359-\def\@doendpe{%
1360- \@endpetrue
1361- \def\par{%
1362- \@restorepar\everypar{\everyparhook}\par\@endpefalse}%
1363- \everypar{{\setbox\z@\lastbox}\everypar{\everyparhook}\@endpefalse\everyparhook}}
1364-\def\@item[#1]{%
1365- \if@noparitem
1366- \@donoparitem
1367- \else
1368- \if@inlabel
1369- \indent \par
1370- \fi
1371- \ifhmode
1372- \unskip\unskip \par
1373- \fi
1374- \if@newlist
1375- \if@nobreak
1376- \@nbitem
1377- \else
1378- \addpenalty\@beginparpenalty
1379- \addvspace\@topsep
1380- \addvspace{-\parskip}%
1381- \fi
1382- \else
1383- \addpenalty\@itempenalty
1384- \addvspace\itemsep
1385- \fi
1386- \global\@inlabeltrue
1387- \fi
1388- \everypar{%
1389- \@minipagefalse
1390- \global\@newlistfalse
1391- \if@inlabel
1392- \global\@inlabelfalse
1393- {\setbox\z@\lastbox
1394- \ifvoid\z@
1395- \kern-\itemindent
1396- \fi}%
1397- \box\@labels
1398- \penalty\z@
1399- \fi
1400- \if@nobreak
1401- \@nobreakfalse
1402- \clubpenalty \@M
1403- \else
1404- \clubpenalty \@clubpenalty
1405- \everypar{\everyparhook}%
1406- \fi\everyparhook}%
1407- \if@noitemarg
1408- \@noitemargfalse
1409- \if@nmbrlist
1410- \refstepcounter\@listctr
1411- \fi
1412- \fi
1413- \sbox\@tempboxa{\makelabel{#1}}%
1414- \global\setbox\@labels\hbox{%
1415- \unhbox\@labels
1416- \hskip \itemindent
1417- \hskip -\labelwidth
1418- \hskip -\labelsep
1419- \ifdim \wd\@tempboxa >\labelwidth
1420- \box\@tempboxa
1421- \else
1422- \hbox to\labelwidth {\unhbox\@tempboxa}%
1423- \fi
1424- \hskip \labelsep}%
1425- \ignorespaces}
1426-\def\@afterheading{%
1427- \@nobreaktrue
1428- \everypar{%
1429- \if@nobreak
1430- \@nobreakfalse
1431- \clubpenalty \@M
1432- \if@afterindent \else
1433- {\setbox\z@\lastbox}%
1434- \fi
1435- \else
1436- \clubpenalty \@clubpenalty
1437- \everypar{\everyparhook}%
1438- \fi\everyparhook}}
1439-\def\@gnewline #1{%
1440- \ifvmode
1441- \@nolnerr
1442- \else
1443- \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
1444- \inhibitglue \ignorespaces
1445- \fi}
14461343 \def\Shou#1{\hbox{$\m@th$%
14471344 \csname S@\f@size\endcsname
14481345 \fontsize\sf@size\z@
--- a/src/ltjsclasses/ltjspf.cls
+++ b/src/ltjsclasses/ltjspf.cls
@@ -179,7 +179,8 @@
179179 &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
180180 \tabskip\z@skip\cr
181181 }}
182-\DeclareOption{disablejfam}{\@enablejfamfalse}
182+\DeclareOption{disablejfam}{%
183+ \ClassWarningNoLine{\@currname}{The class option 'disablejfam' is obsolete}}
183184 \newif\ifdraft
184185 \DeclareOption{draft}{\drafttrue \setlength\overfullrule{5pt}}
185186 \DeclareOption{final}{\draftfalse \setlength\overfullrule{0pt}}
@@ -189,7 +190,10 @@
189190 \jisfontfalse
190191 \newif\ifptexjis
191192 \ptexjisfalse
192-\DeclareOption{winjis}{}\DeclareOption{uplatex}{} % These 2 options are ignored.
193+\DeclareOption{winjis}{%
194+ \ClassWarningNoLine{\@currname}{The class option 'winjis' is obsolete}}
195+\DeclareOption{uplatex}{%
196+ \ClassWarningNoLine{\@currname}{The class option 'uplatex' is obsolete}}
193197 \DeclareOption{mingoth}{\mingothtrue}
194198 \DeclareOption{ptexjis}{\ptexjistrue}
195199 \DeclareOption{jis}{\jisfonttrue}
@@ -749,8 +753,8 @@
749753 \hskip -\@tempskipa
750754 \else
751755 \clubpenalty \@clubpenalty
752- \everypar{\everyparhook}%
753- \fi\everyparhook}%
756+ \everypar{}%
757+ \fi}%
754758 \else
755759 \par \nobreak
756760 \vskip \@tempskipa
@@ -1232,113 +1236,6 @@
12321236 \parindent 1\zw
12331237 \noindent
12341238 \llap{\@makefnmark\hskip0.3\zw}#1}
1235-\def\@inhibitglue{%
1236- \futurelet\@let@token\@@inhibitglue}
1237-\def\@@inhibitglue{%
1238- \ifx\@let@token「
1239- \inhibitglue
1240- \else
1241- \ifx\@let@token(
1242- \inhibitglue
1243- \else
1244- \ifx\@let@token『
1245- \inhibitglue
1246- \else
1247- \ifx\@let@token[
1248- \inhibitglue
1249- \fi
1250- \fi
1251- \fi
1252- \fi}
1253-\let\everyparhook=\@inhibitglue
1254-\AtBeginDocument{\everypar{\everyparhook}}
1255-\def\@doendpe{%
1256- \@endpetrue
1257- \def\par{%
1258- \@restorepar\everypar{\everyparhook}\par\@endpefalse}%
1259- \everypar{{\setbox\z@\lastbox}\everypar{\everyparhook}\@endpefalse\everyparhook}}
1260-\def\@item[#1]{%
1261- \if@noparitem
1262- \@donoparitem
1263- \else
1264- \if@inlabel
1265- \indent \par
1266- \fi
1267- \ifhmode
1268- \unskip\unskip \par
1269- \fi
1270- \if@newlist
1271- \if@nobreak
1272- \@nbitem
1273- \else
1274- \addpenalty\@beginparpenalty
1275- \addvspace\@topsep
1276- \addvspace{-\parskip}%
1277- \fi
1278- \else
1279- \addpenalty\@itempenalty
1280- \addvspace\itemsep
1281- \fi
1282- \global\@inlabeltrue
1283- \fi
1284- \everypar{%
1285- \@minipagefalse
1286- \global\@newlistfalse
1287- \if@inlabel
1288- \global\@inlabelfalse
1289- {\setbox\z@\lastbox
1290- \ifvoid\z@
1291- \kern-\itemindent
1292- \fi}%
1293- \box\@labels
1294- \penalty\z@
1295- \fi
1296- \if@nobreak
1297- \@nobreakfalse
1298- \clubpenalty \@M
1299- \else
1300- \clubpenalty \@clubpenalty
1301- \everypar{\everyparhook}%
1302- \fi\everyparhook}%
1303- \if@noitemarg
1304- \@noitemargfalse
1305- \if@nmbrlist
1306- \refstepcounter\@listctr
1307- \fi
1308- \fi
1309- \sbox\@tempboxa{\makelabel{#1}}%
1310- \global\setbox\@labels\hbox{%
1311- \unhbox\@labels
1312- \hskip \itemindent
1313- \hskip -\labelwidth
1314- \hskip -\labelsep
1315- \ifdim \wd\@tempboxa >\labelwidth
1316- \box\@tempboxa
1317- \else
1318- \hbox to\labelwidth {\unhbox\@tempboxa}%
1319- \fi
1320- \hskip \labelsep}%
1321- \ignorespaces}
1322-\def\@afterheading{%
1323- \@nobreaktrue
1324- \everypar{%
1325- \if@nobreak
1326- \@nobreakfalse
1327- \clubpenalty \@M
1328- \if@afterindent \else
1329- {\setbox\z@\lastbox}%
1330- \fi
1331- \else
1332- \clubpenalty \@clubpenalty
1333- \everypar{\everyparhook}%
1334- \fi\everyparhook}}
1335-\def\@gnewline #1{%
1336- \ifvmode
1337- \@nolnerr
1338- \else
1339- \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null
1340- \inhibitglue \ignorespaces
1341- \fi}
13421239 \def\Shou#1{\hbox{$\m@th$%
13431240 \csname S@\f@size\endcsname
13441241 \fontsize\sf@size\z@
--- a/src/luatexja/jfmglue.lua
+++ b/src/luatexja/jfmglue.lua
@@ -76,6 +76,7 @@ local ltjs_get_skip_table = ltjs.get_skip_table
7676 local ltjf_font_metric_table = ltjf.font_metric_table
7777 local ltjf_metrics = ltjf.metrics
7878 local box_stack_level
79+local par_indented -- is the paragraph indented?
7980
8081 -------------------- Helper functions
8182
@@ -646,13 +647,17 @@ end
646647
647648 local function get_OA_skip()
648649 if not ihb_flag then
649- return new_jfm_glue(Np, find_char_class('jcharbdd',Np.met), Np.class)
650+ local c
651+ if Nq.id == id_math then c = -1 else c = 'jcharbdd' end
652+ return new_jfm_glue(Np, find_char_class(c,Np.met), Np.class)
650653 else return nil
651654 end
652655 end
653656 local function get_OB_skip()
654657 if not ihb_flag then
655- return new_jfm_glue(Nq, Nq.class, find_char_class('jcharbdd',Nq.met))
658+ local c
659+ if Np.id == id_math then c = -1 else c = 'jcharbdd' end
660+ return new_jfm_glue(Nq, Nq.class, find_char_class(c,Nq.met))
656661 else return nil
657662 end
658663 end
@@ -765,7 +770,12 @@ end
765770 local function handle_list_head()
766771 if Np.id == id_jglyph or (Np.id==id_pbox and Np.met) then
767772 if not ihb_flag then
768- local g = new_jfm_glue(Np, find_char_class('boxbdd',Np.met), Np.class)
773+ local g
774+ if par_indented then
775+ g = new_jfm_glue(Np, find_char_class('parbdd',Np.met), Np.class)
776+ else
777+ g = new_jfm_glue(Np, find_char_class('boxbdd',Np.met), Np.class)
778+ end
769779 if g then
770780 set_attr(g, attr_icflag, BOXBDD)
771781 if g.id==id_glue and #Bp==0 then
@@ -781,6 +791,7 @@ end
781791 -- initialize
782792 local function init_var()
783793 lp = head; Bp = {}; widow_Bp = {}; widow_Np = {first = nil}
794+ par_indented = false
784795 box_stack_level = ltjp.box_stack_level
785796 kanji_skip=skip_table_to_spec('kanjiskip')
786797 xkanji_skip=skip_table_to_spec('xkanjiskip')
@@ -799,6 +810,7 @@ local function init_var()
799810 -- hbox from \parindent is skipped.
800811 while lp and ((lp.id==id_whatsit and lp.subtype~=sid_user)
801812 or ((lp.id==id_hlist) and (lp.subtype==3))) do
813+ if (lp.id==id_hlist) and (lp.subtype==3) then par_indented = true end
802814 lp=node_next(lp) end
803815 last=node.tail(head)
804816 else
--- a/src/luatexja/jfont.lua
+++ b/src/luatexja/jfont.lua
@@ -29,6 +29,8 @@ local ITALIC = 1
2929 metrics={} -- this table stores all metric informations
3030 font_metric_table={} -- [font number] -> jfm_name, jfm_var, size
3131
32+luatexbase.create_callback("luatexja.load_jfm", "data", function (ft, jn) return ft end)
33+
3234 local jfm_file_name, jfm_var
3335 local defjfm_res
3436
@@ -96,8 +98,9 @@ function define_jfm(t)
9698 t[i] = nil
9799 end
98100 end
101+ t = luatexbase.call_callback("luatexja.load_jfm", t, jfm_file_name)
99102 t.size_cache = {}
100- defjfm_res= t
103+ defjfm_res = t
101104 end
102105
103106 local function mult_table(old,scale) -- modified from table.fastcopy
@@ -126,7 +129,7 @@ local function update_jfm_cache(j,sz)
126129 metrics[j].size_cache[sz].zh = round(metrics[j].zh*sz)
127130 end
128131
129-luatexbase.create_callback("ltj.find_char_class", "data",
132+luatexbase.create_callback("luatexja.find_char_class", "data",
130133 function (arg, fmtable, char)
131134 return 0
132135 end)
@@ -135,7 +138,7 @@ function find_char_class(c,m)
135138 -- c: character code, m: index in font_metric table
136139 if not metrics[m.jfm] then return 0 end
137140 return metrics[m.jfm].chars[c] or
138- luatexbase.call_callback("ltj.find_char_class", 0, m, c)
141+ luatexbase.call_callback("luatexja.find_char_class", 0, m, c)
139142 end
140143
141144 local function load_jfont_metric()
@@ -173,9 +176,9 @@ function jfontdefX(g)
173176 tex.sprint(cat_lp, '\\expandafter\\font\\csname ' .. cstemp .. '\\endcsname')
174177 end
175178
176--- EXT
177-luatexbase.create_callback("ltj.define_jfont", "data", function (ft, fn) return ft end)
179+luatexbase.create_callback("luatexja.define_jfont", "data", function (ft, fn) return ft end)
178180
181+-- EXT
179182 function jfontdefY() -- for horizontal font
180183 local j = load_jfont_metric()
181184 local fn = font.id(cstemp)
@@ -191,7 +194,7 @@ function jfontdefY() -- for horizontal font
191194 end
192195 update_jfm_cache(j, f.size)
193196 local fmtable = { jfm = j, size = f.size, var = jfm_var }
194- fmtable = luatexbase.call_callback("ltj.define_jfont", fmtable, fn)
197+ fmtable = luatexbase.call_callback("luatexja.define_jfont", fmtable, fn)
195198 font_metric_table[fn]=fmtable
196199 tex.sprint(cat_lp, ltj.is_global .. '\\protected\\expandafter\\def\\csname '
197200 .. cstemp .. '\\endcsname{\\ltj@curjfnt=' .. fn .. '\\relax}')
--- a/src/luatexja/otf.lua
+++ b/src/luatexja/otf.lua
@@ -122,7 +122,7 @@ local function cid_to_char(fmtable, fn)
122122 end
123123 return fmtable
124124 end
125-luatexbase.add_to_callback("ltj.define_jfont",
125+luatexbase.add_to_callback("luatexja.define_jfont",
126126 cid_to_char, "ltj.otf.define_jfont", 1)
127127 -- 既に読み込まれているフォントに対しても,同じことをやらないといけない
128128 for fn, v in pairs(ltjf_font_metric_table) do
@@ -137,7 +137,7 @@ local function cid_set_char_class(arg, fmtable, char)
137137 else return 0
138138 end
139139 end
140-luatexbase.add_to_callback("ltj.find_char_class",
140+luatexbase.add_to_callback("luatexja.find_char_class",
141141 cid_set_char_class, "ltj.otf.find_char_class", 1)
142142
143143 -------------------- all done
--- a/test/jfm-test.lua
+++ b/test/jfm-test.lua
@@ -12,7 +12,7 @@ luatexja.jfont.define_jfm {
1212 chars = { 'あ' },
1313 align = 'left', left = 0.0, down = 0.0,
1414 width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
15- glue = { [3] = { 1.41, 0, 0} },
15+ glue = { [3] = { 1.41, 0, 0}, [399] = {1.25, 0.43, 0.87} },
1616 kern = { [8] = -1.41 , [2] = 2.0, [99] = 1.21 }
1717 },
1818 [11] = {
@@ -59,6 +59,12 @@ luatexja.jfont.define_jfm {
5959 align = 'left', left = 0.0, down = 0.0,
6060 width = 1.0, height = 0.88, depth = 0.12, italic=0.0
6161 },
62+ [4] = {
63+ chars = { 'エ' },
64+ align = 'left', left = 0.0, down = 0.0,
65+ width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
66+ glue = { [199] = { 0.78, 0, 0} },
67+ },
6268 [99] = {
6369 chars = { 'jcharbdd' },
6470 glue = { [11] = { 1.41, 0, 0} },
@@ -68,6 +74,14 @@ luatexja.jfont.define_jfm {
6874 chars = { 'boxbdd' },
6975 glue = { [51] = { 1.03, 0, 0} , [1] = { 0.94, 0.23, 0.45 }},
7076 },
77+ [299] = {
78+ chars = { 'parbdd' },
79+ glue = { [51] = { 0.68, 0.02, 0.04} },
80+ },
81+ [399] = {
82+ chars = { -1 }, -- math
83+ glue = { [0] = { 0.68, 0.02, 0.04} },
84+ },
7185 [8] = {
7286 chars = { 'lineend' },
7387 }
--- a/test/jfm-ujiso16.lua
+++ b/test/jfm-ujiso16.lua
@@ -13,8 +13,8 @@ luatexja.jfont.define_jfm {
1313
1414 [1] = { -- 開き括弧類
1515 chars = {
16- 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3016,
17- 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
16+ '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖',
17+ '〘', '〝', '(', '[', '{', '⦅'
1818 },
1919 align = 'right', left = 0.0, down = 0.0,
2020 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16,
@@ -25,8 +25,8 @@ luatexja.jfont.define_jfm {
2525
2626 [2] = { -- 閉じ括弧類
2727 chars = {
28- 0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
29- 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60
28+ '’', '”', '、', '〉', '》', '」', '』', '】', '〕',
29+ '〗', '〙', '〟', ')', ',', ']', '}', '⦆'
3030 },
3131 align = 'left', left = 0.0, down = 0.0,
3232 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16,
@@ -35,12 +35,13 @@ luatexja.jfont.define_jfm {
3535 [1] = { 0.5 , 0.0, 0.5 },
3636 [3] = { 0.25, 0.0, 0.25 },
3737 [5] = { 0.5 , 0.0, 0.5 },
38+ [6] = { 0.5 , 0.0, 0.5 },
3839 [7] = { 0.5 , 0.0, 0.5 }
3940 }
4041 },
4142
4243 [3] = { -- 中点類
43- chars = {0x30FB, 0xFF1A, 0xFF1B},
44+ chars = {'・', ':', ';'},
4445 align = 'middle', left = 0.0, down = 0.0,
4546 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16,
4647 glue = {
@@ -50,12 +51,13 @@ luatexja.jfont.define_jfm {
5051 [3] = { 0.5 , 0.0, 0.5 },
5152 [4] = { 0.25, 0.0, 0.25 },
5253 [5] = { 0.25, 0.0, 0.25 },
54+ [6] = { 0.25, 0.0, 0.25 },
5355 [7] = { 0.25, 0.0, 0.25 }
5456 }
5557 },
5658
5759 [4] = { -- 句点類
58- chars = {0x3002, 0xFF0E},
60+ chars = {'。', '.'},
5961 align = 'left', left = 0.0, down = 0.0,
6062 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16,
6163 glue = {
@@ -63,12 +65,13 @@ luatexja.jfont.define_jfm {
6365 [1] = { 0.5 , 0.0, 0.0 },
6466 [3] = { 0.75, 0.0, 0.25 },
6567 [5] = { 0.5 , 0.0, 0.0 },
68+ [6] = { 0.5 , 0.0, 0.0 },
6669 [7] = { 0.5 , 0.0, 0.0 }
6770 }
6871 },
6972
7073 [5] = { -- ダッシュ
71- chars = { 0x2015, 0x2025, 0x2026 },
74+ chars = { '―', '‥', '…' },
7275 align = 'left', left = 0.0, down = 0.0,
7376 width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.16,
7477 glue = {
@@ -80,19 +83,42 @@ luatexja.jfont.define_jfm {
8083 }
8184 },
8285
83- [6] = { -- box末尾
84- chars = {'boxbdd'},
86+ [6] = { -- 感嘆符・疑問符
87+ chars = { '?', '!' },
88+ align = 'left', left = 0.0, down = 0.0,
89+ width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.16,
90+ glue = {
91+ [0] = { 0.5 , 0.0, 0.5 },
92+ [1] = { 0.5 , 0.0, 0.5 },
93+ [3] = { 0.25, 0.0, 0.25 },
94+ [7] = { 0.5 , 0.0, 0.5 },
95+ },
96+ kern = {
97+ [5] = 0.0
98+ }
8599 },
86100
87101 [7] = { -- 半角カナ
88102 chars = {
89- 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69,
90- 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72,
91- 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B,
92- 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84,
93- 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D,
94- 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96,
95- 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F
103+ '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ',
104+ 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ',
105+ 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ',
106+ 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト',
107+ 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ',
108+ 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ',
109+ 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚',
110+ "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522",
111+ "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529",
112+ "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536",
113+ "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543",
114+ "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550",
115+ "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557",
116+ "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564",
117+ "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571",
118+ "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578",
119+ "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585",
120+ "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592",
121+ "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598",
96122 },
97123 align = 'left', left = 0.0, down = 0.0,
98124 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.16,
@@ -101,4 +127,9 @@ luatexja.jfont.define_jfm {
101127 [3] = { 0.25, 0.0, 0.25 }
102128 }
103129 },
104-}
\ No newline at end of file
130+
131+ [99] = { -- box末尾
132+ chars = {'boxbdd', 'parbdd'},
133+ },
134+
135+}
--- a/test/jfm-ujiso25.lua
+++ b/test/jfm-ujiso25.lua
@@ -13,8 +13,8 @@ luatexja.jfont.define_jfm {
1313
1414 [1] = { -- 開き括弧類
1515 chars = {
16- 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3025,
17- 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
16+ '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖',
17+ '〘', '〝', '(', '[', '{', '⦅'
1818 },
1919 align = 'right', left = 0.0, down = 0.0,
2020 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25,
@@ -25,8 +25,8 @@ luatexja.jfont.define_jfm {
2525
2626 [2] = { -- 閉じ括弧類
2727 chars = {
28- 0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
29- 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60
28+ '’', '”', '、', '〉', '》', '」', '』', '】', '〕',
29+ '〗', '〙', '〟', ')', ',', ']', '}', '⦆'
3030 },
3131 align = 'left', left = 0.0, down = 0.0,
3232 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25,
@@ -35,12 +35,13 @@ luatexja.jfont.define_jfm {
3535 [1] = { 0.5 , 0.0, 0.5 },
3636 [3] = { 0.25, 0.0, 0.25 },
3737 [5] = { 0.5 , 0.0, 0.5 },
38+ [6] = { 0.5 , 0.0, 0.5 },
3839 [7] = { 0.5 , 0.0, 0.5 }
3940 }
4041 },
4142
4243 [3] = { -- 中点類
43- chars = {0x30FB, 0xFF1A, 0xFF1B},
44+ chars = {'・', ':', ';'},
4445 align = 'middle', left = 0.0, down = 0.0,
4546 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25,
4647 glue = {
@@ -50,12 +51,13 @@ luatexja.jfont.define_jfm {
5051 [3] = { 0.5 , 0.0, 0.5 },
5152 [4] = { 0.25, 0.0, 0.25 },
5253 [5] = { 0.25, 0.0, 0.25 },
54+ [6] = { 0.25, 0.0, 0.25 },
5355 [7] = { 0.25, 0.0, 0.25 }
5456 }
5557 },
5658
5759 [4] = { -- 句点類
58- chars = {0x3002, 0xFF0E},
60+ chars = {'。', '.'},
5961 align = 'left', left = 0.0, down = 0.0,
6062 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25,
6163 glue = {
@@ -63,12 +65,13 @@ luatexja.jfont.define_jfm {
6365 [1] = { 0.5 , 0.0, 0.0 },
6466 [3] = { 0.75, 0.0, 0.25 },
6567 [5] = { 0.5 , 0.0, 0.0 },
68+ [6] = { 0.5 , 0.0, 0.0 },
6669 [7] = { 0.5 , 0.0, 0.0 }
6770 }
6871 },
6972
7073 [5] = { -- ダッシュ
71- chars = { 0x2015, 0x2025, 0x2026 },
74+ chars = { '―', '‥', '…' },
7275 align = 'left', left = 0.0, down = 0.0,
7376 width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.25,
7477 glue = {
@@ -80,19 +83,42 @@ luatexja.jfont.define_jfm {
8083 }
8184 },
8285
83- [6] = { -- box末尾
84- chars = {'boxbdd'},
86+ [6] = { -- 感嘆符・疑問符
87+ chars = { '?', '!' },
88+ align = 'left', left = 0.0, down = 0.0,
89+ width = 1.0, height = 0.88, depth = 0.12, italic=0.88*0.25,
90+ glue = {
91+ [0] = { 0.5 , 0.0, 0.5 },
92+ [1] = { 0.5 , 0.0, 0.5 },
93+ [3] = { 0.25, 0.0, 0.25 },
94+ [7] = { 0.5 , 0.0, 0.5 },
95+ },
96+ kern = {
97+ [5] = 0.0
98+ }
8599 },
86100
87101 [7] = { -- 半角カナ
88102 chars = {
89- 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69,
90- 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72,
91- 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B,
92- 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84,
93- 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D,
94- 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96,
95- 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F
103+ '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ',
104+ 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ',
105+ 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ',
106+ 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト',
107+ 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ',
108+ 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ',
109+ 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚',
110+ "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522",
111+ "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529",
112+ "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536",
113+ "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543",
114+ "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550",
115+ "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557",
116+ "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564",
117+ "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571",
118+ "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578",
119+ "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585",
120+ "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592",
121+ "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598",
96122 },
97123 align = 'left', left = 0.0, down = 0.0,
98124 width = 0.5, height = 0.88, depth = 0.12, italic=0.88*0.25,
@@ -101,4 +127,9 @@ luatexja.jfont.define_jfm {
101127 [3] = { 0.25, 0.0, 0.25 }
102128 }
103129 },
104-}
\ No newline at end of file
130+
131+ [99] = { -- box末尾
132+ chars = {'boxbdd', 'parbdd'},
133+ },
134+
135+}
--- a/test/jfm-ujisx50.lua
+++ b/test/jfm-ujisx50.lua
@@ -13,8 +13,8 @@ luatexja.jfont.define_jfm {
1313
1414 [1] = { -- 開き括弧類
1515 chars = {
16- 0x2018, 0x201C, 0x3008, 0x300A, 0x300C, 0x300E, 0x3010, 0x3014, 0x3025,
17- 0x3018, 0x301D, 0xFF08, 0xFF3B, 0xFF5B, 0xFF5F
16+ '‘', '“', '〈', '《', '「', '『', '【', '〔', '〖',
17+ '〘', '〝', '(', '[', '{', '⦅'
1818 },
1919 align = 'right', left = 0.0, down = 0.0,
2020 width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0,
@@ -25,8 +25,8 @@ luatexja.jfont.define_jfm {
2525
2626 [2] = { -- 閉じ括弧類
2727 chars = {
28- 0x2019, 0x201D, 0x3001, 0x3009, 0x300B, 0x300D, 0x300F, 0x3011, 0x3015,
29- 0x3017, 0x3019, 0x301F, 0xFF09, 0xFF0C, 0xFF3D, 0xFF5D, 0xFF60
28+ '’', '”', '、', '〉', '》', '」', '』', '】', '〕',
29+ '〗', '〙', '〟', ')', ',', ']', '}', '⦆'
3030 },
3131 align = 'left', left = 0.0, down = 0.0,
3232 width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0,
@@ -35,12 +35,13 @@ luatexja.jfont.define_jfm {
3535 [1] = { 0.5*1.5 , 0.0, 0.5 },
3636 [3] = { 0.25*1.5, 0.0, 0.25 },
3737 [5] = { 0.5*1.5 , 0.0, 0.5 },
38+ [6] = { 0.5*1.5 , 0.0, 0.5 },
3839 [7] = { 0.5*1.5 , 0.0, 0.5 }
3940 }
4041 },
4142
4243 [3] = { -- 中点類
43- chars = {0x30FB, 0xFF1A, 0xFF1B},
44+ chars = {'・', ':', ';'},
4445 align = 'middle', left = 0.0, down = 0.0,
4546 width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0,
4647 glue = {
@@ -50,12 +51,13 @@ luatexja.jfont.define_jfm {
5051 [3] = { 0.5*1.5 , 0.0, 0.5 },
5152 [4] = { 0.25*1.5, 0.0, 0.25 },
5253 [5] = { 0.25*1.5, 0.0, 0.25 },
54+ [6] = { 0.25*1.5, 0.0, 0.25 },
5355 [7] = { 0.25*1.5, 0.0, 0.25 }
5456 }
5557 },
5658
5759 [4] = { -- 句点類
58- chars = {0x3002, 0xFF0E},
60+ chars = {'。', '.'},
5961 align = 'left', left = 0.0, down = 0.0,
6062 width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0,
6163 glue = {
@@ -63,12 +65,13 @@ luatexja.jfont.define_jfm {
6365 [1] = { 0.5*1.5 , 0.0, 0.0 },
6466 [3] = { 0.75*1.5, 0.0, 0.25 },
6567 [5] = { 0.5*1.5 , 0.0, 0.0 },
68+ [6] = { 0.5*1.5 , 0.0, 0.0 },
6669 [7] = { 0.5*1.5 , 0.0, 0.0 }
6770 }
6871 },
6972
7073 [5] = { -- ダッシュ
71- chars = { 0x2015, 0x2025, 0x2026 },
74+ chars = { '―', '‥', '…' },
7275 align = 'left', left = 0.0, down = 0.0,
7376 width = 1.0*1.5, height = 0.88, depth = 0.12, italic=0.0,
7477 glue = {
@@ -80,19 +83,42 @@ luatexja.jfont.define_jfm {
8083 }
8184 },
8285
83- [6] = { -- box末尾
84- chars = {'boxbdd'},
86+ [6] = { -- 感嘆符・疑問符
87+ chars = { '?', '!' },
88+ align = 'left', left = 0.0, down = 0.0,
89+ width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
90+ glue = {
91+ [0] = { 0.5*1.5 , 0.0, 0.5 },
92+ [1] = { 0.5*1.5 , 0.0, 0.5 },
93+ [3] = { 0.25*1.5, 0.0, 0.25 },
94+ [7] = { 0.5*1.5 , 0.0, 0.5 },
95+ },
96+ kern = {
97+ [5] = 0.0
98+ }
8599 },
86100
87101 [7] = { -- 半角カナ
88102 chars = {
89- 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, 0xFF68, 0xFF69,
90- 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72,
91- 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B,
92- 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84,
93- 0xFF85, 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D,
94- 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96,
95- 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F
103+ '。', '「', '」', '、', '・', 'ヲ', 'ァ', 'ィ', 'ゥ',
104+ 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ',
105+ 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ',
106+ 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト',
107+ 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ',
108+ 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ',
109+ 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン', '゙', '゚',
110+ "AJ1-516", "AJ1-517", "AJ1-518", "AJ1-519", "AJ1-520", "AJ1-521", "AJ1-522",
111+ "AJ1-523", "AJ1-524", "AJ1-525", "AJ1-526", "AJ1-527", "AJ1-528", "AJ1-529",
112+ "AJ1-530", "AJ1-531", "AJ1-532", "AJ1-533", "AJ1-534", "AJ1-535", "AJ1-536",
113+ "AJ1-537", "AJ1-538", "AJ1-539", "AJ1-540", "AJ1-541", "AJ1-542", "AJ1-543",
114+ "AJ1-544", "AJ1-545", "AJ1-546", "AJ1-547", "AJ1-548", "AJ1-549", "AJ1-550",
115+ "AJ1-551", "AJ1-552", "AJ1-553", "AJ1-554", "AJ1-555", "AJ1-556", "AJ1-557",
116+ "AJ1-558", "AJ1-559", "AJ1-560", "AJ1-561", "AJ1-562", "AJ1-563", "AJ1-564",
117+ "AJ1-565", "AJ1-566", "AJ1-567", "AJ1-568", "AJ1-569", "AJ1-570", "AJ1-571",
118+ "AJ1-572", "AJ1-573", "AJ1-574", "AJ1-575", "AJ1-576", "AJ1-577", "AJ1-578",
119+ "AJ1-579", "AJ1-580", "AJ1-581", "AJ1-582", "AJ1-583", "AJ1-584", "AJ1-585",
120+ "AJ1-586", "AJ1-587", "AJ1-588", "AJ1-589", "AJ1-590", "AJ1-591", "AJ1-592",
121+ "AJ1-593", "AJ1-594", "AJ1-595", "AJ1-596", "AJ1-597", "AJ1-598",
96122 },
97123 align = 'left', left = 0.0, down = 0.0,
98124 width = 0.5*1.5, height = 0.88, depth = 0.12, italic=0.0,
@@ -101,4 +127,9 @@ luatexja.jfont.define_jfm {
101127 [3] = { 0.25*1.5, 0.0, 0.25 }
102128 }
103129 },
130+
131+ [99] = { -- box末尾
132+ chars = {'boxbdd', 'parbdd'},
133+ },
134+
104135 }
\ No newline at end of file
Binary files a/test/test02-latex.pdf and b/test/test02-latex.pdf differ
Binary files a/test/test04-jfm.pdf and b/test/test04-jfm.pdf differ
--- a/test/test04-jfm.tex
+++ b/test/test04-jfm.tex
@@ -296,5 +296,20 @@
296296 \setbox0=\hbox{あ\hbox{(}あ\setbox3=\hbox{(}\unhbox3あ}
297297 \dumplist0}
298298
299+\vfill\eject
300+\noindent{\gt\bf paragraph, hbox and math boundary}
301+
302+\setbox1=\vbox{\parindent19.2pt \rmlh\hsize=100pt\parfillskip=30pt
303+かエ\par\global\setbox0=\lastbox}
304+\dumplist0
305+
306+\setbox1=\vbox{\noindent\rmlh\hsize=100pt\parfillskip=30pt
307+かエ\par\global\setbox0=\lastbox}
308+\dumplist0
309+
310+\setbox0=\hbox{\rmlh かエ}
311+\dumplist0
299312
313+\setbox0=\hbox{\rmlh あ$a$さ$a$か}
314+\dumplist0
300315 \end
Binary files /dev/null and b/test/test12-ltjarticle.pdf differ
--- /dev/null
+++ b/test/test12-ltjarticle.tex
@@ -0,0 +1,26 @@
1+%#!lualatex
2+\documentclass{ltjarticle}
3+\begin{document}
4+\noindent 漢字漢字ちょっと\textgt{チェック}
5+
6+「漢字←全角二分下がり?\\
7+「あいうえお」\textgt{「かきくけこ」}{\Large 「}
8+
9+次の例は「\texttt{min10}フォントについて」(乙部厳己)中のp.~8から拝借.
10+
11+\def\g#1#2#3{\leavevmode\vbox{\hsize=100pt%
12+\hrule height 1pt depth 0pt
13+\vskip#3pt\hbox{\jfont\e=file:#1:jfm=#2 at 20pt\e あいうえお}\vskip-#3pt
14+\hrule height 0pt depth 1pt}: #1, jfm=#2, yjabaselineshift=#3pt\par\bigskip}
15+
16+\g{KozGoPr6N-Medium.otf}{ujis}{0}
17+\g{KozGoPr6N-Medium.otf}{jis}{0.7563636}
18+\g{KozGoPr6N-Medium.otf}{jis}{0}
19+\g{ipaexg.ttf}{ujis}{0}
20+\g{ipaexg.ttf}{jis}{0.7563636}
21+\g{ipaexg.ttf}{jis}{0}
22+\g{hgrgm.ttc}{ujis}{0}
23+\g{hgrgm.ttc}{jis}{0}
24+\g{hgrgm.ttc}{jis}{0.7563636}
25+
26+\end{document}
\ No newline at end of file
旧リポジトリブラウザで表示