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 am writing a book where some tables need wider space. The only solution is to make the tables in intentionally-made landscape pages.

Unfortunately, there are annoying headers and footers on the landscape pages. How to remove those annoying header and footers?

The following is my "minimal" code snippet:

\documentclass{book}
\usepackage[a4paper,margin=20mm]{geometry}
\usepackage{lscape}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{longtable,array}

\begin{document}
\chapter{One}
\lipsum[1]
\section{One One}
\lipsum[2]

\pagestyle{empty}
\begin{landscape}
\begin{longtable}{|m{0.4\textwidth-2\tabcolsep-1.5\fboxrule}|m{0.6\textwidth-2\tabcolsep-1.5\fboxrule}|}
\hline
a & b\\\hline
c & d\\\hline
\end{longtable}
\end{landscape}
\pagestyle{plain}

\lipsum[3]
\end{document}

EDIT 1:

I made a correction in the column width, i.e., changing 2\fboxrule to 1.5\fboxrule. The former calculation is wrong because the rule between 2 columns should NOT be calculated twice. I slipped a little here.


EDIT 2:

Herbert's solution is the final answer.

share|improve this question
    
Is your question still a question? It looks more like an answer now. You shouldn't give answers in questions, but rather post a separate answer. –  Hendrik Vogt Dec 24 '10 at 7:59
    
@Hendrik, thanks for informing the rule. I will post the answer 15 minutes later. There are some adjustments based on Herbert's answers I must consider in the other topic I am reading. –  xport Dec 24 '10 at 8:09
1  
Your edits 2 and 3 seem to contradict each other. –  Hendrik Vogt Dec 24 '10 at 13:43
    
@Hendrik, Done. Thanks. –  xport Dec 24 '10 at 13:48
add comment

2 Answers

up vote 3 down vote accepted
\documentclass{article}
\usepackage{geometry}

\usepackage{lscape}

\begin{document}
foo
\clearpage\pagestyle{empty}
\begin{landscape}

bar\clearpage baz
\end{landscape}
\pagestyle{plain}

next page

\end{document}
share|improve this answer
    
is it necessary to use \clearpage ? –  xport Dec 24 '10 at 9:03
    
sure! At the end of an page TeX looks for the pagestyle. The reason why it cannot work without. In that case the \pagestyle{empty} is also used for the page before landscape. –  Herbert Dec 24 '10 at 9:04
    
I still can compile my code above (in question session) even though I don't use \clearpage. –  xport Dec 24 '10 at 9:20
1  
delete in my example the \clearpage and you do not get a page number on the page before landscape. –  Herbert Dec 24 '10 at 9:26
    
I see. Good info. :-) Thank you. –  xport Dec 24 '10 at 9:32
add comment

You want to use \thispagestyle{empty} on the pages that shouldn't have headers or footers.

Edit:

\begin{landscape}
\thispagestyle{empty}
% longtable code
\end{landscape}
share|improve this answer
    
@TH, thanks. If I use \pagestyle{empty} right before \begin{landscape} and \pagestyle{plain} right after \end{landscape}, is it correct? –  xport Dec 24 '10 at 3:58
    
@xport: If by, "is it correct?" you're asking if it works, the answer is I don't know. Did you try it? But why bother? \thispagestyle{empty} should work. If it doesn't please provide a minimal example. –  TH. Dec 24 '10 at 4:00
    
\thispagestyle does not work and I don't know how to use it. My way above works but I am not sure it is the correct way to do. –  xport Dec 24 '10 at 4:07
    
@xport: Then you need to provide a minimal example where it isn't working. –  TH. Dec 24 '10 at 4:10
    
@TH, minimal code has been given above. I just updated several seconds ago. –  xport Dec 24 '10 at 4:16
show 5 more comments

Your Answer

 
discard

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

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