6

I have a sideways figure that takes up one whole page. Since it is a table, I don't want the page numbering to show in my case on the top of the table. If I include the commands \thispagestyle{empty} and \clearpage the page numbering of the previous page is deleted, no matter if I put it before or after the sidewaysfigure. Putting the two commands within the \sidewaysfigure is not allowed. It is also important that the table remains a float. So I use a header to show the page numbering:

\begin{document}

\fancyhead{}
\rhead{\thepage}
\lhead{}
\pagestyle{fancy}

\begin{sidewaysfigure}
\begin{center}
\includegraphics[angle=360, trim=4cm 2cm 2cm 0cm, scale=1]{TechnCoeffMatrix.pdf}
\captionof{table}{Technical Coefficient Matrix} \label{tab:Technical Coefficient Matrix}
\end{center}
\end{sidewaysfigure}
\end{document}

So for the page with the \sidewaysfigure, the page number is shown at the bottom. Is it possible to delete this?

1
  • I saw your edit and added the requested workaround. You don't clear the footer field, so the page number will be printed also there.
    – egreg
    Sep 23, 2013 at 13:36

2 Answers 2

5

This is possible with the fancyhdr package. I assume the article class.

\documentclass{article}

\usepackage{fancyhdr}

\PassOptionsToPackage{demo}{graphicx} % just for the example
\usepackage{rotating}

\usepackage{kantlipsum} % just for the example

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}

% page number at foot center, suppress it for float pages
\fancyfoot[C]{\iffloatpage{}{\thepage}}

\begin{document}

\kant

\begin{sidewaystable}
\centering
\includegraphics[angle=360, trim=4cm 2cm 2cm 0cm, scale=1]{TechnCoeffMatrix.pdf}
\caption{Technical Coefficient Matrix} \label{tab:Technical Coefficient Matrix}
\end{sidewaystable}

\kant

\end{document}

Note that you can use sidewaystable and the normal \caption command rather than sidewaysfigure and \captionof: LaTeX doesn't mind if you insert a graphic object rather than a tabular environment.

This is for having the page number on top right with the separator rule (but not in float pages):

\documentclass{article}

\usepackage{fancyhdr}

\PassOptionsToPackage{demo}{graphicx} % just for the example
\usepackage{rotating}

\usepackage{kantlipsum} % just for the example

\pagestyle{fancy}
\fancyhf{} % clear all fields

% page number in header, right field; suppress it for float pages
\fancyfoot[R]{\iffloatpage{}{\thepage}}

% rule only in nonfloat pages
\renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}


\begin{document}

\kant

\begin{sidewaystable}
\centering
\includegraphics[angle=360, trim=4cm 2cm 2cm 0cm, scale=1]{TechnCoeffMatrix.pdf}
\caption{Technical Coefficient Matrix} \label{tab:Technical Coefficient Matrix}
\end{sidewaystable}

\kant

\end{document}
2
  • Thanks egreg, I see what you did there. I should have mentioned that I already use fancyhdr. \fancyhead{} \rhead{\thepage} \lhead{} \pagestyle{fancy} So my page number is actually shown at the top of the page. However, when using sidewaysfigure or sidewaystable the page number is shown at the bottom. This is not the case with includegraphics for other figures. So can I still use sidewaysfigure or sidewaystable and delete the page number? Sep 20, 2013 at 13:04
  • @EwoutKillemaes Please make the code snippet into some complete example.
    – egreg
    Sep 20, 2013 at 13:05
3

I found another solution that worked for me using \thisfloatpagestyle{empty}

\documentclass{article}
\usepackage{floatpag}

\begin{document}

\begin{sidewaystable}
\thisfloatpagestyle{empty}
\begin{center}
\includegraphics[angle=360, trim=2.5cm 2cm 2cm 1cm, scale=1]{./Figures/I-OTableDomesticProductionBelgium1.pdf}
\captionof{table}{Input-Output Table for Belgium (2005)} \label{tab:Input-Output Table for Belgium (2005)}
\end{center}
\end{sidewaystable}

\end{document}

The page number disappeared.

It is important that \thisfloatpagestyle{empty} is placed inside sidewaystable/sidewaysfigure/figure environment. If placed outside of this environment, it will generate error similar to this one:

! Undefined control sequence.
\thisfloatpagestyle ... \csname \number \@currbox 
                                                  @float\endcsname {\thispag...
l.2 \thisfloatpagestyle{empty}

While this question is about sidewaystable (from rotating package) it is worth noting that \thisfloatpagestyle from floatpag package works also for all others float environments including regular figure.

1
  • Since this solution worked best in your case, you should mark it as "accepted", so that is appears on top of all other answers.
    – Rafal
    Oct 12, 2015 at 9:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .