How to make landscape mode rotate properly in a twoside book?
How can I use pdflscape
(or some other?) package in a twoside book so that landscape mode is always rotated so that top of the page points to the middle of the book? By default it seems landscape mode does not do that?
So I would like to have from time to time a page in a landscape mode, but it should be rotated correctly. This will probably make some landscape pages hard to read on a screen, as they will be flipped, but it would be much b开发者_运维技巧etter printed.
What you ask is actually really hard, try adding the following to your preamble:
\makeatletter
\global\let\orig@begin@landscape=\landscape%
\global\let\orig@end@landscape=\endlandscape%
\gdef\@true{1}
\gdef\@false{0}
\gdef\landscape{%
\global\let\within@landscape=\@true%
\orig@begin@landscape%
}%
\gdef\endlandscape{%
\orig@end@landscape%
\global\let\within@landscape=\@false%
}%
\@ifpackageloaded{pdflscape}{%
\gdef\pdf@landscape@rotate{\PLS@Rotate}%
}{
\gdef\pdf@landscape@rotate#1{}%
}
\let\latex@outputpage\@outputpage
\def\@outputpage{
\ifx\within@landscape\@true%
\if@twoside%
\ifodd\c@page%
\gdef\LS@rot{\setbox\@outputbox\vbox{%
\pdf@landscape@rotate{-90}%
\hbox{\rotatebox{90}{\hbox{\rotatebox{180}{\box\@outputbox}}}}}%
}%
\else%
\gdef\LS@rot{\setbox\@outputbox\vbox{%
\pdf@landscape@rotate{+90}%
\hbox{\rotatebox{90}{\hbox{\rotatebox{0}{\box\@outputbox}}}}}%
}%
\fi%
\else%
\gdef\LS@rot{\setbox\@outputbox\vbox{%
\pdf@landscape@rotate{+90}%
\hbox{\rotatebox{90}{\hbox{\rotatebox{0}{\box\@outputbox}}}}}%
}%
\fi%
\fi%
\latex@outputpage%
}
\makeatother
精彩评论