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.

Can you help me to remove header from the page where is only one big picture? I tried \thispagestyle{empty} but it removes a header on the next or previous page. I don't know how to remove it exactly from the page only with the picture. I put this picture in my document by using {sidewaysfigure} environment and \includegraphics in it.

Here is my MWE

\documentclass{book}

\usepackage[demo]{graphicx}

\usepackage[
 centering,
 top=12mm,
 headheight=14pt,
 headsep=11pt,
 includeheadfoot,
 papersize={160mm,235mm},
 text={125mm,190.7mm},
]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{} 
\newcommand{\TheAuthor}{} 
\newcommand{\Author}[1]{\renewcommand{\TheAuthor}{#1}} 
\rhead{\small\TheAuthor}
\newcommand{\TheTitle}{} 
\newcommand{\Title}[1]{\renewcommand{\TheTitle}{#1}} 
\lhead{\small\normalfont\TheTitle}
\fancyfoot{} 
\fancyhead[RO,LE]{\thepage} 

\usepackage{lipsum}

\usepackage{rotating}


\begin{document}

\lipsum

\begin{sidewaysfigure}
   \centering
   \fbox{\includegraphics[width=190mm]{pic.jpg}}  
   \caption*{\footnotesize\centering{Pic. 1}}
\end{sidewaysfigure}

\lipsum

\end{document}
share|improve this question
    
Does putting \thispagestyle{empty} inside the float evironment work? –  Seamus Mar 13 '11 at 12:46
    
@Seamus, unfortunatelly it doesn't work. –  kotsport Mar 13 '11 at 12:57
    
@kotspot: See my answer -- use \iffloatpage as part of your header definitions. For example (using your MWE): \rhead{\iffloatpage{}{\small\TheAuthor}} –  lockstep Mar 13 '11 at 13:33
    

2 Answers 2

up vote 5 down vote accepted

Assuming that you use the rotating package, i.e., that sidewaysfigure is a floating environment, fancyhdr's \iffloatpage macro should do the trick.

\documentclass{book}

\usepackage{rotating}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LO,RE]{\iffloatpage{}{(The Title)}}
\fancyhead[RO,LE]{\iffloatpage{}{\thepage}}
\fancyfoot{}
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}

\usepackage{blindtext}

\begin{document}

\blindtext[8]

\begin{sidewaysfigure}
\centering
\rule{1cm}{1cm}
\caption{A rotated figure}
\end{sidewaysfigure}

\end{document}

(The blindtext package is only used to add some dummy text to the example.)

EDIT: In your subsequently delivered MWE, replace

\rhead{\small\TheAuthor}

...

\lhead{\small\normalfont\TheTitle}
\fancyfoot{} 
\fancyhead[RO,LE]{\thepage}

with

\rhead{\iffloatpage{}{\small\TheAuthor}}

...

\lhead{\iffloatpage{}{\small\normalfont\TheTitle}}
\fancyfoot{} 
\fancyhead[RO,LE]{\iffloatpage{}{\thepage}}
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
share|improve this answer
    
it works, but can you tell me how to adapt it to my {fancyhdr} options? I don't want to lose them. I try to use it but don't know how. –  kotsport Mar 13 '11 at 13:53
1  
@kotspot: I just noticed that you have accepted a few answers in the past, but never cast a vote so far. Please consider upvoting those answers (and answers to other questions you find useful). You have enough reputation to do so. –  lockstep Mar 13 '11 at 14:11
    
thanks for your help! Now it works great. Could you explain me what's going on with this upvoting. I'm still new here. –  kotsport Mar 13 '11 at 16:00
    
@kotspot: You upvote questions and answers you find useful by clicking at the upward pointing arrow to the left of it. (There's also an arrow for downvoting -- if you do so, consider to leave a comment explaining the reasons.) You can cast up to 30 votes per day. –  lockstep Mar 13 '11 at 16:14
    
Alternatively, you can use \mergepagefloatstyle from the memoir document class. See my post in a different thread. –  Tim Feb 5 at 13:44

use package afterpage and write somewhere on the page before:

\afterpage{\thispagestyle{empty}}
share|improve this answer
    
unfortunatelly \afterpage hasn't resolved it. –  kotsport Mar 13 '11 at 13:54

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.