TransWikia.com

How to rotate the heading of landscaped pages?

TeX - LaTeX Asked by hildogjr on February 10, 2021

This question came from a derivation of
How to translate and rotate the heading of landscaped pages?

I want to rotate the header (with have page number and chapter name) on some landscape pages that are not sequential.

I am using the code proposed by 沙漠之子 user that works very well not generating conflicts with the other packages that I use. The problem is that this solution appear to be single shot, after restoregeometry command I can make work the newgeometry{,hmargin=3cm,vmargin=5cm,landscape} again.

My intention is use as:

usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=2cm]{geometry} % Margins.
    makeatletter
    defifGm@preamble#1{@firstofone}
    apptorestoregeometry{%
        pdfpagewidth=paperwidth
        pdfpageheight=paperheight}
    apptocmdnewgeometry{%
        pdfpagewidth=paperwidth
        pdfpageheight=paperheight}{}{}
    makeatother
newcommand{newgeometrylandscape}{newgeometry{top=3cm,bottom=2cm,left=3cm,right=2cm,landscape}}

begin{document}
chapter{One}
lipsum[1]

section{One One}
lipsum[2]

newgeometry{hmargin=3cm,vmargin=5cm,landscape}
Landscape part 1
lipsum[3-5]
restoregeometry

lipsum[6]


newgeometry{hmargin=3cm,vmargin=5cm,landscape}
Landscape part 2
lipsum[3-5]
restoregeometry

end{document}

One Answer

The workaround that I create is change the newgeometry to force the value of variables that wasn't changed at the second time that the macro was called.

    apptocmdnewgeometry{%
        paperwidth=297mm
        paperheight=210mm
        textwidth=702.78308pt
        linewidth=textwidth
        hsize=textwidth
        columnwidth=textwidth
        pdfpagewidth=paperwidth
        pdfpageheight=paperheight
        }{}{}

Answered by hildogjr on February 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP