From 1363382ab40cad5afc0990b51f99f03141b6d4f3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 9 Mar 2018 22:46:10 +0000 Subject: platex (9mar18) git-svn-id: svn://tug.org/texlive/trunk@46902 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/platex/base/plcore.dtx | 197 ++++++++++++++++++++++-- 1 file changed, 181 insertions(+), 16 deletions(-) (limited to 'Master/texmf-dist/source/platex/base/plcore.dtx') diff --git a/Master/texmf-dist/source/platex/base/plcore.dtx b/Master/texmf-dist/source/platex/base/plcore.dtx index 156d9319100..f15de60e8e7 100644 --- a/Master/texmf-dist/source/platex/base/plcore.dtx +++ b/Master/texmf-dist/source/platex/base/plcore.dtx @@ -80,13 +80,18 @@ % \changes{v1.2u}{2017/11/04}{emathの\cs{marusuuref}対策} % \changes{v1.2v}{2018/01/27}{v1.2oとv1.2qの修正で\cs{nolinebreak}が % 効かない場合があったので、元に戻した} +% \changes{v1.2w}{2018/02/24}{e-up\TeX{}でも\cs{omathchardef}を使用} +% \changes{v1.2x}{2018/03/01}{JFMグルーノードを削除するマクロ追加} +% \changes{v1.2x}{2018/03/01}{\cs{removejfmglue}があれば利用するようにした} +% \changes{v1.2x}{2018/03/01}{セル最初の\cs{par}で空行が入らないようにした} +% \changes{v1.2x}{2018/03/01}{\cs{everypar}に\cs{inhibitglue}を仕込むマクロ追加} % \fi % % \iffalse %<*driver> \NeedsTeXFormat{pLaTeX2e} % \fi -\ProvidesFile{plcore.dtx}[2018/01/27 v1.2v pLaTeX core file] +\ProvidesFile{plcore.dtx}[2018/03/01 v1.2x pLaTeX core file] % \iffalse \documentclass{jltxdoc} \GetFileInfo{plcore.dtx} @@ -183,11 +188,51 @@ \def\documentstyle{% \makeatletter\input{pl209.def}\makeatother \documentclass} +% % \end{macrocode} % \end{macro} % % % +% \subsection{直前のJFM由来スペースの削除【コミュニティ版独自】} +% 現状のp\TeX{}(\TeX\ Live 2017時点)では、 +% |\inhibitglue|プリミティブは「JFM由来のスペース(グルー・カーン)挿入 +% ルーチンを抑制する」働きをします。しかし、既に挿入されてしまった +% JFMグルーやカーンを削除することはできません。 +% +% \begin{macro}{\removejfmglue} +% そこで、「最後のノードがJFMグルーであった場合にそれを削除する」という +% ユーザ向け命令を定義します。この機能にはe-p\TeX{} 180226以降の +% |\lastnodesubtype|プリミティブが必要です。 +% \changes{v1.2x}{2018/03/01}{JFMグルーノードを削除するマクロ追加} +% \begin{macrocode} +%\plIncludeInRelease{2018/03/09}% +% {\removejfmglue}{Macro added}% +%<*plcore|platexrelease> +% \end{macrocode} +% \begin{macrocode} +\ifx\lastnodesubtype\@undefined + \let\removejfmglue\@undefined +\else + \def\pltx@gluetype{11} + \def\pltx@jfmgluesubtype{21} + \protected\def\removejfmglue{% + \ifnum\lastnodetype=\pltx@gluetype\relax + \ifnum\lastnodesubtype=\pltx@jfmgluesubtype\relax + \unskip + \fi + \fi} +\fi +% +%\plEndIncludeInRelease +%\plIncludeInRelease{0000/00/00}% +% {\removejfmglue}{Macro added}% +%\let\removejfmglue\@undefined +%\plEndIncludeInRelease +% \end{macrocode} +% \end{macro} +% +% % \subsection{改ページ} % 縦組のとき、改ページ後の内容が偶数ページ(右ページ)からはじまるようにします。 % 横組のときには、奇数ページ(右ページ)からはじまります。 @@ -197,6 +242,7 @@ % \pstyle{empty}にし、ヘッダとフッタが入らないようにしています。 % \file{ltoutput.dtx}の定義を、縦組、横組に合わせて、定義しなおしたものです。 % \begin{macrocode} +%<*plcore> \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page \iftdir @@ -1624,15 +1670,21 @@ % しまうので、p\LaTeX{}では追加の対処を入れます。 % % まず、|l|, |c|, |r|の場合です。 -% セルの要素を|\mbox|に入れ、その最初で|\inhibitglue|を発行します。 +% 2017/09/26の修正では「セルの要素を|\mbox|に入れ、 +% その最初で|\inhibitglue|を発行する」という方針でしたが、 +% 2018/03/09の修正では「|\removejfmglue|マクロが定義されている場合は +% 最初に|\inhibitglue|を発行し、最後に|\removejfmglue|を発行する」という +% 方針にします。こうすれば少々\LaTeX{}との互換性が向上します。 % \changes{v1.2p}{2017/07/21}{tabular環境のセル内のJFMグル―を削除} % \changes{v1.2r}{2017/09/26}{tabular環境の右揃え(r)で罫線がずれるように % なっていたバグを修正} +% \changes{v1.2x}{2018/03/01}{\cs{removejfmglue}があれば利用するようにした} % \begin{macrocode} % -%\plIncludeInRelease{2017/09/26}{\@tabclassz} +%\plIncludeInRelease{2018/03/09}{\@tabclassz} % {Inhibit JFM glue in tabular cells}% %<*plcore|platexrelease> +\ifx\removejfmglue\@undefined \def\@tabclassz{% \ifcase\@lastchclass \@acolampacol @@ -1656,8 +1708,59 @@ \or \hfil\hskip1sp\mbox{\inhibitglue\ignorespaces\@sharp\unskip}% % r \fi}}} +\else +\def\@tabclassz{% + \ifcase\@lastchclass + \@acolampacol + \or + \@ampacol + \or + \or + \or + \@addamp + \or + \@acolampacol + \or + \@firstampfalse\@acol + \fi + \edef\@preamble{% + \@preamble{% + \ifcase\@chnum + \hfil\inhibitglue\ignorespaces\@sharp\unskip\removejfmglue\hfil % c + \or + \hskip1sp\inhibitglue\ignorespaces\@sharp\unskip\removejfmglue\hfil % l + \or + \hfil\hskip1sp\inhibitglue\ignorespaces\@sharp\unskip\removejfmglue % r + \fi}}} +\fi % %\plEndIncludeInRelease +%\plIncludeInRelease{2017/09/26}{\@tabclassz} +% {Inhibit JFM glue in tabular cells}% +%\def\@tabclassz{% +% \ifcase\@lastchclass +% \@acolampacol +% \or +% \@ampacol +% \or +% \or +% \or +% \@addamp +% \or +% \@acolampacol +% \or +% \@firstampfalse\@acol +% \fi +% \edef\@preamble{% +% \@preamble{% +% \ifcase\@chnum +% \hfil\mbox{\inhibitglue\ignorespaces\@sharp\unskip}\hfil % c +% \or +% \hskip1sp\mbox{\inhibitglue\ignorespaces\@sharp\unskip}\hfil % l +% \or +% \hfil\hskip1sp\mbox{\inhibitglue\ignorespaces\@sharp\unskip}% % r +% \fi}}} +%\plEndIncludeInRelease %\plIncludeInRelease{2017/07/29}{\@tabclassz} % {Inhibit JFM glue in tabular cells}% %\def\@tabclassz{% @@ -1714,16 +1817,34 @@ % \end{macro} % % \begin{macro}{\@classv} -% 次に、|p|の場合です。|\mbox{}\inhibitglue|と|\unskip|を追加しています。 +% 次に、|p|の場合です。 +% 2017/07/29の修正では|\mbox{}\inhibitglue|と|\unskip|を追加していましたが、 +% 以下のように|p|指定のセルの最初で|\par|として +% 改段落を発行すると、一行空いてしまうという症状が起きてしまいます(platex/\#63)。 +%\begin{verbatim} +% \begin{tabular}{p{5cm}} +% A\\ +% \relax\par +% A +% \end{tabular} +%\end{verbatim} +% ここでは、2017/07/29の修正から方針を改め、|\everypar|内に|\inhibitglue|を +% 仕込むという方針で対応します。 % \changes{v1.2p}{2017/07/21}{tabular環境のセル内のJFMグル―を削除} +% \changes{v1.2x}{2018/03/01}{セル最初の\cs{par}で空行が入らないようにした} % \begin{macrocode} -%\plIncludeInRelease{2017/07/29}{\@classv} +%\plIncludeInRelease{2018/03/09}{\@classv} % {Inhibit JFM glue in tabular cells}% %<*plcore|platexrelease> -\def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\mbox{}\inhibitglue\ignorespaces +\def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\pltx@next@inhibitglue\ignorespaces \@sharp\unskip\@endpbox}} % %\plEndIncludeInRelease +%\plIncludeInRelease{2017/07/29}{\@classv} +% {Inhibit JFM glue in tabular cells}% +%\def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\mbox{}\inhibitglue\ignorespaces +%\@sharp\unskip\@endpbox}} +%\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@classv} % {Inhibit JFM glue in tabular cells}% %\def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\ignorespaces @@ -1732,6 +1853,29 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\pltx@next@inhibitglue} +% 水平モードであればそのまま|\inhibitglue|を発行し、それ以外であれば +% |\everypar|内に|\inhibitglue|を仕込みます。 +% \changes{v1.2x}{2018/03/01}{\cs{everypar}に\cs{inhibitglue}を仕込むマクロ追加} +% \begin{macrocode} +%\plIncludeInRelease{2018/03/09}{\pltx@next@inhibitglue} +% {Add \pltx@next@inhibitglue}% +%<*plcore|platexrelease> +\protected\def\pltx@next@inhibitglue{% + \ifhmode\inhibitglue\else + \edef\@tempa{\everypar{\inhibitglue + \everypar{\unexpanded\expandafter{\the\everypar}}% + \unexpanded\expandafter{\the\everypar}}}% + \@tempa\fi} +% +%\plEndIncludeInRelease +%\plIncludeInRelease{0000/00/00}{\pltx@next@inhibitglue} +% {Add \pltx@next@inhibitglue}% +%\let\pltx@next@inhibitglue\@undefined +%\plEndIncludeInRelease +% \end{macrocode} +% \end{macro} +% % % \section{2013年以降の新しいp\TeX{}対応} % \LaTeXe{}のカーネルのコードをそのまま使うと、2013年以降のp\TeX{}では @@ -1864,7 +2008,7 @@ % ので、e-p\TeX{}の拡張レジスタを利用できるように設定します。 % \changes{v1.2j}{2016/11/09}{FAM256パッチ適用e-p\TeX{}に対応} % \begin{macrocode} -%\plIncludeInRelease{2016/11/29}% +%\plIncludeInRelease{2018/03/09}% % {\e@alloc@chardef}{Extended Allocation (FAM256)}% %<*plcore|platexrelease> % \end{macrocode} @@ -1879,16 +2023,17 @@ \else % \end{macrocode} % e-\TeX{}拡張で$2^{15}$個のレジスタが利用できます。 -% ^^A 「FAM256なしのe-(u)p\TeX{}」は事実上存在しないはず。 +% ^^A 備忘録:「FAM256なしのe-(u)p\TeX{}」は事実上存在しないはず。 % ^^A ただし、たとえばe-(u)p\TeX{}をベースにした % ^^A p\TeX{}-ng (Asiatic pTeX)はe-\TeX{}拡張を持っていて、 % ^^A FAM256パッチは適用されていないため、ここに該当する。 % ^^A cf: https://github.com/clerkma/ptex-ng % ^^A なお、p\TeX{}-ngはe-p\TeX{}と同様にpdf\TeX{}拡張の % ^^A 一部(e-p\TeX{}と範囲が一致しない)を持っていること、 -% ^^A また|\lastnodechar|などのe-p\TeX{}独自のプリミティブを -% ^^A 持っていないことにも注意…だったが、2017/09/06付で -% ^^A p\TeX{}-ngにも|\lastnodechar|が追加された。 +% ^^A また|\epTeXinputencoding|などのe-p\TeX{}独自のプリミティブを +% ^^A 持っていないことにも注意。 +% ^^A (|\lastnodechar|もe-p\TeX{}独自だったが、2017/09/06付で +% ^^A p\TeX{}-ngにも追加されている。) % \begin{macrocode} \mathchardef\e@alloc@top=32767 \let\e@alloc@chardef\mathchardef @@ -1896,19 +2041,39 @@ \else % \end{macrocode} % FAM256パッチが適用されたe-p\TeX{}の場合は、$2^{16}$個のレジスタが利用できます。 +% \changes{v1.2w}{2018/02/24}{e-up\TeX{}でも\cs{omathchardef}を使用} +% ^^A 備忘録:up\TeX{}では|\omathchardef|でなく|\chardef|も可だが、 +% ^^A フォーマット作成時に|-kanji-internal=euc|が指定される可能性が +% ^^A ないとは言い切れないので、FAM256パッチ適用済e-(u)p\TeX{}ならば +% ^^A 常に|\omathchardef|を用いることにする。 % \begin{macrocode} - \ifx\enablecjktoken\@undefined % pTeX \omathchardef\e@alloc@top=65535 \let\e@alloc@chardef\omathchardef - \else % upTeX - \chardef\e@alloc@top=65535 - \let\e@alloc@chardef\chardef - \fi \fi % \end{macrocode} % \begin{macrocode} % %\plEndIncludeInRelease +%\plIncludeInRelease{2016/11/29}% +% {\e@alloc@chardef}{Extended Allocation (FAM256)}% +%\ifx\omathchar\@undefined +% \ifx\widowpenalties\@undefined +% \mathchardef\e@alloc@top=255 +% \let\e@alloc@chardef\chardef +% \else +% \mathchardef\e@alloc@top=32767 +% \let\e@alloc@chardef\mathchardef +% \fi +%\else +% \ifx\enablecjktoken\@undefined % pTeX +% \omathchardef\e@alloc@top=65535 +% \let\e@alloc@chardef\omathchardef +% \else % upTeX +% \chardef\e@alloc@top=65535 +% \let\e@alloc@chardef\chardef +% \fi +%\fi +%\plEndIncludeInRelease %\plIncludeInRelease{2015/01/01}% % {\e@alloc@chardef}{Extended Allocation (FAM256)}% %\ifx\widowpenalties\@undefined -- cgit v1.2.3