我在 StackExchange 上找到了用於定義 A3Landscape 環境的程式碼https://tex.stackexchange.com/a/431435/278762:
\makeatletter
% like \newgeometry, but also allows change of landscape/portrait
% and paper size to be used with caution!
\newcommand{\newgeometryfull}[1]{%
\clearpage
\Gm@restore@org
\Gm@initnewgm
% \Gm@newgmtrue
\setkeys{Gm}{#1}%
% \Gm@newgmfalse
\Gm@process
\ifnum\mag=\@m\else\Gm@magtooffset\fi
\Gm@changelayout
\Gm@showparams{newgeometry}}%
\makeatother
%% Allow A3 sheets - - New environment
\newenvironment{a3pageLandscape}{%
\newgeometryfull{a3paper,landscape=true,top=2cm, bottom=2cm, left=1.5cm, right=1.5cm}
% set the correct dimension for the PDF viewer
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\headwidth=\textwidth
}{%
\restoregeometry
% set the correct dimension for the PDF viewer
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
}
使用此a3pageLandscape
環境會產生以下輸出:
這效果非常好。
現在,我想知道是否可以將環境從 A3Landscape 更改為 A3Portrait。所以我將程式碼從 更改landscape=true
為landscape=false
.在這裡查看完整的新環境:
%% Allow A3 sheets - - New environment
\newenvironment{a3pagePortrait}{%
\newgeometryfull{a3paper,landscape=false,top=2cm, bottom=2cm, left=1.5cm, right=1.5cm}
% set the correct dimension for the PDF viewer
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
\headwidth=\textwidth
}{%
\restoregeometry
% set the correct dimension for the PDF viewer
\pdfpageheight=\paperheight
\pdfpagewidth=\paperwidth
}
使用a3pagePortrait
環境會產生以下輸出:
問題:有誰知道為什麼我的頁腳a3pagePortrait
在下一頁使用環境時消失了?