Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want a page number in the normal position but when I combine my methodology of margin stretching with landscape then the page number moves to the right a lot.

Note that "TABLE GOES HERE" is actually a longtable table in my code.

\documentclass{article}
\usepackage{lscape}

\begin{document}



\clearpage
\addtolength{\textwidth}{4in}
\addtolength{\hoffset}{-0.45in}
\begin{landscape}
LONGTABLE TABLE GOES HERE
\end{landscape}
\addtolength{\textwidth}{-4in}
\addtolength{\hoffset}{0.45in}
\clearpage 

\end{document} 
share|improve this question
    
@HarishKumar (1) Unfortunately I do not understand your advice. (2) Perhaps it does add extra area outside of the page, but my landscape tables fit perfectly in the center of the page. I chose not to put the whole table's code into my post though. –  user16208 Sep 6 '12 at 2:49
    
@HarishKumar I am using longtable inside the landscape in my actual code. –  user16208 Sep 6 '12 at 2:53
    
\usepackage[showframe]{geometry} to your preamble to see what is happening. –  Harish Kumar Sep 6 '12 at 2:53
1  
If you are using longtable, why you have to increase the textwidth. Sorry I don't understand. –  Harish Kumar Sep 6 '12 at 2:54
1  
Does using \addtolength{\textwidth}{2\baselineskip} help? –  Harish Kumar Sep 6 '12 at 2:57
show 2 more comments

1 Answer

up vote 0 down vote accepted

Adding 4in to \textwidth takes you out of the page, as already noted in the comments. But probably this is only an artifact of the MWE, the original document might use much larger margins/marginpar.

The following hack undoes the layout changes for the footer:

\documentclass{article}
\usepackage{lscape}

\makeatletter
\newcommand*{\footfix}{%
  \let\orig@oddfoot\@oddfoot
  \renewcommand*{\@oddfoot}{%
    \hspace{.45in}%
    \hbox to\dimexpr\textwidth-4in\relax{\orig@oddfoot}%
    \hfil
  }%
  \let\orig@evenfoot\@evenfoot
  \renewcommand*{\@evenfoot}{%
    \hspace{.45in}%
    \hbox to\dimexpr\textwidth-4in\relax{\orig@evenfoot}%
    \hfil
  }%
}
\makeatother

\begin{document}

\clearpage
\addtolength{\textwidth}{4in}
\addtolength{\hoffset}{-0.45in}
\begin{landscape}
\footfix
TABLE GOES HERE
\newpage
Second page
\end{landscape}
\addtolength{\textwidth}{-4in}
\addtolength{\hoffset}{0.45in}
\clearpage

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.