6

I am using the pdflscape package to rotate pages with wide tables on them. This works fine, but there is a problem when I print the document in duplex mode. Its a double-sided document (left and right pages, using the twoside option from the scrbook document class).

The right pages print correctly, but the left pages (only those set in landscape mode) are printed upside down. How can I fix this?

  • For the posterity:apparently this is a system-specific issue. I have the same problem when using evince as pdf viewer (ubuntu 18.04). But using acrobat reader under windows 10, the pages are printed in the correct orientation. – Alessandro Cuttin Apr 08 '20 at 10:39

2 Answers2

7

No example supplied, so this is untested, but if you replace occurrences of 90 in a local copy of lscape.sty with

\ifodd\c@page\else-\fi 90

It might do something useful.

UPDATE In comments it seems that this works:

\def\myrotate{\ifodd\c@page\else-\fi 90}
\g@addto@macro{\landscape}{\PLS@Rotate{\myrotate}} 

You might need to switch to

  \def\myrotate{90}

locally in some environments, depending on needs.

David Carlisle
  • 757,742
  • I cannot reproduce the problem with my own printer, maybe it's a configuration issue at the print shop. (I've considered closing the question, but I'll leave it open for the moment in case somebody else runs into the same problem.) – fuenfundachtzig Feb 21 '12 at 16:15
  • I tried this, but I get an error message, Extra \else., when I try to compile with pdflatex. The modified line is \g@addto@macro{\landscape}{\PLS@Rotate{\ifodd\c@page\else-\fi 90}} – fuenfundachtzig Feb 29 '12 at 10:33
  • pls@rotate calls \PLS@CheckAngle which does \ifx\\#1\\ to check if #1 is empty. You really don't want #1 to start with an if in that case. Define a macro def\myrotate{\ifodd\c@page\else-\fi 90} and then \PLS@Rotate{\myrotate} (still untested) – David Carlisle Feb 29 '12 at 10:56
  • Yes, this solves the problem. Unfortunately, it seems not to be compatible with longtables. (In long automatically "pagebroken" tables all pages are turned the other way round now.) – fuenfundachtzig Feb 29 '12 at 11:27
  • No. longtable and lscape really don't know anything about each other, longtable just dumps its rows on to the main vertical list and lscape rotates whatever is there from tables or normal text without knowing which is which. – David Carlisle Feb 29 '12 at 11:34
  • You need to find out why the pages were rotating in the first place. I half suspect that it is your pdf viewer (or printer) trying to automatically detect the orientation and adding automatic rotation. The table layout may confuse it so it doesn't do that, so the correction-to-the-correction is not needed in that case. In any case now you have \myrotate you can switch its definition between having the \ifodd test or not each time you start a lscape environment. – David Carlisle Feb 29 '12 at 11:34
  • That's not very convenient, but as the problem seems to be related to specific printer problems, it should do. Thanks! – fuenfundachtzig Feb 29 '12 at 12:46
  • (Maybe you could modify the code in your answer to \def\myrotate{\ifodd\c@page\else-\fi 90} + \g@addto@macro{\landscape}{\PLS@Rotate{\myrotate}} or similar.) – fuenfundachtzig Feb 29 '12 at 12:47
2

if it's single page figures you're after, and you're happy with floats, try the rotating package.

rotating goes to some lengths to get rotation consistent.

wasteofspace
  • 5,352