8000 縦組と longtable パッケージ · Issue #21 · texjporg/platex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

縦組と longtable パッケージ #21

New issue

Have a question about this project?< 8000 /strong> 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 Aug 31, 2016 · 2 comments
Closed

縦組と longtable パッケージ #21

aminophen opened this issue Aug 31, 2016 · 2 comments
Labels

Comments

@aminophen
Copy link
Member

次のソースを platex で処理すると、タイプセットが終了しません。

\documentclass{tarticle}
\usepackage{longtable}
\textheight=3cm
\begin{document}

\begin{longtable}[c]{ccc}
\hline
ひらがな & カタかな & Alphabet \\
\hline
あ & ア & A \\
い & イ & B \\
う & ウ & C \\
え & エ & D \\
お & オ & E \\
か & カ & F \\
き & キ & G \\
く & ク & H \\
\end{longtable}

\end{document}

原因としては forum:1334 に近く、longtable.sty の \LT@output のなかで \@makecol が呼ばれたときに、 \par は \@empty になっているため

\par ->
{\vskip}

\par ->
{\vskip}

\par ->
{\vskip}

というループを起こしています。


いろいろ試してみて気づいたのですが、pLaTeX カーネルの \@makecol

       \iftdir\hskip\z@\fi

という行を削除するとループしなくなります。pldoc.pdf に書かれているとおり、この行が無いと

\documentclass{tarticle}
\begin{document}
\null
\end{document}

でフッタが上に持ち上がってしまいますが、このせいで longtable が使えないのも困ります。


そこで、以下のコードを書いてみました。

\gdef\@makecol{%
   \setbox\@outputbox\box\@cclv%
   \xdef\@freelist{\@freelist\@midlist}%
   \global \let \@midlist \@empty
   \@combinefloats
   \ifvbox\@kludgeins
     \@makespecialcolbox
   \else
     \setbox\@outputbox \vbox to\@colht {%
       \@texttop
\@tempdima\wd\@outputbox
       \dimen@ \dp\@outputbox
       \unvbox \@outputbox
\ifdim\@tempdima=\z@
       \iftdir\hskip\z@\fi
\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
}

これは期待どおり動いているように見えます。(なお、このとき縦組だと妙に表の各行が狭く感じますが、これはやはり #20 と同じ、\strutbox の挙動によるものです。)

@aminophen
Copy link
Member Author

そこで、以下のコードを書いてみました。

別の方法としては

       \iftdir\hskip\z@\fi

       \iftdir\vbox{\hskip\z@}\fi

に変える、という方法も考えられます。表組で呼ばれる可能性があるマクロの途中で \hskip なりで「水平モードに一旦入ってしまう」のがまずい、ということだと思います。

aminophen added a commit that referenced this issue Sep 1, 2016
@aminophen
Copy link
Member Author
aminophen commented Sep 1, 2016

週末のリリース(予定)に入れるため、カーネルに c5b807b でコミットしました。

# 2016-09-13 あとで調べて分かったのですが、どうやら 14 年前 qa:12116, qa:12127 および 13 年前 qa:20273, qa:20298 で、この無限ループという挙動自体は報告されていたのですね。

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