% \iffalse meta-comment %% File: plcore.dtx % % Copyright 1994-2001 ASCII Corporation. % Copyright (c) 2010 ASCII MEDIA WORKS % Copyright (c) 2016-2021 Japanese TeX Development Community % % This file is part of the pLaTeX2e system (community edition). % ------------------------------------------------------------- % % \fi % % \iffalse %<*driver> \ifx\JAPANESEtrue\undefined \expandafter\newif\csname ifJAPANESE\endcsname \JAPANESEtrue \fi \def\eTeX{$\varepsilon$-\TeX} \def\pTeX{p\kern-.15em\TeX} \def\epTeX{$\varepsilon$-\pTeX} \def\pLaTeX{p\kern-.05em\LaTeX} \def\pLaTeXe{p\kern-.05em\LaTeXe} % % \fi % % \setcounter{StandardModuleDepth}{1} % \StopEventually{} % % \iffalse % \changes{v1.0}{1994/09/16}{first edition} % \changes{v1.1}{1995/04/12}{脚注マクロ修正} % \changes{v1.1a}{1995/11/10}{\cs{topmargin}が反映されないバグを修正} % \changes{v1.1b}{1996/01/26}{脚注マークの後ろに余計なスペースが入るのを修正} % \changes{v1.1c}{1996/01/30}{ファイル名を\file{ploutput.dtx}から % \file{plcore.dtx}とした。キャプション拡張を\file{plext.dtx}に移動。 % プリアンブルコマンドを追加} % \changes{v1.1d}{1996/02/17}{\cs{printglossary}を追加} % \changes{v1.1e}{1996/03/12}{tabbing環境での和欧文間スペース} % \changes{v1.1f}{1996/07/10}{トンボまわりを修正} % \changes{v1.1g}{1997/01/16}{\LaTeX\ \textt{!<1996/06/01!>}に対応} % \changes{v1.1h}{1997/06/25}{\LaTeX{}の改行マクロの変更に対応。 % ありがとう、奥村さん。} % \changes{v1.1i}{1998/02/03}{\cs{@shipoutsetup}を\cs{@outputpage}内に入れた} % \changes{v1.1j}{2001/05/10}{\cs{@makecol}で組み立てられる % \cs{@outputbox}の大きさが、縦組で中身が空のボックスだけの場合も適正になる % ように修正} % \changes{v1.2}{2001/09/04}{本文と\cs{footnoterule}が重なってしまうのを修正} % \changes{v1.2a}{2001/09/26}{\LaTeX\ \texttt{!<2001/06/01!>}に対応} % \changes{v1.2b}{2016/01/26}{2013年以降のp\TeX\ (r28720)で脚注番号の前後の和文文字 % との間にxkanjiskipが入ってしまう問題に対応。 % \cs{@outputbox}の深さが他のものの位置に影響を与えない % ようにする\texttt{\cs{vskip}~-\cs{dimen@}}が縦組モードでは無効になっていたので修正} % \changes{v1.2c}{2016/02/28}{1.2bと同様の修正をtabular環境にも行った} % \changes{v1.2c}{2016/02/28}{1.2bと同様の修正を\cs{parbox}命令にも行った} % \changes{v1.2c}{2016/02/28}{1.2bと同様の修正を\cs{underline}命令にも行った} % \changes{v1.2d}{2016/04/01}{multicolパッケージを使うとトンボの下端が縮む問題を修正} % \changes{v1.2e}{2016/05/20}{\file{fltrace}パッケージのp\LaTeX{}版 % として\file{pfltrace}パッケージを新設} % \changes{v1.2f}{2016/06/30}{\cs{@begindvibox}を常に横組に} % \changes{v1.2g}{2016/08/25}{カウンタ\cs{pltx@foot@penalty}を追加} % \changes{v1.2g}{2016/08/25}{合印の前の文字と合印の間をベタ組に} % \changes{v1.2g}{2016/08/25}{閉じ括弧類の直後に\cs{footnotetext}が続く % 場合に改行が起きることがある問題に対処} % \changes{v1.2g}{2016/08/25}{脚注の合印直後での改行が禁止されてしまう % 問題に対処} % \changes{v1.2h}{2016/09/01}{縦組でlongtableパッケージを使って表組の途中で改ページ % するとき無限ループが起こる問題に対処(Issue 21)} % \changes{v1.2i}{2016/09/08}{v1.2gの修正で入れた\cs{null}がまずかったので % 水平モードのときだけ発行することにした(Issue 23)} % \changes{v1.2j}{2016/11/09}{FAM256パッチ適用e-p\TeX{}に対応} % \changes{v1.2k}{2017/02/20}{目次で\cs{ref}を使った場合に後ろの空白が消える % 現象に対処するため、\cs{relax}のあとに\{\}を追加} % \changes{v1.2l}{2017/02/25}{脚注とボトムフロートの順序を入れ替えたことで % 版面全体の垂直位置がずれていたのを修正(Issue 32)} % \changes{v1.2l}{2017/02/25}{\cs{@makecol}を変更したのに % \cs{@makespecialcolbox}を変更しない、という判断について明文化} % \changes{v1.2m}{2017/03/19}{\cs{language}をリセット % (sync with ltoutput.dtx 2017/03/10 v1.3c)} % \changes{v1.2m}{2017/03/19}{\cs{verb}の途中でハイフネーションが起きない % ように\cs{language}を設定(sync with ltmiscen.dtx 2017/03/09 v1.1m)} % \changes{v1.2n}{2017/04/23}{ドキュメントの追加} % \changes{v1.2o}{2017/05/03}{行頭禁則文字の直前でも改行するようにした} % \changes{v1.2p}{2017/07/21}{tabular環境のセル内のJFMグル―を削除} % \changes{v1.2q}{2017/08/25}{\cs{nolinebreak}の場合に\cs{(x)kanjiskip}が % 入らなくなっていたのを修正} % \changes{v1.2r}{2017/09/26}{tabular環境の右揃え(r)で罫線がずれるように % なっていたバグを修正} % \changes{v1.2s}{2017/09/27}{相互参照のスペースファクターを補正} % \changes{v1.2s}{2017/09/27}{\cs{verb}の冒頭の半角空白を保持} % \changes{v1.2s}{2017/09/27}{tabbing環境の行冒頭のJFMグル―を削除} % \changes{v1.2t}{2017/10/31}{v1.2sの変更に伴い、\cs{ref}が数式モードで % エラーになっていたのを修正} % \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}を仕込むマクロ追加} % \changes{v1.2y}{2018/03/12}{\cs{inhibitglue}を\cs{everypar}の末尾に移動} % \changes{v1.2z}{2018/05/13}{\cs{@tombowbleed}マクロ追加} % \changes{v1.2z}{2018/05/13}{\cs{@tombowcolor}マクロ追加} % \changes{v1.2z}{2018/05/13}{bleed幅を\cs{@tombowbleed}に切り出し} % \changes{v1.2z}{2018/05/13}{色の付いたテキストの途中で改ページすると % トンボにも色が付く現象に対処、さらにトンボの色を\cs{@tombowcolor}へ・ % bleed幅を\cs{@tombowbleed}に切り出し} % \changes{v1.2z}{2018/05/13}{コマンドに分離、さらに % bleed幅を\cs{@tombowbleed}に切り出し} % \changes{v1.2z}{2018/05/13}{\cs{@tombowreset@@paper}コマンドに分離} % \changes{v1.3}{2018/09/02}{\cs{removejfmglue}の挙動を明文化} % \changes{v1.3}{2018/09/02}{\file{platexrelease}バグ修正} % \changes{v1.3a}{2018/10/31}{\LaTeXe{}とp\LaTeXe{}の更新タイミングずれ対策を % \file{plvers.dtx} (plfinal) から\file{plcore.dtx}へ移動、latexrelease対策 % (sync with ltfinal.dtx 2018/08/24 v2.1f)} % \changes{v1.3b}{2019/02/08}{中央揃えのセルでの\cs{unskip}対策 % (sync with lttab.dtx 2018/12/30 v1.1p)} % \changes{v1.3c}{2019/09/16}{Make \cs{AtBeginDvi} robust % (sync with ltoutput.dtx 2019/08/27 v1.4e)} % \changes{v1.3c}{2019/09/16}{Make \cs{underline} robust % (sync with ltboxes.dtx 2019/08/27 v1.3b)} % \changes{v1.3d}{2019/10/19}{判定順序を修正;extended modeかつ % FAM256拡張ありの場合に限りレジスタ数が65536個のため。} % \changes{v1.3d}{2019/10/19}{コピー忘れ} % \changes{v1.3e}{2020/03/05}{合字処理を抑止しつつ\cs{xkanjiskip}は挿入} % \changes{v1.3f}{2020/09/26}{\cs{AtBeginDvi}を再定義しない % (checked ltshipout.dtx 2020/09/21 v1.0c)} % \changes{v1.3f}{2020/09/26}{\cs{\_\_shipout\_execute\_cont:}を再定義 % (checked ltshipout.dtx 2020/09/21 v1.0c)} % \changes{v1.3g}{2020/09/28}{縦組で空のフロートだけのページの % フッタ(Issue 78)} % \changes{v1.3g}{2020/09/28}{\file{plexpl3}で定義した命令を使用} % \changes{v1.3h}{2021/03/14}{\LaTeXe~2021-06-01に伴う修正} % \changes{v1.3i}{2021/03/25}{\cs{@outputpage}, \cs{@vtryfc}での、非横組時における % \cs{@outputbox}の寸法補正のコードを別命令として切り出した} % \changes{v1.3j}{2021/06/03}{巻戻しコードのエラー修正} % \fi % % \iffalse %<*driver> \NeedsTeXFormat{pLaTeX2e} % \fi \ProvidesFile{plcore.dtx}[2021/06/03 v1.3j pLaTeX core file] % \iffalse \documentclass{jltxdoc} \GetFileInfo{plcore.dtx} \title{p\LaTeXe{}の拡張\space\fileversion} \author{Ken Nakano \& Hideaki Togashi} \date{作成日:\filedate} \begin{document} \maketitle \tableofcontents \DocInput{\filename} \end{document} % % \fi % % % \section{概要}\label{plcore:intro} % このファイルでは、つぎの機能の拡張や修正を行っています。 % 詳細は、それぞれの項目の説明を参照してください。 % % \begin{itemize} % \item プリアンブルコマンド % \item 改ページ % \item 改行 % \item オブジェクトの出力順序 % \item トンボ % \item 出力ルーチン % \item 脚注マクロ % \item 相互参照 % \item 疑似タイプ入力 % \item tabbing環境 % \item 用語集の出力 % \item 時分を示すカウンタ % \end{itemize} % % % \section{コード} % % このファイルの内容は、p\LaTeXe{}のコア部分です。 % \begin{macrocode} %<*plcore> % \end{macrocode} % % \subsection{プリアンブルコマンド} % 文書ファイルが必要とするフォーマットファイルの指定をするコマンドを % 拡張し、p\LaTeXe{}フォーマットファイルも認識するようにします。 % % \begin{macro}{\NeedsTeXFormat} % \begin{macro}{\@needsPformat} % \begin{macro}{\@needsPf@rmat} % |\NeedsTeXFormats|に``pLaTeX2e''を指定すると、 % ``LaTeX2e''フォーマットを必要とする英語版のクラスファイルや % パッケージファイルなどが使えなくなってしまうために再定義します。 % このコマンドは\file{ltclass.dtx}で定義されています。 % \begin{macrocode} \def\NeedsTeXFormat#1{% \def\reserved@a{#1}% \ifx\reserved@a\pfmtname \expandafter\@needsPformat \else \ifx\reserved@a\fmtname \expandafter\expandafter\expandafter\@needsformat \else \@latex@error{This file needs format `\reserved@a'% \MessageBreak but this is `\pfmtname'}{% The current input file will not be processed further,\MessageBreak because it was written for some other flavor of TeX.\MessageBreak\@ehd}% \endinput \fi \fi} % \def\@needsPformat{\@ifnextchar[\@needsPf@rmat{}} % \def\@needsPf@rmat[#1]{% \@ifl@t@r\pfmtversion{#1}{}% {\@latex@warning@no@line {You have requested release `#1' of pLaTeX,\MessageBreak but only release `\pfmtversion' is available}}} % \@onlypreamble\@needsPformat \@onlypreamble\@needsPf@rmat % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\documentstyle} % |\documentclass|の代わりに|\documentstyle|が使われると、 % \LaTeX~2.09互換モードに入ります。このとき、 % オリジナルの\LaTeX{}では\file{latex209.def}を読み込みますが、 % p\LaTeXe{}では\file{pl209.def}を読み込みます。 % このコマンドは\file{ltclass.dtx}で定義されています。 % \begin{macrocode} \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|プリミティブが必要です。 % この命令はあくまで「\verb+\removejfmglue+の展開時点で % 既にp\TeX{}によって挿入完了しているJFMグルー」だけを % 削除し、「これから挿入されようとするJFMグルー」は抑制しません。例えば %\begin{verbatim} % 始)\removejfmglue 中)\relax\removejfmglue 終 %\end{verbatim} % という入力からは % \begin{quote} % 始)\removejfmglue 中)\relax\removejfmglue 終 % \end{quote} % が得られます(最初の\verb+\removejfmglue+は結果的に何もしていません)。 % \changes{v1.2x}{2018/03/01}{JFMグルーノードを削除するマクロ追加} % \changes{v1.3}{2018/09/02}{\cs{removejfmglue}の挙動を明文化} % \begin{macrocode} %\plIncludeInRelease{2018/03/09}% % {\removejfmglue}{Macro added}% %<*plcore|platexrelease> % \end{macrocode} % \begin{macrocode} \ifx\lastnodesubtype\@undefined \let\removejfmglue\@undefined \else \setbox0\hbox{% \ifdefined\ucs %% upTeX check \jfont\tenmin=upjisr-h at 9.62216pt \else \jfont\tenmin=min10 \fi\tenmin \char\jis"214B\null\setbox0\lastbox \global\chardef\pltx@gluetype\lastnodetype \global\chardef\pltx@jfmgluesubtype\lastnodesubtype } \setbox0=\box\voidb@x \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{改ページ} % 縦組のとき、改ページ後の内容が偶数ページ(右ページ)からはじまるようにします。 % 横組のときには、奇数ページ(右ページ)からはじまります。 % % \begin{macro}{\cleardoublepage} % このコマンドによって出力される、白ページのページスタイルを % \pstyle{empty}にし、ヘッダとフッタが入らないようにしています。 % \file{ltoutput.dtx}の定義を、縦組、横組に合わせて、定義しなおしたものです。 % \begin{macrocode} %<*plcore> \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page \iftdir \hbox{}\thispagestyle{empty}\newpage \if@twocolumn\hbox{}\newpage\fi \fi \else \ifydir \hbox{}\thispagestyle{empty}\newpage \if@twocolumn\hbox{}\newpage\fi \fi \fi\fi} % \end{macrocode} % \end{macro} % % \subsection{改行} % % \begin{macro}{\@gnewline} % \changes{v1.1c}{1995/08/25}{行頭禁則文字の直前での改行での不具合の修正} % 日本語\TeX{}の行頭禁則処理は、禁則対象文字の直前に、 % |\prebreakpenalty|で指定されたペナルティの値を挿入することで % 行なっています。 % ところが、改行コマンドは負のペナルティの値を挿入することで改行を行ないます。 % そのために、禁則ペナルティの値が$10000$の文字の直後では、ペナルティの値が % 相殺され、改行することができません。 % %\begin{verbatim} % あいうえお\\ % !かきくけこ %\end{verbatim} % % したがって、|\newline|マクロに|\mbox{}|を入れることによって、 % |\newline|マクロのペナルティ$-10000$と行頭文字のペナルティ$10000$が % 加算されないようにします。|\\|は|\newline|マクロを呼び出しています。 % % なお、|\newline|マクロは\file{ltspaces.dtx}で定義されています。 % % \changes{v1.1j}{1999/04/05}{オプションを付けた場合に、余計な空白 % が入ってしまうのを修正。ありがとう、鈴木隆志@京都大学さん。} % \changes{v1.1h}{1997/06/25}{\LaTeX{}の改行マクロの変更に対応。 % ありがとう、奥村さん。} % \LaTeX\ \texttt{<1996/12/01>}で改行マクロが変更され、|\\|が % |\newline|を呼び出さなくなったため、変更された改行マクロに対応しまし % た。|\null|の挿入位置は同じです。 % \file{ltspace.dtx}の定義を上記に合わせて、定義しなおしました。 % % \emph{日本語\TeX{}開発コミュニティによる補足}: % アスキーによるp\LaTeX{}では、行頭禁則文字の直前で|\\|による強制改行を % 行えるようにするという目的で % |\null|を|\@gnewline|マクロ内に挿入していました。 % しかし、これでは|\\\par|と書いた場合にUnderfull警告が出なくなって % います(|tests/newline_par.tex|を\texttt{latex}と\texttt{platex}で % 処理してみてください)。 % % もし|\null|の代わりに|\hskip\z@|を挿入すれば、\LaTeX{}と同様に % Underfull警告を出すことができます。 % ただし、|\null|を挿入した場合と異なり、強制改行後の行頭に % JFMグル―が入らなくなります。これはむしろ、奥村さんのjsclassesで % 行頭を天ツキに直しているのと同じですが、p\LaTeX{}としては挙動が % 変化してしまいますので、現時点では|\null|→|\hskip\z@|への変更を % 見送っています。 % \changes{v1.2n}{2017/04/23}{ドキュメントの追加} % % \begin{macrocode} \def\@gnewline #1{% \ifvmode \@nolnerr \else \unskip \reserved@e {\reserved@f#1}\nobreak \hfil \break \null \ignorespaces \fi} % % \end{macrocode} % \end{macro} % % \begin{macro}{\@no@lnbk} % \emph{日本語\TeX{}開発コミュニティによる追加}: % さらに、|\\|だけでなく|\linebreak|についても同様の対処をします。 % \LaTeX{}の定義のままではマクロによるペナルティ$-10000$と % 行頭文字のペナルティ$10000$が加算されてしまうため、 % |\hskip\z@\relax|を入れておきます。なお、|\linebreak|を発行して % 行分割が起きた場合、新しい行頭のJFMグル―は消えるという従来の % p\LaTeX{}の挙動も維持しています。 % \changes{v1.2o}{2017/05/03}{行頭禁則文字の直前でも改行するようにした} % % 前回の|\hskip\z@\relax|の追加では、|\nolinebreak|の場合に|\kanjiskip|や % |\xkanjiskip|が入らない問題が起きてしまいました。そこで、 % |\penalty\z@\relax|に変更しました。これは、明示的な|\penalty|プリミティブ % 同士の合算は行われないことを利用しています。 % \changes{v1.2q}{2017/08/25}{\cs{nolinebreak}の場合に\cs{(x)kanjiskip}が % 入らなくなっていたのを修正} % % ところが、その変更によってそもそも|\nolinebreak|が効かない場合が % 生じたので、変更全体をいったんキャンセルして元に戻します。 % \changes{v1.2v}{2018/01/27}{v1.2oとv1.2qの修正で\cs{nolinebreak}が % 効かない場合があったので、元に戻した} % \begin{macrocode} %\plIncludeInRelease{2017/10/28}{\@no@lnbk} % {Break before prebreakpenalty (revert)}% %\def\@no@lnbk #1[#2]{% % \ifvmode % \@nolnerr % \else % \@tempskipa\lastskip % \unskip % \penalty #1\@getpen{#2}% % \ifdim\@tempskipa>\z@ % \hskip\@tempskipa % \ignorespaces % \fi % \fi} %\plEndIncludeInRelease %\plIncludeInRelease{2017/07/29}{\@no@lnbk} % {Break before prebreakpenalty (another)}% %\def\@no@lnbk #1[#2]{% % \ifvmode % \@nolnerr % \else % \@tempskipa\lastskip % \unskip % \penalty #1\@getpen{#2}% % \penalty\z@\relax %% added (2017/08/25) % \ifdim\@tempskipa>\z@ % \hskip\@tempskipa % \ignorespaces % \fi % \fi} %\plEndIncludeInRelease %\plIncludeInRelease{2017/05/05}{\@no@lnbk} % {Break before prebreakpenalty}% %\def\@no@lnbk #1[#2]{% % \ifvmode % \@nolnerr % \else % \@tempskipa\lastskip % \unskip % \penalty #1\@getpen{#2}% % \hskip\z@\relax %% added (2017/05/03) % \ifdim\@tempskipa>\z@ % \hskip\@tempskipa % \ignorespaces % \fi % \fi} %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@no@lnbk} % {LaTeX2e original}% %\def\@no@lnbk #1[#2]{% % \ifvmode % \@nolnerr % \else % \@tempskipa\lastskip % \unskip % \penalty #1\@getpen{#2}% % \ifdim\@tempskipa>\z@ % \hskip\@tempskipa % \ignorespaces % \fi % \fi} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % なお、\LaTeX{}用の命令である|\\|と|\linebreak|には上記のような % 禁則文字への対策を入れていますが、plain \TeX{}互換のシンプルな % 命令である|\break|や|\nobreak|には、対策を行いません。 % % \subsection{オブジェクトの出力順序} % オリジナルの\LaTeX{}は、トップフロート、本文、脚注、ボトムフロート % の順番で出力しますけれども、日本語組版では、トップフロート、本文、 % ボトムフロート、脚注という順番の方が一般的ですので、 % このような順番になるよう修正をします。 % % したがって、文書ファイルによっては\LaTeX{}の組版結果と異なる場合が % ありますので、注意をしてください。 % % 2014年に\LaTeX{}に\file{fltrace}パッケージが追加されましたので、 % そのp\LaTeX{}版として\file{pfltrace}パッケージを追加します。 % この\file{pfltrace}パッケージは\LaTeX{}の\file{fltrace}パッケージに % 依存します。 % \changes{v1.2e}{2016/05/20}{\file{fltrace}パッケージのp\LaTeX{}版 % として\file{pfltrace}パッケージを新設} % \begin{macrocode} %<*fltrace> \NeedsTeXFormat{pLaTeX2e} \ProvidesPackage{pfltrace} [2016/05/20 v1.2e Standard pLaTeX package (float tracing)] \RequirePackageWithOptions{fltrace} % % \end{macrocode} % % \begin{macro}{\pltx@adjust@wd@outputbox} % |\@outputpage|内で実行されていた % \begin{quote} % 縦組の際に|\@outputbox|の内容が空のボックスだけの場合に、|\wd\@outputbox|が % 0ptになってしまい、結果としてフッタの位置がくるってしまっていた。 % 0の|\hskip|を発生させると|\wd\@outputbox|の値が期待したものとなるので、 % 縦組の場合はその方法で対処する。 % % ただし、0の|\hskip|を発生させるとき、水平モードに入ってしまうと、たとえば % longtableパッケージを使用して表組途中で改ページするときに|\par -> {\vskip}|の % 無限ループが起きてしまいます。そこで、|\vbox|の中で発生させます。 % \end{quote} % という処理を取り出したものです。 % % \LaTeXe~2021-06-01では段落開始時の``para/*''フックが実装されますが、 % それを一時的に無効化するために「プリミティブとしての」|\everypar|を % |\pdfprimitive\everypar|として呼び出しています。 % \begin{macrocode} %<*plcore|platexrelease> \def\pltx@adjust@wd@outputbox{% \ifydir\else\vbox{\pdfprimitive\everypar{}\hskip\z@}\fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\pltx@adjust@wd@outputbox@vtryfc} % |\pltx@adjust@wd@outputbox|と同様の処理ですが、|\@vtryfc|では % |\vbox|の位置が異なります。 % \begin{macrocode} \def\pltx@adjust@wd@outputbox@vtryfc{% \ifydir\else\pdfprimitive\everypar{}\hskip\z@\fi} % % \end{macrocode} % \end{macro} % % \begin{macro}{\@makecol} % このマクロが組み立てる部分の中心となります。 % \file{ltoutput.dtx}で定義されているものです。 % \begin{macrocode} %\plIncludeInRelease{2017/04/08}{\@makecol} % {Take into account depth of footnote}% %<*plcore|platexrelease> \gdef\@makecol{% \setbox\@outputbox\box\@cclv% \let\@elt\relax % added on LaTeX (ltoutput.dtx 2003/12/16 v1.2k) \xdef\@freelist{\@freelist\@midlist}% \global \let \@midlist \@empty \@combinefloats % \end{macrocode} % オリジナルの\LaTeX{}は、トップフロート、本文、脚注、ボトムフロートの順番で % 出力します。一方p\LaTeX{}は、トップフロート、本文、ボトムフロート、脚注の % 順番で出力します。 % ところが、アスキー版のコードは順番を入れ替えるだけでなく、脚注のあるページの % 版面全体の垂直位置が(特に縦組で顕著に)ずれてしまっていました。 % これは補正量|\dp\@outputbox|の取得を\emph{脚注挿入より前}に行っていたためで、 % コミュニティ版p\LaTeX{}ではこの問題に対処してあります。 % 結果的に、fnposパッケージ(yafoot)の % |\makeFNbottom|かつ|\makeFNbelow|な状態と完全に等価になりました。 % \changes{v1.2l}{2017/02/25}{脚注とボトムフロートの順序を入れ替えたことで % 版面全体の垂直位置がずれていたのを修正(Issue 32)} % \begin{macrocode} \let\pltx@textbottom\@textbottom % save (pLaTeX 2017/02/25) \ifvoid\footins\else % changed (pLaTeX 2017/02/25) \setbox\@outputbox \vbox {% \boxmaxdepth \@maxdepth \unvbox \@outputbox \@textbottom % inserted here (pLaTeX 2017/02/25) \vskip \skip\footins \color@begingroup \normalcolor \footnoterule \unvbox \footins \color@endgroup }% \let\@textbottom\relax % disable temporarily (pLaTeX 2017/02/25) \fi \ifvbox\@kludgeins \@makespecialcolbox \else \setbox\@outputbox \vbox to\@colht {% %\boxmaxdepth \@maxdepth % comment out on LaTeX 1997/12/01 \@texttop \dimen@ \dp\@outputbox \unvbox \@outputbox % \end{macrocode} % 次の行は以前は %\begin{verbatim} %\iftdir\vbox{\hskip\z@}\fi %\end{verbatim} % でしたが、|\pltx@adjust@wd@outputbox|として切り出しました。 % \changes{v1.1j}{2001/05/10}{\cs{@makecol}で組み立てられる % \cs{@outputbox}の大きさが、縦組で中身が空のボックスだけの場合も適正になる % ように修正} % \changes{v1.2b}{2016/01/26}{\cs{@outputbox}の深さが他のものの位置に影響を与えない % ようにする\texttt{\cs{vskip}~-\cs{dimen@}}が縦組モードでは無効になっていたので修正} % \changes{v1.2h}{2016/09/01}{縦組でlongtableパッケージを使って表組の途中で改ページ % するとき無限ループが起こる問題に対処(Issue 21)} % \changes{v1.3i}{2021/03/25}{非横組時における % \cs{@outputbox}の寸法補正のコードを\cs{pltx@adjust@wd@outputbox}として切り出した} % \begin{macrocode} \pltx@adjust@wd@outputbox \vskip -\dimen@ \@textbottom }% \fi \let\@textbottom\pltx@textbottom % restore (pLaTeX 2017/02/25) \global \maxdepth \@maxdepth } % %\plEndIncludeInRelease %\plIncludeInRelease{2016/09/03}{\@makecol} % {Avoid infinite loop}% %\gdef\@makecol{% % \setbox\@outputbox\box\@cclv% % \xdef\@freelist{\@freelist\@midlist}% % \global \let \@midlist \@empty % \@combinefloats % \ifvbox\@kludgeins % \@makespecialcolbox % \else % \setbox\@outputbox \vbox to\@colht {% % %\boxmaxdepth \@maxdepth % comment out on LaTeX 1997/12/01 % \@texttop % \dimen@ \dp\@outputbox % \unvbox \@outputbox % \iftdir\vbox{\hskip\z@}\fi % \vskip -\dimen@ % \@textbottom % \ifvoid\footins\else % for pLaTeX % \vskip \skip\footins % \color@begingroup % \normalcolor % \footnoterule % \unvbox \footins % \color@endgroup % \fi % }% % \fi % \global \maxdepth \@maxdepth %} %\plEndIncludeInRelease %\plIncludeInRelease{2016/04/17}{\@makecol} % {Adjust for \dp\@outputbox in tate mode}% %\gdef\@makecol{% % \setbox\@outputbox\box\@cclv% % \xdef\@freelist{\@freelist\@midlist}% % \global \let \@midlist \@empty % \@combinefloats % \ifvbox\@kludgeins % \@makespecialcolbox % \else % \setbox\@outputbox \vbox to\@colht {% % %\boxmaxdepth \@maxdepth % comment out on LaTeX 1997/12/01 % \@texttop % \dimen@ \dp\@outputbox % \unvbox \@outputbox % \iftdir\hskip\z@\fi % \vskip -\dimen@ % \@textbottom % \ifvoid\footins\else % for pLaTeX % \vskip \skip\footins % \color@begingroup % \normalcolor % \footnoterule % \unvbox \footins % \color@endgroup % \fi % }% % \fi % \global \maxdepth \@maxdepth %} %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@makecol} % {ASCII Corporation original}% %\gdef\@makecol{% % \setbox\@outputbox\box\@cclv% % \xdef\@freelist{\@freelist\@midlist}% % \global \let \@midlist \@empty % \@combinefloats % \ifvbox\@kludgeins % \@makespecialcolbox % \else % \setbox\@outputbox \vbox to\@colht {% % %\boxmaxdepth \@maxdepth % comment out on LaTeX 1997/12/01 % \@texttop % \dimen@ \dp\@outputbox % \unvbox \@outputbox % \iftdir\hskip\z@ % \else\vskip -\dimen@\fi % \@textbottom % \ifvoid\footins\else % for pLaTeX % \vskip \skip\footins % \color@begingroup % \normalcolor % \footnoterule % \unvbox \footins % \color@endgroup % \fi % }% % \fi % \global \maxdepth \@maxdepth %} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % % \begin{macro}{\@makespecialcolbox} % 本文(あるいはボトムフロート)と脚注の間に|\@textbottom|を入れたいので、 % |\@makespecialcolbox|コマンドも修正をします。 % やはり、\file{ltoutput.dtx}で定義されているものです。 % % このマクロは、|\enlargethispage|が使われたときに、 % |\@makecol|マクロから呼び出されます。 % % \noindent\emph{日本語\TeX{}開発コミュニティによる補足(2017/02/25)}: % 2016/11/29以前のp\LaTeX{}では、|\@makecol|はボトムフロートを挿入した後、 % すぐに|\@kludgeins|が空かどうか判定し % \begin{itemize} % \item 空の場合は、残りすべての処理を|\@makespecialcolbox|に任せる % \item 空でない場合は、|\@makecol|自身で残りすべての処理を行う % \end{itemize} % としていました。しかし2017/04/08以降のp\LaTeX{}では、|\@makecol|はボトム % フロートと脚注を挿入してから|\@kludgeins|の判定に移るようにしています。 % したがって、新しい|\@makecol|から以下に記す|\@makespecialcolbox|が呼び % 出される場合は、|\ifvoid\footins|(二箇所)の判定は常に真となるはずです。 % 要するに「つぎの部分がp\LaTeX{}用の修正です。」という二箇所のコードは % 実質的に不要となりました。 % % しかし、だからといって消してしまうと、古いp\LaTeX{}の|\@makecol|を % ベースに作られた外部パッケージから|\@makespecialcolbox|が呼び出される % 場合に脚注が消滅するおそれがあります。このため、|\@makespecialcolbox|は % 従来のコードのまま維持してあります(害はありません)。 % \changes{v1.2l}{2017/02/25}{\cs{@makecol}を変更したのに % \cs{@makespecialcolbox}を変更しない、という判断について明文化} % \begin{macrocode} %<*plcore|fltrace> \gdef\@makespecialcolbox{% %<*trace> \fl@trace{Krudgeins ht \the\ht\@kludgeins\space dp \the\dp\@kludgeins\space wd \the\wd\@kludgeins}% % \setbox\@outputbox \vbox {% \@texttop \dimen@ \dp\@outputbox \unvbox\@outputbox \vskip-\dimen@ }% \@tempdima \@colht \ifdim \wd\@kludgeins>\z@ \advance \@tempdima -\ht\@outputbox \advance \@tempdima \pageshrink %<*trace> \fl@trace {Natural ht of col: \the\ht\@outputbox}% \fl@trace {\string \@colht: \the\@colht}% \fl@trace {Pageshrink added: \the\pageshrink}% \fl@trace {Hence, space added: \the\@tempdima}% % \setbox\@outputbox \vbox to \@colht {% % \boxmaxdepth \maxdepth \unvbox\@outputbox \vskip \@tempdima \@textbottom % \end{macrocode} % つぎの部分がp\LaTeX{}用の修正です。 % \changes{v1.2}{2001/09/04}{本文と\cs{footnoterule}が重なってしまうのを修正} % \begin{macrocode} \ifvoid\footins\else % for pLaTeX \vskip\skip\footins \color@begingroup \normalcolor \footnoterule \unvbox \footins \color@endgroup \fi }% \else \advance \@tempdima -\ht\@kludgeins %<*trace> \fl@trace {Natural ht of col: \the\ht\@outputbox}% \fl@trace {\string \@colht: \the\@colht}% \fl@trace {Extra size added: -\the \ht \@kludgeins}% \fl@trace {Hence, height of inner box: \the\@tempdima}% \fl@trace {Max? pageshrink available: \the\pageshrink}% % \setbox \@outputbox \vbox to \@colht {% \vbox to \@tempdima {% \unvbox\@outputbox \@textbottom % \end{macrocode} % つぎの部分がp\LaTeX{}用の修正です。 % 脚注があれば、ここでそれを出力します。 % \changes{v1.2}{2001/09/04}{本文と\cs{footnoterule}が重なってしまうのを修正} % \begin{macrocode} \ifvoid\footins\else % for pLaTeX \vskip\skip\footins \color@begingroup \normalcolor \footnoterule \unvbox \footins \color@endgroup \fi }\vss}% \fi {\setbox \@tempboxa \box \@kludgeins}% %<*trace> \fl@trace {kludgeins box made void}% % } % % \end{macrocode} % \end{macro} % % % \begin{macro}{\@reinserts} % このマクロは、|\@specialoutput|マクロから呼び出されます。 % ボックス|footins|が組み立てられたモードに合わせて % 縦モードか横モードで|\unvbox|をします。 % \begin{macrocode} %<*plcore> \def\@reinserts{% \ifvoid\footins\else\insert\footins{% \iftbox\footins\tate\else\yoko\fi \unvbox\footins}\fi \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi } % % \end{macrocode} % \end{macro} % % % \begin{macro}{\@vtryfc} % \LaTeXe\ 2017/01/01以降では、例えば %\begin{verbatim} % \documentclass{tarticle} % \begin{document} % \begin{figure} % \end{figure} % \clearpage % a % \end{document} %\end{verbatim} % のようにすると「空のフロート」だけの空白ページが発生します。 % このとき、縦組クラスではフッタが持ち上がってしまうので、 % 対策します。(Issue \#78) % % なお、\LaTeXe\ 2015/01/01--2016/03/31 patch level 3では %\begin{verbatim} % ! Output loop---100 consecutive dead cycles. %\end{verbatim} % のエラーが出ていました。 % それより昔の版では空白ページは発生しません。 % % 対策方法は、\file{ltoutput.dtx}で定義されている|\@vtryfc|に % |\ifydir\else\hskip\z@\fi|の追加です(|\@makecol|と同様)が、 % 別命令|\pltx@adjust@wd@outputbox@vtryfc|として切り出しました。 % \changes{v1.3g}{2020/09/28}{縦組で空のフロートだけのページの % フッタ(Issue 78)} % \changes{v1.3i}{2021/03/25}{非横組時における % \cs{@outputbox}の寸法補正のコードを\cs{pltx@adjust@wd@outputbox@vtryfc}として切り出した} % \begin{macrocode} %\plIncludeInRelease{2020/10/01}{\@vtryfc} % {Empty float}% %<*plcore|platexrelease> \def\@vtryfc #1{% \global\setbox\@outputbox\vbox{\pltx@adjust@wd@outputbox@vtryfc}% \let\@elt\@wtryfc \@flsucceed \global\setbox\@outputbox \vbox to\@colht{% \vskip \@fptop \vskip -\@fpsep \unvbox \@outputbox \vskip \@fpbot}% \let\@elt\relax \xdef #1{\@failedlist\@flfail}% \xdef\@freelist{\@freelist\@flsucceed}} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@vtryfc} % {LaTeX2e original}% %\def\@vtryfc #1{% % \global\setbox\@outputbox\vbox{}% % \let\@elt\@wtryfc % \@flsucceed % \global\setbox\@outputbox \vbox to\@colht{% % \vskip \@fptop % \vskip -\@fpsep % \unvbox \@outputbox % \vskip \@fpbot}% % \let\@elt\relax % \xdef #1{\@failedlist\@flfail}% % \xdef\@freelist{\@freelist\@flsucceed}} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % % \subsection{トンボ} % ここではトンボを出力するためのマクロを定義しています。 % % \begin{macro}{\iftombow} % \begin{macro}{\iftombowdate} % |\iftombow|はトンボを出力するかどうか、|\iftombowdate|はDVIを作成した % 日付をトンボの脇に出力するかどうかを示すために用います。 % \begin{macrocode} %<*plcore> \newif\iftombow \tombowfalse \newif\iftombowdate \tombowdatetrue % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\@tombowwidth} % |\@tombowwidth|には、トンボ用罫線の太さを指定します。 % デフォルトは0.1ポイントです。 % この値を変更し、|\maketombowbox|コマンドを実行することにより、トンボの % 罫線太さを変更して出力することができます。通常の使い方では、 % トンボの罫線を変更する必要はありません。DVIをフィルムに面付け出力する % とき、トンボをつけずに位置はそのままにする必要があるときに、この太さを % ゼロポイントにします。 % \begin{macrocode} \newdimen\@tombowwidth \setlength{\@tombowwidth}{.1\p@} % \end{macrocode} % \end{macro} % % \begin{macro}{\@tombowbleed} % |\@tombowbleed|は、bleed幅を指定します。 % デフォルトは3mmです。 % \changes{v1.2z}{2018/05/13}{\cs{@tombowbleed}マクロ追加} % \begin{macrocode} % %\plIncludeInRelease{2018/05/20}{\@tombowbleed}{Macro added}% %<*plcore|platexrelease> \def\@tombowbleed{3mm} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@tombowbleed}{Macro added}% %\let\@tombowbleed\@undefined %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\@tombowcolor} % |\@tombowcolor|は、トンボの色です。 % デフォルトは|\normalcolor|です。 % \changes{v1.2z}{2018/05/13}{\cs{@tombowcolor}マクロ追加} % \begin{macrocode} % %\plIncludeInRelease{2018/05/20}{\@tombowcolor}{Macro added}% %<*plcore|platexrelease> \def\@tombowcolor{\normalcolor} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@tombowcolor}{Macro added}% %\let\@tombowcolor\@undefined %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % トンボ用の罫線を定義します。 % % \begin{macro}{\@TL} % \begin{macro}{\@Tl} % \begin{macro}{\@TC} % \begin{macro}{\@TR} % \begin{macro}{\@Tr} % |\@TL|と|\@Tl|はページ上部の左側、 % |\@TC|はページ上部の中央、 % |\@TR|と|\@Tr|はページ上部の左側のトンボとなるボックスです。 % \begin{macrocode} \newbox\@TL\newbox\@Tl \newbox\@TC \newbox\@TR\newbox\@Tr % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@BL} % \begin{macro}{\@Bl} % \begin{macro}{\@BC} % \begin{macro}{\@BR} % \begin{macro}{\@Br} % |\@BL|と|\@Bl|はページ下部の左側、 % |\@BC|はページ下部の中央、 % |\@BR|と|\@Br|はページ下部の左側のトンボとなるボックスです。 % \begin{macrocode} \newbox\@BL\newbox\@Bl \newbox\@BC \newbox\@BR\newbox\@Br % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@CL} % \begin{macro}{\@CR} % |\@CL|はページ左側の中央、|\@CR|はページ右側の中央のトンボとなる % ボックスです。 % \begin{macrocode} \newbox\@CL \newbox\@CR % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\@bannertoken} % \begin{macro}{\@bannerfont} % |\@bannertoken|トークンは、トンボの横に出力する文字列を入れます。 % デフォルトでは何も出力しません。 % |\@bannerfont|フォントは、その文字列を出力するためのフォントです。 % 9ポイントのタイプライタ体としています。 % \changes{v1.1f}{1996/09/03}{Add \cs{@bannertoken}.} % \begin{macrocode} \font\@bannerfont=cmtt9 \newtoks\@bannertoken \@bannertoken{} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\maketombowbox} % |\maketombowbox|コマンドは、トンボとなるボックスを作るために用います。 % このコマンドは、トンボとなるボックスを作るだけで、それらのボックスを % 出力するのではないことに注意をしてください。 % \changes{v1.2z}{2018/05/13}{bleed幅を\cs{@tombowbleed}に切り出し} % \begin{macrocode} % %\plIncludeInRelease{2018/05/20}{\maketombowbox} % {Use \@tombowbleed}% %<*plcore|platexrelease> \def\maketombowbox{% \setbox\@TL\hbox to\z@{\yoko\hss \vrule width\dimexpr 10mm+\@tombowbleed\relax height\@tombowwidth depth\z@ \vrule height10mm width\@tombowwidth depth\z@ % \end{macrocode} % \changes{v1.0f}{1996/07/10}{トンボの横にDVIファイルの作成日を出力する % ようにした。} % \changes{v1.0g}{1997/01/23}{作成日の出力をするかどうかをフラグで指定する % ようにした。} % \begin{macrocode} \iftombowdate \raise4pt\hbox to\z@{\hskip5mm\@bannerfont\the\@bannertoken\hss}% \fi}% \setbox\@Tl\hbox to\z@{\yoko\hss \vrule width10mm height\@tombowwidth depth\z@ \vrule height\dimexpr 10mm+\@tombowbleed\relax width\@tombowwidth depth\z@}% \setbox\@TC\hbox{\yoko \vrule width10mm height\@tombowwidth depth\z@ \vrule height10mm width\@tombowwidth depth\z@ \vrule width10mm height\@tombowwidth depth\z@}% \setbox\@TR\hbox to\z@{\yoko \vrule height10mm width\@tombowwidth depth\z@ \vrule width\dimexpr 10mm+\@tombowbleed\relax height\@tombowwidth depth\z@\hss}% \setbox\@Tr\hbox to\z@{\yoko \vrule height\dimexpr 10mm+\@tombowbleed\relax width\@tombowwidth depth\z@ \vrule width10mm height\@tombowwidth depth\z@\hss}% % \setbox\@BL\hbox to\z@{\yoko\hss \vrule width\dimexpr 10mm+\@tombowbleed\relax depth\@tombowwidth height\z@ \vrule depth10mm width\@tombowwidth height\z@}% \setbox\@Bl\hbox to\z@{\yoko\hss \vrule width10mm depth\@tombowwidth height\z@ \vrule depth\dimexpr 10mm+\@tombowbleed\relax width\@tombowwidth height\z@}% \setbox\@BC\hbox{\yoko \vrule width10mm depth\@tombowwidth height\z@ \vrule depth10mm width\@tombowwidth height\z@ \vrule width10mm depth\@tombowwidth height\z@}% \setbox\@BR\hbox to\z@{\yoko \vrule depth10mm width\@tombowwidth height\z@ \vrule width\dimexpr 10mm+\@tombowbleed\relax depth\@tombowwidth height\z@\hss}% \setbox\@Br\hbox to\z@{\yoko \vrule depth\dimexpr 10mm+\@tombowbleed\relax width\@tombowwidth height\z@ \vrule width10mm depth\@tombowwidth height\z@\hss}% % \setbox\@CL\hbox to\z@{\yoko\hss \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth \vrule height10mm depth10mm width\@tombowwidth}% \setbox\@CR\hbox to\z@{\yoko \vrule height10mm depth10mm width\@tombowwidth \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}% } % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\maketombowbox} % {ASCII Corporation original}% %\def\maketombowbox{% % \setbox\@TL\hbox to\z@{\yoko\hss % \vrule width13mm height\@tombowwidth depth\z@ % \vrule height10mm width\@tombowwidth depth\z@ % \iftombowdate % \raise4pt\hbox to\z@{\hskip5mm\@bannerfont\the\@bannertoken\hss}% % \fi}% % \setbox\@Tl\hbox to\z@{\yoko\hss % \vrule width10mm height\@tombowwidth depth\z@ % \vrule height13mm width\@tombowwidth depth\z@}% % \setbox\@TC\hbox{\yoko % \vrule width10mm height\@tombowwidth depth\z@ % \vrule height10mm width\@tombowwidth depth\z@ % \vrule width10mm height\@tombowwidth depth\z@}% % \setbox\@TR\hbox to\z@{\yoko % \vrule height10mm width\@tombowwidth depth\z@ % \vrule width13mm height\@tombowwidth depth\z@\hss}% % \setbox\@Tr\hbox to\z@{\yoko % \vrule height13mm width\@tombowwidth depth\z@ % \vrule width10mm height\@tombowwidth depth\z@\hss}% % \setbox\@BL\hbox to\z@{\yoko\hss % \vrule width13mm depth\@tombowwidth height\z@ % \vrule depth10mm width\@tombowwidth height\z@}% % \setbox\@Bl\hbox to\z@{\yoko\hss % \vrule width10mm depth\@tombowwidth height\z@ % \vrule depth13mm width\@tombowwidth height\z@}% % \setbox\@BC\hbox{\yoko % \vrule width10mm depth\@tombowwidth height\z@ % \vrule depth10mm width\@tombowwidth height\z@ % \vrule width10mm depth\@tombowwidth height\z@}% % \setbox\@BR\hbox to\z@{\yoko % \vrule depth10mm width\@tombowwidth height\z@ % \vrule width13mm depth\@tombowwidth height\z@\hss}% % \setbox\@Br\hbox to\z@{\yoko % \vrule depth13mm width\@tombowwidth height\z@ % \vrule width10mm depth\@tombowwidth height\z@\hss}% % \setbox\@CL\hbox to\z@{\yoko\hss % \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth % \vrule height10mm depth10mm width\@tombowwidth}% % \setbox\@CR\hbox to\z@{\yoko % \vrule height10mm depth10mm width\@tombowwidth % \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}% %} %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\@outputtombow} % |\@outputtombow|コマンドは、トンボを出力するのに用います。 % コミュニティ版では、「色付きテキストの途中で改ページが起きた場合に、 % トンボにも色が付いてしまう」という現象を防ぎ、さらにトンボの色を % 簡単に変えられるよう、|\@tombowcolor|というマクロに切り出しています。 % \changes{v1.2d}{2016/04/01}{multicolパッケージを使うとトンボの下端が縮む問題を修正} % \changes{v1.2z}{2018/05/13}{色の付いたテキストの途中で改ページすると % トンボにも色が付く現象に対処、さらにトンボの色を\cs{@tombowcolor}へ・ % bleed幅を\cs{@tombowbleed}に切り出し} % \changes{v1.3}{2018/09/02}{\file{platexrelease}バグ修正} % \begin{macrocode} % %\plIncludeInRelease{2018/05/20}{\@outputtombow} % {Use \@tombowcolor and \@tombowbleed}% %<*plcore|platexrelease> \def\@outputtombow{% \iftombow \vbox to\z@{\kern-\dimexpr 10mm+\@tombowbleed\relax\relax \boxmaxdepth\maxdimen \moveleft\@tombowbleed \vbox to\@@paperheight{% \color@begingroup \@tombowcolor \hbox to\@@paperwidth{\hskip\@tombowbleed\relax \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip\@tombowbleed}% \kern-10mm \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}% \vfill \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}% \vfill \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}% \kern-10mm \hbox to\@@paperwidth{\hskip\@tombowbleed\relax \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip\@tombowbleed}% \color@endgroup }\vss }% \fi } % %\plEndIncludeInRelease %\plIncludeInRelease{2016/04/17}{\@outputtombow} % {Safe \boxmaxdepth}% %\def\@outputtombow{% % \iftombow % \vbox to\z@{\kern-13mm\relax % \boxmaxdepth\maxdimen % \moveleft3mm\vbox to\@@paperheight{% % \hbox to\@@paperwidth{\hskip3mm\relax % \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip3mm}% % \kern-10mm % \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}% % \vfill % \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}% % \vfill % \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}% % \kern-10mm % \hbox to\@@paperwidth{\hskip3mm\relax % \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip3mm}% % }\vss % }% % \fi %} %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@outputtombow} % {ASCII Corporation original}% %\def\@outputtombow{% % \iftombow % \vbox to\z@{\kern-13mm\relax % \moveleft3mm\vbox to\@@paperheight{% % \hbox to\@@paperwidth{\hskip3mm\relax % \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip3mm}% % \kern-10mm % \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}% % \vfill % \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}% % \vfill % \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}% % \kern-10mm % \hbox to\@@paperwidth{\hskip3mm\relax % \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip3mm}% % }\vss % }% % \fi %} %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\@@paperheight} % \begin{macro}{\@@paperwidth} % \begin{macro}{\@@topmargin} % |\@@paperheight|は、用紙の縦の長さにトンボの長さを加えた長さになります。 % % |\@@paperwidth|は、用紙の横の長さにトンボの長さを加えた長さになります。 % % |\@@topmargin|は、現在のトップマージンに1インチ加えた長さになります。 % \begin{macrocode} \newdimen\@@paperheight \newdimen\@@paperwidth \newdimen\@@topmargin % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@tombowreset@@paper} % トンボ出力オプションが指定されている場合に % 用紙サイズを再設定する命令です。 % |\@outputpage|へ加える変更を簡潔にするため、分離した上で % |\@tombowbleed|を使うようにしました。 % \changes{v1.2z}{2018/05/13}{コマンドに分離、さらに % bleed幅を\cs{@tombowbleed}に切り出し} % \begin{macrocode} % %\plIncludeInRelease{2018/05/20}{\@tombowreset@@paper} % {Macro separated}% %<*plcore|platexrelease> \def\@tombowreset@@paper{% \@@topmargin\topmargin \iftombow \@@paperwidth\paperwidth \advance\@@paperwidth 2\dimexpr\@tombowbleed\relax \@@paperheight\paperheight \advance\@@paperheight 10mm\relax \advance\@@paperheight 2\dimexpr\@tombowbleed\relax \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax \fi } % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@tombowreset@@paper} % {Macro separated}% %\let\@tombowreset@@paper\@undefined %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % % \subsection{出力ルーチン} % ここで実際にトンボを出力します。 % % \begin{macro}{\@shipoutsetup} % \changes{v1.1i}{1998/02/03}{Command removed} % |\@outputpage|内に挿入したので削除しました。 % \end{macro} % % \begin{macro}{\@outputpage} % |\textwidth|と|\textheight|の交換は、|\@shipoutsetup|内では行ないません。 % なぜなら、|\@shipoutsetup|マクロが実行されるときは、 % |\shipout|される|\vbox|の中であり、このときは横組モードですので、 % つねに|\iftdir|は偽と判断され、縦と横のサイズを交換できないからです。 % % なお、この変更をローカルなものにするために、 % |\begingroup|と|\endgroup|で囲みます。 % \changes{v1.2a}{2001/09/26}{\LaTeX\ \texttt{!<2001/06/01!>}に対応} % \begin{macrocode} % %\plIncludeInRelease{2018/05/20}{\@outputpage} % {Use \@tombowreset@@paper}% %<*plcore|platexrelease> \def\@outputpage{% \begingroup % the \endgroup is put in by \aftergroup \iftdir \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@ \fi \let \protect \noexpand % \end{macrocode} % \LaTeXe\ 2017-04-15ではverbatim環境内でハイフネーションが起きないように % 修正されましたが、verbatim環境の途中で改ページが起きた場合にヘッダで % ハイフネーションが抑制されるのは正しくないので、|\language|を % |\begin{document}|での値にリセットします(参考:latex2e svn r1407)。 % プリアンブルで特別に設定されればその値、設定されなければ0です(万が一 % |\document|の定義が古い場合\footnote{\LaTeXe\ 2017/01/01以前を使って % p\LaTeXe{}のフォーマットを作成した場合や、dinbrief.clsのように独自の % 再定義を行うクラスやパッケージを使った場合に起こるかもしれません。}は % $-1$になりますが、これは0と同じはたらきをするので問題は起きません)。 % \changes{v1.2m}{2017/03/19}{\cs{language}をリセット % (sync with ltoutput.dtx 2017/03/10 v1.3c)} % \begin{macrocode} \language\document@default@language \@resetactivechars \global\let\@@if@newlist\if@newlist \global\@newlistfalse \@parboxrestore \shipout\vbox{\yoko \set@typeset@protect \aftergroup\endgroup \aftergroup\set@typeset@protect % \end{macrocode} % \changes{v1.1g}{1998/02/03}{\cs{@shipoutsetup}を\cs{@outputpage}内に入れた} % ここから|\@shipoutsetup|の内容。 % \begin{macrocode} \if@specialpage \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% \fi % \end{macrocode} % \changes{v1.1c}{1995/02/05}{\cs{oddsidemargin}と\cs{evensidemargin}が % 逆だったのを修正} % \begin{macrocode} \if@twoside \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot \iftdir\let\@themargin\evensidemargin \else\let\@themargin\oddsidemargin\fi \else \let\@thehead\@evenhead \let\@thefoot\@evenfoot \iftdir\let\@themargin\oddsidemargin \else\let\@themargin\evensidemargin\fi \fi\fi % \end{macrocode} % トンボ出力オプションが指定されている場合、ここで用紙サイズを再設定します。 % \TeX の加える左と上部の1インチは、トンボの内側に入ります。 % \changes{v1.1a}{1995/11/10}{\cs{topmargin}が反映されないバグを修正} % \changes{v1.2z}{2018/05/13}{\cs{@tombowreset@@paper}コマンドに分離} % \begin{macrocode} \@tombowreset@@paper % \end{macrocode} % \begin{macrocode} \reset@font \normalsize \normalsfcodes \let\label\@gobble \let\index\@gobble \let\glossary\@gobble \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ % \end{macrocode} % ここまでが|\@shipoutsetup|の内容。 % \begin{macrocode} \@begindvi \@outputtombow \vskip \@@topmargin \moveright\@themargin\vbox{% \setbox\@tempboxa \vbox to\headheight{% \vfil \color@hbox \normalcolor \hb@xt@\textwidth{\@thehead}% \color@endbox }% %% 22 Feb 87 \dp\@tempboxa \z@ \box\@tempboxa \vskip \headsep \box\@outputbox \baselineskip \footskip \color@hbox \normalcolor \hb@xt@\textwidth{\@thefoot}% \color@endbox }% }% % \endgroup now inserted by \aftergroup % \end{macrocode} % |\if@newlist|を初期化。 % \begin{macrocode} \global\let\if@newlist\@@if@newlist \global \@colht \textheight \stepcounter{page}% \let\firstmark\botmark } % %\plEndIncludeInRelease %\plIncludeInRelease{2017/04/08}{\@outputpage} % {Reset language for hyphenation}% %\def\@outputpage{% %\begingroup % the \endgroup is put in by \aftergroup % \iftdir % \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@ % \fi % \let \protect \noexpand % \language\document@default@language % \@resetactivechars % \global\let\@@if@newlist\if@newlist % \global\@newlistfalse % \@parboxrestore % \shipout\vbox{\yoko % \set@typeset@protect % \aftergroup\endgroup % \aftergroup\set@typeset@protect % \if@specialpage % \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% % \fi % \if@twoside % \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot % \iftdir\let\@themargin\evensidemargin % \else\let\@themargin\oddsidemargin\fi % \else \let\@thehead\@evenhead % \let\@thefoot\@evenfoot % \iftdir\let\@themargin\oddsidemargin % \else\let\@themargin\evensidemargin\fi % \fi\fi % \@@topmargin\topmargin % \iftombow % \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax % \@@paperheight\paperheight \advance\@@paperheight 16mm\relax % \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax % \fi % \reset@font % \normalsize % \normalsfcodes % \let\label\@gobble % \let\index\@gobble % \let\glossary\@gobble % \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ % \@begindvi % \@outputtombow % \vskip \@@topmargin % \moveright\@themargin\vbox{% % \setbox\@tempboxa \vbox to\headheight{% % \vfil % \color@hbox % \normalcolor % \hb@xt@\textwidth{\@thehead}% % \color@endbox % }% %% 22 Feb 87 % \dp\@tempboxa \z@ % \box\@tempboxa % \vskip \headsep % \box\@outputbox % \baselineskip \footskip % \color@hbox % \normalcolor % \hb@xt@\textwidth{\@thefoot}% % \color@endbox % }% % }% % \global\let\if@newlist\@@if@newlist % \global \@colht \textheight % \stepcounter{page}% % \let\firstmark\botmark %} %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@outputpage} % {ASCII Corporation original}% %\def\@outputpage{% %\begingroup % the \endgroup is put in by \aftergroup % \iftdir % \dimen\z@\textwidth \textwidth\textheight \textheight\dimen\z@ % \fi % \let \protect \noexpand % \@resetactivechars % \global\let\@@if@newlist\if@newlist % \global\@newlistfalse % \@parboxrestore % \shipout\vbox{\yoko % \set@typeset@protect % \aftergroup\endgroup % \aftergroup\set@typeset@protect % \if@specialpage % \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% % \fi % \if@twoside % \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot % \iftdir\let\@themargin\evensidemargin % \else\let\@themargin\oddsidemargin\fi % \else \let\@thehead\@evenhead % \let\@thefoot\@evenfoot % \iftdir\let\@themargin\oddsidemargin % \else\let\@themargin\evensidemargin\fi % \fi\fi % \@@topmargin\topmargin % \iftombow % \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax % \@@paperheight\paperheight \advance\@@paperheight 16mm\relax % \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax % \fi % \reset@font % \normalsize % \normalsfcodes % \let\label\@gobble % \let\index\@gobble % \let\glossary\@gobble % \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ % \@begindvi % \@outputtombow % \vskip \@@topmargin % \moveright\@themargin\vbox{% % \setbox\@tempboxa \vbox to\headheight{% % \vfil % \color@hbox % \normalcolor % \hb@xt@\textwidth{\@thehead}% % \color@endbox % }% %% 22 Feb 87 % \dp\@tempboxa \z@ % \box\@tempboxa % \vskip \headsep % \box\@outputbox % \baselineskip \footskip % \color@hbox % \normalcolor % \hb@xt@\textwidth{\@thefoot}% % \color@endbox % }% % }% % \global\let\if@newlist\@@if@newlist % \global \@colht \textheight % \stepcounter{page}% % \let\firstmark\botmark %} %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\AtBeginDvi} % \LaTeXe{}のバージョンが2020-02-02までの場合: % |\AtBeginDvi|が「|\unvbox|してから再び|\vbox|する」という動作のため、 % 再定義が必要です。 % \begin{quote} % p\LaTeX{}の出力ルーチンの|\@outputpage|では、|\shipout|するvboxの中身に % |\yoko|を指定しています。このため、|\AtBeginDocument{\AtBeginDvi{}}|という % コードを書くと\texttt{Incompatible direction list can't be unboxed.}という % エラーが出てしまいます。 % % そこで、コミュニティ版p\LaTeX{}では「|\shipout|で|\yoko|が指定されている」 % ことを根拠として % \begin{center} % |\@begindvibox|は(空でない限り)常に横組でなければならない % \end{center} % と仮定します。この仮定に従い、|\AtBeginDvi|を再定義します。 % \end{quote} % \changes{v1.2f}{2016/06/30}{\cs{@begindvibox}を常に横組に} % \changes{v1.3c}{2019/09/16}{Make \cs{AtBeginDvi} robust % (sync with ltoutput.dtx 2019/08/27 v1.4e)} % % \LaTeXe~2020-10-01以降:|\AtBeginDvi|はフックにどんどんコードを追加して % いくだけですので、再定義は不要です。一方、代わりに % |\__shipout_execute_cont:|を再定義する必要があります。 % \changes{v1.3f}{2020/09/26}{\cs{AtBeginDvi}を再定義しない % (checked ltshipout.dtx 2020/09/21 v1.0c)} % \begin{macrocode} % %\plIncludeInRelease{2020/10/01}{\AtBeginDvi} % {Adapt to new shipout code}% %<*plcore|platexrelease> \chardef\pltx@AtBeginDvi@untouched\z@ % for LaTeX2e 2020-10-01 or later \ifdefined\ExplSyntaxOn %--- expl3 available BEGIN \ExplSyntaxOn \if_cs_exist:N \__shipout_add_firstpage_material:Nn \chardef\pltx@AtBeginDvi@untouched\@ne %\DeclareRobustCommand \AtBeginDvi % {\__shipout_add_firstpage_material:Nn \AtBeginDvi} \fi: \ExplSyntaxOff \fi %--- expl3 available END % for LaTeX2e 2020-02-02 PL5 or older \ifnum\pltx@AtBeginDvi@untouched>\z@\else \DeclareRobustCommand \AtBeginDvi [1]{% \global \setbox \@begindvibox \vbox{\yoko \unvbox \@begindvibox #1}}% \fi % done \let\pltx@AtBeginDvi@untouched\@undefined % %\plEndIncludeInRelease %\plIncludeInRelease{2019/10/01}{\AtBeginDvi} % {Make robust}% %\DeclareRobustCommand \AtBeginDvi [1]{% % \global \setbox \@begindvibox % \vbox{\yoko \unvbox \@begindvibox #1}} %\plEndIncludeInRelease %\plIncludeInRelease{2016/07/01}{\AtBeginDvi} % {Fix for incompatible direction}% %\def \AtBeginDvi #1{% % \global \setbox \@begindvibox % \vbox{\yoko \unvbox \@begindvibox #1}} %\expandafter \let \csname AtBeginDvi \endcsname \@undefined %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\AtBeginDvi} % {LaTeX2e original}% %\def \AtBeginDvi #1{% % \global \setbox \@begindvibox % \vbox{\unvbox \@begindvibox #1}} %\expandafter \let \csname AtBeginDvi \endcsname \@undefined %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\__shipout_execute_cont:} % \LaTeXe~2020-10-01以降:\file{ltshipout.dtx}がベースです。 % ただし、縦組クラスでも通るようにするため、以下の方法を採ります。 % \begin{itemize} % \item |\shipout|実行時の組方向が横組なら、|\yoko|を実行せずそのまま。 % \item 横組でない場合は|\__shipout_execute_cont:|を横組ボックス\\ % |\l__platex_shipout_dummy_box|で括って実行する(※)。 % \item |\l_shipout_box|が横組でない場合は事前に横組化する。 % \end{itemize} % 注意:上記※の実装により、縦組クラスでは % 「|\AtBeginShipout|の中身が外部垂直モードで実行されること」を % 想定した使用(例:platex-tools issue \#15)はサポートされません。 % ^^A 従来の\file{pxatbegshi}パッケージにも同様の制約がありました。 % ^^A 本当は、処理終了時に|\box\l__platex_shipout_dummy_box|して % ^^A メイン垂直リストに中身を戻したいのですが、 % ^^A なぜか無限ループが起きるため実行していません。 % \changes{v1.3f}{2020/09/26}{\cs{\_\_shipout\_execute\_cont:}を再定義 % (checked ltshipout.dtx 2020/09/21 v1.0c)} % \changes{v1.3g}{2020/09/28}{\file{plexpl3}で定義した命令を使用} % \changes{v1.3j}{2021/06/03}{巻戻しコードのエラー修正} % \begin{macrocode} % %\plIncludeInRelease{2020/10/01}{\__shipout_execute_cont:} % {Adapt to new shipout code}% %<*plcore|platexrelease> \ifdefined\ExplSyntaxOn %--- expl3 available BEGIN \ExplSyntaxOn \cs_if_exist:NT \__shipout_execute_cont: { %--- IF LEVEL 1 BEGIN \cs_if_exist:NF \__platex_original_shipout_execute_cont: { \cs_new_eq:NN \__platex_original_shipout_execute_cont: \__shipout_execute_cont: } \cs_if_exist:NF \l__platex_shipout_dummy_box { \box_new:N \l__platex_shipout_dummy_box } \cs_set:Npn \__shipout_execute_cont: { % if \l_shipout_box is not a \yoko-box (= horizontal writing), % then make it a \yoko-box behorehand. \platex_if_box_yoko:NF \l_shipout_box { \vbox_set:Nn \l_shipout_box { \platex_direction_yoko: \box_use:N \l_shipout_box } } % if the current direction is not \yoko, % then enclose \__shipout_execute_cont: with % a dummy \yoko-box named \l__platex_shipout_dummy_box. \platex_if_direction_yoko:TF { \__platex_original_shipout_execute_cont: }{ \vbox_set:Nn \l__platex_shipout_dummy_box { \platex_direction_yoko: \__platex_original_shipout_execute_cont: } % [Limitation] the code above may discard some contents, % so we'd like to put it back by \box\l__platex_shipout_dummy_box. % however, an infinite loop occurs if we uncomment the line below % so we can't. %\box_use:N \l__platex_shipout_dummy_box } } } %--- IF LEVEL 1 END % \end{macrocode} % \end{macro} % % \begin{macro}{\__shipout_execute_nohooks_cont:} % \LaTeXe~2021-06-01では、同様の処理が|\__shipout_execute_nohooks_cont:|にも % 必要なので、それを行います。 % \changes{v1.3h}{2021/03/14}{\LaTeXe~2021-06-01では % \cs{\_\_shipout\_execute\_nohooks\_cont:}が追加された} % \changes{v1.3j}{2021/06/03}{巻戻しコードのエラー修正} % \begin{macrocode} \cs_if_exist:NT \__shipout_execute_nohooks_cont: { %--- IF LEVEL 1 BEGIN \cs_if_exist:NF \__platex_original_shipout_execute_nohooks_cont: { \cs_new_eq:NN \__platex_original_shipout_execute_nohooks_cont: \__shipout_execute_nohooks_cont: } \cs_set:Npn \__shipout_execute_nohooks_cont: { \platex_if_box_yoko:NF \l__shipout_raw_box { \vbox_set:Nn \l__shipout_raw_box { \platex_direction_yoko: \box_use:N \l__shipout_raw_box } } \platex_if_direction_yoko:TF { \__platex_original_shipout_execute_nohooks_cont: }{ \vbox_set:Nn \l__platex_shipout_dummy_box { \platex_direction_yoko: \__platex_original_shipout_execute_nohooks_cont: } } } } %--- IF LEVEL 1 END \ExplSyntaxOff \fi %--- expl3 available END % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\__shipout_execute_cont:} % {LaTeX2e original}% %% do nothing %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % % \subsection{脚注マクロ} % 脚注を組み立てる部分のマクロを再定義します。 % 主な修正点は、縦組モードでの動作の追加です。 % % これらのマクロは、\file{ltfloat.dtx}で定義されていたものです。 % % \begin{macro}{\thempfn} % 本文で使われる脚注記号です。 % % |\@footnotemark|で縦横の判断をするようにしたため、削除。 % % \changes{v1.0a}{1995/04/12}{Removed \texttt{\protect\bslash thempfn}} % \begin{macrocode} %\def\thempfn{% % \ifydir\thefootnote\else\hbox{\yoko\thefootnote}\fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\thempfootnote} % minipage環境で使われる脚注記号です。 % % \changes{v1.0a}{1995/04/12}{Removed \texttt{\protect\bslash thempfootnote}} % \begin{macrocode} %\def\thempfootnote{% % \ifydir\alph{mpfootnote}\else\hbox{\yoko\alph{mpfootnote}}\fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\@makefnmark} % 脚注記号を作成するマクロです。 % % \changes{v1.0a}{1995/04/12}{縦組でも上付き数字を使うように修正} % \changes{v1.1b}{1996/01/26}{脚注マークの後ろに余計なスペースが入るのを修正} % \changes{v1.1g}{1997/02/14}{縦組時に脚注マークの書体が正しくないのを修正} % \changes{v1.2b}{2016/01/26}{2013年以降のp\TeX\ (r28720)で脚注番号の前後の和文文字 % との間にxkanjiskipが入ってしまう問題に対応} % \begin{macrocode} % %\plIncludeInRelease{2016/04/17}{\@makefnmark} % {Remove extra \xkanjiskip}% %<*plcore|platexrelease> \renewcommand\@makefnmark{% \ifydir \hbox{}\hbox{\@textsuperscript{\normalfont\@thefnmark}}\hbox{}% \else\hbox{\yoko\@textsuperscript{\normalfont\@thefnmark}}\fi} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@makefnmark} % {ASCII Corporation original}% %\renewcommand\@makefnmark{\hbox{% % \ifydir \@textsuperscript{\normalfont\@thefnmark}% % \else\hbox{\yoko\@textsuperscript{\normalfont\@thefnmark}}\fi}} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\pltx@foot@penalty} % 開き括弧類の直後に|\footnotetext|が続いた場合、|\footnotetext|の前での改行は % 望ましくありません。このような場合に対処するために、|\pltx@foot@penalty|という % カウンタを用意しました。|\footnotetext|の最初で「直前のペナルティ値」 % としてこのカウンタが初期化されます。 % |\footnotemark|,~|\footnote|では使わないので0に設定しています。 % \changes{v1.2g}{2016/08/25}{カウンタ\cs{pltx@foot@penalty}を追加} % \begin{macrocode} %\plIncludeInRelease{2016/09/03}{\pltx@foot@penalty} % {Add new counter \pltx@foot@penalty}% %<*plcore|platexrelease> \ifx\@undefined\pltx@foot@penalty \newcount\pltx@foot@penalty \fi \pltx@foot@penalty\z@ % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\pltx@foot@penalty} % {Add new counter \pltx@foot@penalty}% %\let\pltx@foot@penalty\@undefined %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\footnotemark} % \begin{macro}{\footnote} % また、合印の前の文字と合印の間は原則ベタ組です(但し、JIS~X~4051には例外有り)。 % そのため、合印を出力する|\footnotemark|,~|\footnote|の最初で|\inhibitglue|を % 実行しておくことにします(|\@makefnmark|の中に置いても効力がありません)。 % \changes{v1.2g}{2016/08/25}{合印の前の文字と合印の間をベタ組に} % \begin{macrocode} %\plIncludeInRelease{2016/09/03}{\footnote} % {Append \inhibitglue in \footnotemark}% %<*plcore|platexrelease> % \end{macrocode} % \begin{macrocode} \def\footnote{\inhibitglue \@ifnextchar[\@xfootnote{\stepcounter\@mpfn \protected@xdef\@thefnmark{\thempfn}% \@footnotemark\@footnotetext}} \def\footnotemark{\inhibitglue \@ifnextchar[\@xfootnotemark {\stepcounter{footnote}% \protected@xdef\@thefnmark{\thefootnote}% \@footnotemark}} % \end{macrocode} % \begin{macrocode} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\footnote} % {LaTeX2e original}% %\def\footnote{\@ifnextchar[\@xfootnote{\stepcounter\@mpfn % \protected@xdef\@thefnmark{\thempfn}% % \@footnotemark\@footnotetext}} %\def\footnotemark{% % \@ifnextchar[\@xfootnotemark % {\stepcounter{footnote}% % \protected@xdef\@thefnmark{\thefootnote}% % \@footnotemark}} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\footnotetext} % |\footnotetext|の直前のペナルティ値を保持します。 % \changes{v1.2g}{2016/08/25}{閉じ括弧類の直後に\cs{footnotetext}が続く % 場合に改行が起きることがある問題に対処} % \begin{macrocode} %\plIncludeInRelease{2016/09/03}{\footnotetext} % {Preserve penalty before \footnotetext}% %<*plcore|platexrelease> % \end{macrocode} % \begin{macrocode} \def\footnotetext{% \ifhmode\pltx@foot@penalty\lastpenalty\unpenalty\fi% \@ifnextchar [\@xfootnotenext {\protected@xdef\@thefnmark{\thempfn}% \@footnotetext}} % \end{macrocode} % \begin{macrocode} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\footnotetext} % {LaTeX2e original}% %\def\footnotetext{% % \@ifnextchar [\@xfootnotenext % {\protected@xdef\@thefnmark{\thempfn}% % \@footnotetext}} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\@footnotetext} % インサートボックス|\footins|に脚注のテキストを入れます。 % コミュニティ版p\LaTeX{}では|\footnotetext|,~|\footnote|の直後で % 改行を可能にします。jsclassesではこの変更に加え、脚注で|\verb|が % 使えるように再定義されます。 % % \changes{v1.0a}{1995/04/07}{組方向の判定をボックスの外でするようにした} % \changes{v1.3h}{2021/03/14}{\LaTeXe~2021-06-01では\cs{par}が入る % (sync with ltfloat.dtx 2021/02/10 v1.2e)} % \begin{macrocode} %\plIncludeInRelease{2021/06/01}{\@footnotetext} % {Adapt to ltfloat.dtx (2021-03-03 v1.2f)}% %<*plcore|platexrelease> % \end{macrocode} % \begin{macrocode} \long\def\@footnotetext#1{% \ifydir\def\@tempa{\yoko}\else\def\@tempa{\tate}\fi \insert\footins{\@tempa% \reset@font\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty \@MM \hsize\columnwidth \@parboxrestore \protected@edef\@currentlabel{% \csname p@footnote\endcsname\@thefnmark }% \color@begingroup \@makefntext{% \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% \par % \end{macrocode} % % p\TeX{}では|\insert|の直後に和文文字が来た場合、そこでの改行は許されない % という挙動になっています。このため、従来は脚注番号(合印)の直後の改行が % 抑制されていました。しかし、|\hbox|の直後に和文文字が来た場合は、そこで % の改行は許されますから、最後に|\null|を追加します。 % また、|\pltx@foot@penalty|の値が0ではなかった場合、 % 脚注の前にペナルティがあったということですから、復活させておきます。 % \changes{v1.2g}{2016/08/25}{脚注の合印直後での改行が禁止されてしまう % 問題に対処} % \changes{v1.2i}{2016/09/08}{v1.2gの修正で入れた\cs{null}がまずかったので % 水平モードのときだけ発行することにした(Issue 23)} % \begin{macrocode} \color@endgroup}\ifhmode\null\fi \ifnum\pltx@foot@penalty=\z@\else \penalty\pltx@foot@penalty \pltx@foot@penalty\z@ \fi} % \end{macrocode} % \begin{macrocode} % %\plEndIncludeInRelease %\plIncludeInRelease{2016/09/08}{\@footnotetext} % {Allow break after \footnote (more fix)}% %\long\def\@footnotetext#1{% % \ifydir\def\@tempa{\yoko}\else\def\@tempa{\tate}\fi % \insert\footins{\@tempa% % \reset@font\footnotesize % \interlinepenalty\interfootnotelinepenalty % \splittopskip\footnotesep % \splitmaxdepth \dp\strutbox \floatingpenalty \@MM % \hsize\columnwidth \@parboxrestore % \protected@edef\@currentlabel{% % \csname p@footnote\endcsname\@thefnmark % }% % \color@begingroup % \@makefntext{% % \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% % \color@endgroup}\ifhmode\null\fi % \ifnum\pltx@foot@penalty=\z@\else % \penalty\pltx@foot@penalty % \pltx@foot@penalty\z@ % \fi} %\plEndIncludeInRelease %\plIncludeInRelease{2016/09/03}{\@footnotetext} % {Allow break after \footnote}% %\long\def\@footnotetext#1{% % \ifydir\def\@tempa{\yoko}\else\def\@tempa{\tate}\fi % \insert\footins{\@tempa% % \reset@font\footnotesize % \interlinepenalty\interfootnotelinepenalty % \splittopskip\footnotesep % \splitmaxdepth \dp\strutbox \floatingpenalty \@MM % \hsize\columnwidth \@parboxrestore % \protected@edef\@currentlabel{% % \csname p@footnote\endcsname\@thefnmark % }% % \color@begingroup % \@makefntext{% % \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% % \color@endgroup}\null % \ifnum\pltx@foot@penalty=\z@\else % \penalty\pltx@foot@penalty % \pltx@foot@penalty\z@ % \fi} %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@footnotetext} % {ASCII Corporation original}% %\long\def\@footnotetext#1{% % \ifydir\def\@tempa{\yoko}\else\def\@tempa{\tate}\fi % \insert\footins{\@tempa% % \reset@font\footnotesize % \interlinepenalty\interfootnotelinepenalty % \splittopskip\footnotesep % \splitmaxdepth \dp\strutbox \floatingpenalty \@MM % \hsize\columnwidth \@parboxrestore % \protected@edef\@currentlabel{% % \csname p@footnote\endcsname\@thefnmark % }% % \color@begingroup % \@makefntext{% % \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% % \color@endgroup}} %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\@footnotemark} % \changes{v1.0a}{1995/04/12}{脚注記号の出力位置の調整} % \changes{v1.1g}{1997/02/14}{縦組時の位置調整を2\cs{cht}から.9zhに変更} % 脚注記号を出力します。 % \begin{macrocode} \def\@footnotemark{\leavevmode \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi \ifydir\@makefnmark \else\hbox to\z@{\hskip-.25zw\raise.9zh\@makefnmark\hss}\fi \ifhmode\spacefactor\@x@sf\fi\relax} % \end{macrocode} % \end{macro} % % % \subsection{相互参照} % % \begin{macro}{\@setref} % \changes{v1.1c}{1995/09/07}{change \cs{null} to \cs{relax} in \cs{@setref}.} % \changes{v1.2k}{2017/02/20}{目次で\cs{ref}を使った場合に後ろの空白が消える % 現象に対処するため、\cs{relax}のあとに\{\}を追加} % |\ref|コマンドや|\pageref|コマンドで参照したとき、これらのコマンドに % よって出力された番号と続く2バイト文字との間に|\xkanjiskip|が入りません。 % これは、|\null|が|\hbox{}|と定義されているためです。 % そこで|\null|を取り除きます。 % このコマンドは、\file{ltxref.dtx}で定義されているものです。 % % しかし、単に|\null|を|\relax|に置き換えるだけでは、|\section|のような % 「動く引数」で|\ref|などを使った場合に、目次で後ろの空白が消えてしまいます。 % そこで、|\relax|のあとに|{}|を追加しました。従来も|\protect\ref|のように使えば % 問題ありませんでしたが、\LaTeX{}では展開されても問題が起きないrobustな実装に % なっていますので、これに従います。 % % さらに、例えば``see Appendix A.''のような記述が文末にあり、かつ % ``A''を相互参照で取得した場合のスペースファクターを補正するため、 % |\spacefactor\@m{}|に修正しました。これで、``A.''の後のスペースが % 文末として扱われます。 % 「\LaTeXe{}マクロ\&クラス プログラミング実践解説」のコードを参考に % しましたが、数式モード内でもエラーにならないように改良しています。 % \changes{v1.2s}{2017/09/27}{相互参照のスペースファクターを補正} % \changes{v1.2t}{2017/10/31}{v1.2sの変更に伴い、\cs{ref}が数式モードで % エラーになっていたのを修正} % \changes{v1.2u}{2017/11/04}{emathの\cs{marusuuref}対策} % \begin{macrocode} % %\plIncludeInRelease{2017/10/28}{\@setref} % {Space factor after \ref}% %<*plcore|platexrelease> \def\@setref#1#2#3{% \ifx#1\relax \protect\G@refundefinedtrue \nfss@text{\reset@font\bfseries ??}% \@latex@warning{Reference `#3' on page \thepage \space undefined}% \else \expandafter#2#1\protect\@setref@{}% change \null to \protect\@setref@{} \fi} \def\@setref@{\ifhmode\spacefactor\@m\fi} % %\plEndIncludeInRelease %\plIncludeInRelease{2017/04/08}{\@setref} % {Spacing after \ref in moving arguments}% %\def\@setref#1#2#3{% % \ifx#1\relax % \protect\G@refundefinedtrue % \nfss@text{\reset@font\bfseries ??}% % \@latex@warning{Reference `#3' on page \thepage \space % undefined}% % \else % \expandafter#2#1\relax{}% change \null to \relax{} % \fi} %\let\@setref@\@undefined %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@setref} % {ASCII Corporation original}% %\def\@setref#1#2#3{% % \ifx#1\relax % \protect\G@refundefinedtrue % \nfss@text{\reset@font\bfseries ??}% % \@latex@warning{Reference `#3' on page \thepage \space % undefined}% % \else % \expandafter#2#1\relax% change \null to \relax % \fi} %\let\@setref@\@undefined %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % % \subsection{疑似タイプ入力} % % \begin{macro}{\verb} % \changes{v1.1b}{1995/04/05}{互換モードのときは、pl209.defの定義を使う} % \changes{v1.1g}{1997/01/16} % {\cs{verb}コマンドを\LaTeX\ \texttt{!<1996/06/01!>}に合わせて修正} % \LaTeX{}の|\verb|コマンドでは、数式モードでないときは、 % |\leavevmode|で水平モードに入ったあと、|\null|を出力しています。 % マクロ|\null|は|\hbox{}|として定義されていますので、 % ここには和欧文間スペース(|\xkanjiskip|)が入りません。 % % しかし、単に|\null|を除いてしまうと、今度は|\verb+ abc+|のように % |\verb|の冒頭に半角空白がある場合にこれが消えてしまいます(TeX.SX 170245)。 % そこで、p\LaTeX{}では|\null|の代わりに % \begin{enumerate} % \item 和欧文間スペースの挿入処理は透過する % \item 行分割時に消える(discardable)ノードではない % \end{enumerate} % の両条件を満たすノードを挿入します。ここでは|\vadjust{}|としました。 % % このマクロは、\file{ltmiscen.dtx}で定義されています。 % \changes{v1.2s}{2017/09/27}{\cs{verb}の冒頭の半角空白を保持} % \begin{macrocode} % %\plIncludeInRelease{2017/10/28}{\verb} % {Preserve beginning space characters}% %<*plcore|platexrelease> \if@compatibility\else \def\verb{\relax\ifmmode\hbox\else\leavevmode\vadjust{}\fi \bgroup \verb@eol@error \let\do\@makeother \dospecials \verbatim@font\@noligs % \end{macrocode} % \LaTeXe\ 2017-04-15に追随して、|\verb|の途中でハイフネーションが起きない % ように|\language|を設定します(参考:latex2e svn r1405)。 % \changes{v1.2m}{2017/03/19}{\cs{verb}の途中でハイフネーションが起きない % ように\cs{language}を設定(sync with ltmiscen.dtx 2017/03/09 v1.1m)} % \begin{macrocode} \language\l@nohyphenation \@ifstar\@sverb\@verb} \fi % %\plEndIncludeInRelease %\plIncludeInRelease{2017/04/08}{\verb} % {Disable hyphenation in verb}% %\if@compatibility\else %\def\verb{\relax\ifmmode\hbox\else\leavevmode\fi % \bgroup % \verb@eol@error \let\do\@makeother \dospecials % \verbatim@font\@noligs % \language\l@nohyphenation % \@ifstar\@sverb\@verb} %\fi %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\verb} % {ASCII Corporation original}% %\if@compatibility\else %\def\verb{\relax\ifmmode\hbox\else\leavevmode\fi % \bgroup % \verb@eol@error \let\do\@makeother \dospecials % \verbatim@font\@noligs % \@ifstar\@sverb\@verb} %\fi %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\do@noligs} % |>|などの一部の文字について、|\xspcode`\>=3|としたときに % |\texttt{>}|では前後に|\xkanjiskip|由来のアキが入るのに、 % |\verb+>+|では後ろにしかアキが入らないという現象に対処します。 % % 元の定義は\file{ltmiscen.dtx}を参照してください。 % p\LaTeX{}では、|\kern\z@|を|\vadjust{}|に置き換えることで % 「合字処理を抑止」かつ「和欧文間スペースの挿入処理は透過」を実現します。 % (Issue \#87) % \changes{v1.3e}{2020/03/05}{合字処理を抑止しつつ\cs{xkanjiskip}は挿入} % \begin{macrocode} % %\plIncludeInRelease{2020/04/12}{\do@noligs} % {Allow \xkanjiskip while avoiding ligature}% %<*plcore|platexrelease> \def\do@noligs#1{% \catcode`#1\active \begingroup \lccode`\~`#1\relax \lowercase{\endgroup\def~{\leavevmode\vadjust{}\char`#1}}} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\do@noligs} % {LaTeX2e original}% %\def\do@noligs#1{% % \catcode`#1\active % \begingroup % \lccode`\~`#1\relax % \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}} %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % % \subsection{tabbing環境} % % \begin{macro}{\@startline} % tabbing環境の行で、中身が始め括弧類などで始まる場合、 % 最初の項目だけJFMグルーが消えない現象に対処します。 % \changes{v1.2s}{2017/09/27}{tabbing環境の行冒頭のJFMグル―を削除} % \begin{macrocode} % %\plIncludeInRelease{2017/10/28}{\@startline} % {Inhibit JFM glue at the beginning}% %<*plcore|platexrelease> \gdef\@startline{% \ifnum \@nxttabmar >\@hightab \@badtab \global\@nxttabmar \@hightab \fi \global\@curtabmar \@nxttabmar \global\@curtab \@curtabmar \global\setbox\@curline \hbox {}% \@startfield \strut\inhibitglue} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@startline} % {LaTeX2e original}% %\gdef\@startline{% % \ifnum \@nxttabmar >\@hightab % \@badtab % \global\@nxttabmar \@hightab % \fi % \global\@curtabmar \@nxttabmar % \global\@curtab \@curtabmar % \global\setbox\@curline \hbox {}% % \@startfield % \strut} %\plEndIncludeInRelease %<*plcore> % \end{macrocode} % \end{macro} % % \begin{macro}{\@stopfield} % \changes{v1.1d}{1996/03/12}{\cs{=}の後ろに和欧文間スペースが入るのを修正} % 相互参照や疑似タイプ入力では、和欧文間スペースが入らないので、|\null|を % 取り除きましたが、|tabbing|環境では、逆に|\null|がないため、 % 和欧文間スペースが入ってしまうので、それを追加します。 % \file{lttab.dtx}で定義されているものです。 % \begin{macrocode} \gdef\@stopfield{\null\color@endgroup\egroup} % \end{macrocode} % \end{macro} % % \subsection{用語集の出力} % \LaTeX{}には、なぜか用語集を出力するためのコマンドがありませんので、 % 追加をします。 % \changes{v1.1e}{1996/02/17}{\cs{printglossary}を追加} % % \begin{macro}{\printglossary} % \cs{printglossary}コマンドは、単に拡張子が\texttt{gls}のファイルを % 読み込むだけです。このファイルの生成には、mendexなどを用います。 % \begin{macrocode} \newcommand\printglossary{\@input@{\jobname.gls}} % \end{macrocode} % \end{macro} % % \subsection{時分を示すカウンタ} % \TeX には、年月日を示す数値を保持しているカウンタとして、それぞれ % |\year|, |\month|, |\day|がプリミティブとして存在します。しかし、 % 時分については、深夜の零時からの経過時間を示す|\time|カウンタしか存在 % していません。そこで、p\LaTeXe{}では、時分を示すためのカウンタ|\hour|と % |\minute|を作成しています。 % % \begin{macro}{\hour} % \begin{macro}{\minute} % 何時か(|\hour|)を得るには、|\time|を60で割った商をそのまま用います。 % 何分か(|\minute|)は、|\hour|に60を掛けた値を|\time|から引いて算出します。 % ここではカウンタを宣言するだけです。実際の計算は、クラスやパッケージの中 % で行なっています。 % \begin{macrocode} \newcount\hour \newcount\minute % \end{macrocode} % \end{macro} % \end{macro} % % \subsection{tabular環境} % \LaTeX{}カーネル(lttab.dtx)の命令群を修正します。 % % \begin{macro}{\@tabclassz} % \LaTeX{}カーネルは、アラインメント文字|&|の周囲に半角空白を書いたかどうかに % かかわらず余分なスペースを出力しないように、|\ignorespaces|と|\unskip|を % 発行しています(lttab.dtx)。しかし、これだけではJFMグルーが消えずに残って % しまうので、p\LaTeX{}では追加の対処を入れます。 % % まず、|l|, |c|, |r|の場合です。 % 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}があれば利用するようにした} % \changes{v1.3b}{2019/02/08}{中央揃えのセルでの\cs{unskip}対策 % (sync with lttab.dtx 2018/12/30 v1.1p)} % ^^A なぜか v1.3b の変更は本家 latexrelease に含まれないのでそれに合わせた % \begin{macrocode} % %\plIncludeInRelease{2018/03/09}{\@tabclassz} % {Inhibit JFM glue in tabular cells (better)}% %<*plcore|platexrelease> \ifx\removejfmglue\@undefined \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}}} \else \def\@tabclassz{% \ifcase\@lastchclass \@acolampacol \or \@ampacol \or \or \or \@addamp \or \@acolampacol \or \@firstampfalse\@acol \fi \edef\@preamble{% \@preamble{% \ifcase\@chnum \hfil\hskip1sp\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 (wrong)}% %\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\unskip\hfil % c % \or % \hskip1sp\inhibitglue % \ignorespaces\@sharp\unskip\unskip\hfil % l % \or % \hfil\hskip1sp\inhibitglue % \ignorespaces\@sharp\unskip\unskip % r % \fi}}} %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@tabclassz} % {LaTeX2e original}% %\def\@tabclassz{% % \ifcase\@lastchclass % \@acolampacol % \or % \@ampacol % \or % \or % \or % \@addamp % \or % \@acolampacol % \or % \@firstampfalse\@acol % \fi % \edef\@preamble{% % \@preamble{% % \ifcase\@chnum % \hfil\ignorespaces\@sharp\unskip\hfil % \or % \hskip1sp\ignorespaces\@sharp\unskip\hfil % \or % \hfil\hskip1sp\ignorespaces\@sharp\unskip % \fi}}} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\@classv} % 次に、|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{2018/03/09}{\@classv} % {Inhibit JFM glue in tabular cells (better)}% %<*plcore|platexrelease> \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} % {LaTeX2e original}% %\def\@classv{\@addtopreamble{\@startpbox{\@nextchar}\ignorespaces %\@sharp\@endpbox}} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\pltx@next@inhibitglue} % 水平モードであればそのまま|\inhibitglue|を発行し、それ以外であれば % |\everypar|内に|\inhibitglue|を仕込みます。 % \changes{v1.2x}{2018/03/01}{\cs{everypar}に\cs{inhibitglue}を仕込むマクロ追加} % \changes{v1.2y}{2018/03/12}{\cs{inhibitglue}を\cs{everypar}の末尾に移動} % \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{% \everypar{\unexpanded\expandafter{\the\everypar}}% \unexpanded\expandafter{\the\everypar}\inhibitglue}}% \@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{}では % |\xkanjiskip|由来のアキが前後に入ってしまうことがありました。 % そうした命令にパッチをあてます。なお、既に出てきた|\footnote|の内部命令 % (|\@makefnmark|)には同様のパッチがもうあててあります。 % % \begin{macro}{\@tabular} % tabular環境の内部命令です。もとは\file{lttab.dtx}で定義されています。 % \changes{v1.2c}{2016/02/28}{1.2bと同様の修正をtabular環境にも行った} % \begin{macrocode} %\plIncludeInRelease{2016/04/17}{\@tabular} % {Remove extra \xkanjiskip}% %<*plcore|platexrelease> \def\@tabular{\leavevmode \null\hbox \bgroup $\let\@acol\@tabacol \let\@classz\@tabclassz \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@tabular} % {LaTeX2e original}% %\def\@tabular{\leavevmode \hbox \bgroup $\let\@acol\@tabacol % \let\@classz\@tabclassz % \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\endtabular} % \begin{macro}{\endtabular*} % \begin{macrocode} %\plIncludeInRelease{2016/04/17}{\endtabular} % {Remove extra \xkanjiskip}% %<*plcore|platexrelease> \def\endtabular{\crcr\egroup\egroup $\egroup\null} \expandafter \let \csname endtabular*\endcsname = \endtabular % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\endtabular} % {LaTeX2e original}% %\def\endtabular{\crcr\egroup\egroup $\egroup} %\expandafter \let \csname endtabular*\endcsname = \endtabular %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\@iiiparbox} % |\parbox|の内部命令です。もとは\file{ltboxes.dtx}で定義されています。 % \changes{v1.2c}{2016/02/28}{1.2bと同様の修正を\cs{parbox}命令にも行った} % \begin{macrocode} %\plIncludeInRelease{2016/04/17}{\@iiiparbox} % {Remove extra \xkanjiskip}% %<*plcore|platexrelease> \let\@parboxto\@empty \long\def\@iiiparbox#1#2[#3]#4#5{% \leavevmode \@pboxswfalse \setlength\@tempdima{#4}% \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% \ifx\relax#2\else \setlength\@tempdimb{#2}% \edef\@parboxto{to\the\@tempdimb}% \fi \if#1b\vbox \else\if #1t\vtop \else\ifmmode\vcenter \else\@pboxswtrue\null$\vcenter% !!! \fi\fi\fi \@parboxto{\let\hss\vss\let\unhbox\unvbox \csname bm@#3\endcsname}% \if@pboxsw \m@th$\null\fi% !!! \@end@tempboxa} % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\@iiiparbox} % {LaTeX2e original}% %\let\@parboxto\@empty %\long\def\@iiiparbox#1#2[#3]#4#5{% % \leavevmode % \@pboxswfalse % \setlength\@tempdima{#4}% % \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% % \ifx\relax#2\else % \setlength\@tempdimb{#2}% % \edef\@parboxto{to\the\@tempdimb}% % \fi % \if#1b\vbox % \else\if #1t\vtop % \else\ifmmode\vcenter % \else\@pboxswtrue $\vcenter % \fi\fi\fi % \@parboxto{\let\hss\vss\let\unhbox\unvbox % \csname bm@#3\endcsname}% % \if@pboxsw \m@th$\fi % \@end@tempboxa} %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \begin{macro}{\underline} % 下線を引く命令です。もとは\file{ltboxes.dtx}で定義されています。 % \changes{v1.2c}{2016/02/28}{1.2bと同様の修正を\cs{underline}命令にも行った} % \changes{v1.3c}{2019/09/16}{Make \cs{underline} robust % (sync with ltboxes.dtx 2019/08/27 v1.3b)} % \begin{macrocode} %\plIncludeInRelease{2019/10/01}{\underline} % {Make robust}% %<*plcore|platexrelease> \DeclareRobustCommand\underline[1]{% \relax \ifmmode\@@underline{#1}% \else \leavevmode\null$\@@underline{\hbox{#1}}\m@th$\null\relax\fi} % %\plEndIncludeInRelease %\plIncludeInRelease{2016/04/17}{\underline} % {Remove extra \xkanjiskip}% %\def\underline#1{% % \relax % \ifmmode\@@underline{#1}% % \else \leavevmode\null$\@@underline{\hbox{#1}}\m@th$\null\relax\fi} %\expandafter \let \csname underline \endcsname \@undefined %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\underline} % {LaTeX2e original}% %\def\underline#1{% % \relax % \ifmmode\@@underline{#1}% % \else $\@@underline{\hbox{#1}}\m@th$\relax\fi} %\expandafter \let \csname underline \endcsname \@undefined %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % % \section{e-p\TeX{}でのFAM256パッチの利用} % % \begin{macro}{\e@alloc@chardef} % \begin{macro}{\e@alloc@top} % \LaTeXe\ 2015/01/01以降、拡張レジスタがあれば利用するようになっています % ので、e-p\TeX{}の拡張レジスタを利用できるように設定します。 % \changes{v1.2j}{2016/11/09}{FAM256パッチ適用e-p\TeX{}に対応} % \changes{v1.3d}{2019/10/19}{判定順序を修正;extended modeかつ % FAM256拡張ありの場合に限りレジスタ数が65536個のため。} % \begin{macrocode} %\plIncludeInRelease{2019/10/01}% % {\e@alloc@chardef}{Extended Allocation (FAM256)}% %<*plcore|platexrelease> % \end{macrocode} % \begin{macrocode} \ifx\widowpenalties\@undefined % \end{macrocode} % オリジナルの\TeX{}の場合(拡張なしのアスキーp\TeX{}の場合)。 % \begin{macrocode} \mathchardef\e@alloc@top=255 \let\e@alloc@chardef\chardef \else \ifx\omathchar\@undefined % \end{macrocode} % e-\TeX{}拡張で$2^{15}$個のレジスタが利用できます。 % ^^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 また|\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 \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} \omathchardef\e@alloc@top=65535 \let\e@alloc@chardef\omathchardef \fi \fi % \end{macrocode} % \begin{macrocode} % %\plEndIncludeInRelease %\plIncludeInRelease{2018/03/09}% % {\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 % \omathchardef\e@alloc@top=65535 % \let\e@alloc@chardef\omathchardef %\fi %\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}{LaTeX2e original}% %\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 %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}% % {\e@alloc@chardef}{LaTeX2e original}% %\let\e@alloc@top\@undefined %\let\e@alloc@chardef\@undefined %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\float@count} % |\newcount|や|\newdimen|で使われます。 % \changes{v1.3d}{2019/10/19}{コピー忘れ} % \begin{macrocode} %<*plcore|platexrelease> \let\float@count\e@alloc@top % % \end{macrocode} % \end{macro} % % \begin{macro}{\e@mathgroup@top} % 2015/01/01以降の\LaTeXe{}カーネルは、Xe\TeX{}とLua\TeX{}に対して数式famの % 上限を16から256に増やしています(|\Umathcode| で判定)。 % FAM256パッチが適用されたe-p\TeX{}でも同様に上限を16から256に増やします。 % これで %\begin{verbatim} % ! LaTeX Error: Too many math alphabets used in version normal. %\end{verbatim} % が出にくくなるはずです。 % \changes{v1.2j}{2016/11/09}{FAM256パッチ適用e-p\TeX{}に対応} % \begin{macrocode} %\plIncludeInRelease{2016/11/29}% % {\e@mathgroup@top}{Extended Allocation (FAM256)}% %<*plcore|platexrelease> % \end{macrocode} % \begin{macrocode} \ifx\omathchar\@undefined \chardef\e@mathgroup@top=16 % LaTeX2e kernel standard \else \mathchardef\e@mathgroup@top=256 % for e-pTeX FAM256 patched \fi % \end{macrocode} % \begin{macrocode} % %\plEndIncludeInRelease %\plIncludeInRelease{2015/01/01}% % {\e@mathgroup@top}{LaTeX2e original}% %\chardef\e@mathgroup@top=16 %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}% % {\e@mathgroup@top}{LaTeX2e original}% %\let\e@mathgroup@top\@undefined %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % % \section{\LaTeXe{}とp\LaTeXe{}の更新タイミングずれ対策} % \changes{v1.3a}{2018/10/31}{\LaTeXe{}とp\LaTeXe{}の更新タイミングずれ対策を % \file{plvers.dtx} (plfinal) から\file{plcore.dtx}へ移動、latexrelease対策 % (sync with ltfinal.dtx 2018/08/24 v2.1f)} % % \begin{macro}{\l@nohyphenation} % 通常はBabelのハイフネーション定義により提供されるパラメータです。 % しかし、\LaTeXe\ 2017-04-15以降・p\LaTeXe\ 2017-04-08以降では、 % |\verb|の途中でハイフネーションが起きないようにするために必須の % ものとなりました。 % \LaTeXe{}は特殊な状況も想定してltfinal.dtxで対策しているようですので、 % p\LaTeXe{}も念のためここで対策します(参考:latex2e svn r1405)。 % \begin{macrocode} %<*plcore> \ifx\l@nohyphenation \@undefined \newlanguage\l@nohyphenation \fi % % \end{macrocode} % \end{macro} % % \begin{macro}{\document@default@language} % \LaTeXe\ 2017-04-15で導入されたパラメータですが、これに先立ち % p\LaTeXe\ 2017-04-08でも使用しています。 % verbatim環境の途中で % 改ページが起きた場合にヘッダでハイフネーションが抑制されないように、 % |\@outputpage|で|\language|をリセットするときに使われます % (参考:latex2e svn r1407)。 % \begin{macrocode} %\plIncludeInRelease{2017/04/08}{\document@default@language}% % {Save language for hyphenation}% %<*plcore|platexrelease> \ifx\document@default@language \@undefined \let\document@default@language\m@ne \fi % %\plEndIncludeInRelease %\plIncludeInRelease{0000/00/00}{\document@default@language}% % {Save language for hyphenation}% %\let\document@default@language\@undefined %\plEndIncludeInRelease % \end{macrocode} % \end{macro} % % \Finale \endinput