8000 「脚注とボトムフロートの順序」と垂直位置 · Issue #32 · texjporg/platex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

「脚注とボトムフロートの順序」と垂直位置 #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aminophen opened this issue Feb 4, 2017 · 5 comments
Closed

「脚注とボトムフロートの順序」と垂直位置 #32

aminophen opened this issue Feb 4, 2017 · 5 comments
Labels

Comments

@aminophen
Copy link
Member
aminophen commented Feb 4, 2017

pLaTeX は本家 LaTeX と違って、ボトムフロート → 脚注 の順に出力されることは知られているとおもいますが、その変更によって垂直位置が変わっているように見えるのですが、意図的でしょうか?

\documentclass{tarticle}
\makeatletter
% ここで \@makecol の定義をいろいろ変えてみる
\makeatother
\begin{document}
脚注の\footnote{テスト}高さが違う。
\end{document}

仮に本家 LaTeX の \@makecol のコードを持って来た場合と、pLaTeX そのままのコードの場合で垂直位置がずれています。物理的な見た目で述べると、pLaTeX のコードでは LaTeX のコードに比べて版面全体が右方向にシフトしています。これは \@makecol のなかで \@textbottom より後に \footins の中身を \unvbox しているからだと思うのですが(→ 訂正:次のコメント)、単にボトムフロートと脚注の順序を入れ替えるだけなら stfloats.sty などがやっているようなコードの方が適切であると私は考えています。

他の例:footmisc や yafoot にも順序を入れ替えるマクロが用意されている。

@aminophen
Copy link
Member Author
aminophen commented Feb 4, 2017

先ほどのコメントが間違っていたので訂正します。

正確には、補正に使う「\@outputbox の深さ」(\dimen@ に格納される)の取得

       \dimen@ \dp\@outputbox

の直後に \typeout{\the\dimen@} を仕込んで見てみると、LaTeX のコードでは 3.66577pt になるところを、pLaTeX では 0.0pt になっていました。

なお、pLaTeX の \@makespecialcolbox の定義に付けられた説明によると \@textbottom を脚注の前に持ってくることは意図的になされたことであることがわかりました(きっと \@makecol の定義も同じ意図のはずで、実際に yafoot の fnpos.sty にはその意図を汲んだ実装が入っている)。

@aminophen
Copy link
Member Author
aminophen commented Feb 7, 2017

LaTeX の \@makecol の場合と垂直位置が合うように \@makecol を変えてみました。なおこの実装は fnpos.sty (yafoot) を元につくりました。(特に役立ったのは

本文(あるいはボトムフロート)と脚注の間に \@textbottom を入れたい

の意図を理解するときに yafoot のマニュアルが便利)

\gdef\@makecol{%
   \setbox\@outputbox\box\@cclv%
   \let\@elt\relax
   \xdef\@freelist{\@freelist\@midlist}%
   \global \let \@midlist \@empty
   \@combinefloats
   \let\pltx@textbottom\@textbottom
   \ifvoid\footins\else % for pLaTeX
     \setbox\@outputbox \vbox {%
       \boxmaxdepth \@maxdepth
       \unvbox \@outputbox
       \@textbottom % inserted here! (pLaTeX)
       \vskip \skip\footins
       \color@begingroup
         \normalcolor
         \footnoterule
         \unvbox \footins
       \color@endgroup
       }%
       \let\@textbottom\relax
   \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
       \iftdir\vbox{\hskip\z@}\fi
       \vskip -\dimen@
       \@textbottom
       }%
   \fi
   \let\@textbottom\pltx@textbottom
   \global \maxdepth \@maxdepth
}

まだ \enlargethispage{\baselineskip} の場合(= \@makespecialcolbox が呼ばれる)についてはよく理解していないので未考慮です。

@aminophen
Copy link
Member Author

a43ffbd で exppl2e.sty に上掲のコードを入れて \@makecol の修正を試みました。

@aminophen aminophen added the bug label Feb 21, 2017
@aminophen
Copy link
Member Author
aminophen commented Feb 21, 2017

本件のバグ修正と #20 の \strutbox 修正を両方適用した状態をテストしてみると、脚注に関して嬉しい結果が得られました。

従来は縦組で「脚注があるページ」と「脚注がないページ」で大きく版面全体がずれていました。(PDF にして 1 ページ目と 2 ページ目を行き来すると明らかです)

%\RequirePackage{exppl2e}
\documentclass{tarticle}
\begin{document}
脚注がないpage\clearpage
脚注があるpage\par テスト\footnote{あいうpage}。\clearpage
\noindent\vrule width\textwidth height\textheight
\end{document}

これが新仕様ではきれいに揃うようになったようです。(最後の黒いページは比較用)

@aminophen
Copy link
Member Author

dc3de3c\@makecol の修正をカーネルに導入。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant
0