临时垂直调整的时间正确吗?

临时垂直调整的时间正确吗?
\documentclass[a4paper]{article}
\begin{document}
page 1 - textheight shall be normal and is ok.
\newpage
\begingroup
\textheight=5cm
page 2 - textheight shall be 5cm but is normal.
\newpage 
page 3 - textheight shall be 5cm and is ok.
\newpage
\endgroup
page 4 - textheight shall be normal but is 5cm
\newpage
page 5 - textheight shall be normal and is ok.
\end{document}

仍以上面的例子来说:

  • 为什么第 2 页的高度不是 5cm 而是“正常”?
  • 为什么第 4 页的高度不是“正常”而是 5cm?

如何正确进行临时垂直调整?

答案1

垂直调整的时间正确。

但在 LaTeX 2ε 中,您还需要\textheight考虑其他参数,例如\@colht和。\@colroom\vsize

如果有兴趣,可以查看源2e.pdf

下面的例子不适合\twocolumn等等。

您可能对包中的内容如何实现感兴趣几何学

\documentclass[a4paper]{article}
\begin{document}
page 1 - textheight shall be normal and is ok.
\newpage
\begingroup
\textheight=5cm
\csname @colht\endcsname=\textheight
\csname @colroom\endcsname=\textheight
\vsize=\textheight
page 2 - textheight shall be 5cm and is 5cm and is not normal.
\newpage
page 3 - textheight shall be 5cm and is ok.
\newpage
\endgroup
\csname @colht\endcsname=\textheight
\csname @colroom\endcsname=\textheight
\vsize=\textheight
page 4 - textheight shall be normal and is normal ant not 5cm
\newpage
page 5 - textheight shall be normal and is ok
\end{document}

相关内容