3

I am working with a document that has several pages that are in landscape mode. I do realize there are different ways of managing the document - for example, using sideways table with the rotating package - but I do want landscape mode with the pdflscape package. In landscape mode, the page in PDF will actually change orientation - which will make it easier for the vast majority of readers to read as the text will be oriented the right way for the reader (and likely the vast majority of readers of the document as few will print it out). The issue I have is that the page numbers are flipped - the page numbers appear at the top of the document when printed and not at the bottom. It is not easy to see this in the document itself; however, when printed the page numbers are oriented improperly as they are placed at the top of the page and not the bottom. The page numbers should appear toward the 2/4 side of the landscape page, not the 1/3 side. Is there someway to solve this issue? I would much prefer to set the page with landscape to make it easier to read for those reading online.

%% LyX 2.0.7 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{pdflscape}
\usepackage{rotating}

\makeatother

\usepackage{babel}
\begin{document}
Test 1 2 3.

\pagebreak{}

\begin{landscape}%
\begin{tabular}{|c|c|}
\hline 
1 & 2\tabularnewline
\hline 
\hline 
3 & 4\tabularnewline
\hline 
\end{tabular}\end{landscape}

\pagebreak{}

\begin{sidewaystable}%
\begin{tabular}{|c|c|}
\hline 
1 & 2\tabularnewline
\hline 
\hline 
3 & 4\tabularnewline
\hline 
\end{tabular}\end{sidewaystable}
\end{document}
9
  • 1
    (pdf)lscape leaves the page numbers where they are and rotates the body 90 degrees anti(counter)-clockwise: is your printer driver applying further rotations to the pdf on printing? the page number 2 does appear (at the bottom of the page) at the 1/3 edge of the table Oct 30, 2014 at 1:11
  • I can't say for certain. What I can say is that the pdf output that is generated, as printed, is incorrect. This happens for both even numbered and odd numbered pages. Certainly if the entire page was 180 degrees it would be fine - but I'm just sending the document to a printer and it is printed in duplex and, as is, is upside down.
    – user65240
    Oct 30, 2014 at 1:18
  • tex.stackexchange.com/questions/60273/… may help. There is a hack in the comments to the answer which apparently works for standard classes.
    – cfr
    Oct 30, 2014 at 1:18
  • Thanks, yes, I saw that hack and it did not work for me. I seem to recall I received an error. Some people want the page number to change orientation with the content, I specifically want all page numbers at the bottom of the page in the same orientation.
    – user65240
    Oct 30, 2014 at 1:21
  • 1
    I suspect that your printer software is trying to be smart and auto-rotate stuff (not unknown) (you could try lscape rather then pdflscape) which will omit the instructions to rotate the view for online reading, neither pdflscape or lscape change the orientation of the page or move the page numbers, they only rotate the inner part of the page between head and foot, but your printer may be confused by the rotated view set up Oct 30, 2014 at 1:23

1 Answer 1

3

Tikzpagenodes got confused by pdflandscape, so I had to do it the hard way.

\documentclass{article}
\usepackage{pdflscape}
\usepackage{tikz}

\begin{document}
Test 1 2 3.

\pagebreak{}

\begin{landscape}%
\thispagestyle{empty}
\begin{tikzpicture}[overlay]
\node[above] at (.5\linewidth,-\textwidth-\footskip) {\thepage};
\end{tikzpicture}

\begin{tabular}{|c|c|}
\hline 
1 & 2\\
\hline 
\hline 
3 & 4\\
\hline 
\end{tabular}
\end{landscape}

\end{document}

Here is an even more general solution using everypage:

\documentclass[english]{article}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{everypage}
\usepackage{lipsum}

\newlength{\hfoot}
\newlength{\vfoot}
\AddEverypageHook{\ifdim\textwidth=\linewidth\relax
\else\setlength{\hfoot}{-\topmargin}%
\addtolength{\hfoot}{-\headheight}%
\addtolength{\hfoot}{-\headsep}%
\addtolength{\hfoot}{-.5\linewidth}%
\ifodd\value{page}\setlength{\vfoot}{\oddsidemargin}%
\else\setlength{\vfoot}{\evensidemargin}\fi%
\addtolength{\vfoot}{\textheight}%
\addtolength{\vfoot}{\footskip}%
\raisebox{\hfoot}[0pt][0pt]{\rlap{\hspace{\vfoot}\rotatebox[origin=cB]{90}{\thepage}}}\fi}

\begin{document}
\noindent Test 1 2 3.

\pagebreak{}

\begin{landscape}%
\pagestyle{empty}
\lipsum[1-8]
\end{landscape}
\pagestyle{plain}

\end{document}

As far as I can tell, pdflscape uses the same margins only rotated 90^\circ. The top margin is actually the left margin, the right margin is actually the top margin, and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.