Graphics, Figures & TablesChange page layout in sideways figures/tables

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
JoEgner
Posts: 5
Joined: Thu Jul 22, 2010 10:18 pm

Change page layout in sideways figures/tables

Post by JoEgner »

Hi,

I'd like to remove the page number (and possibly also change the page margins) on a floating page created by the rotating-package. \thispagestyle{empty} seems unhelpful.

In the below example, there should be no page numbering on the second page:

Code: Select all

\documentclass{article}
\usepackage[british]{babel}
\usepackage{rotating}

\begin{document}
Text
\begin{sidewaystable}A\thispagestyle{empty}\end{sidewaystable}
\newpage Text
\end{document}
Any help would be appreciated -- Jo
Last edited by JoEgner on Sun Jul 25, 2010 7:58 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Change page layout in sideways figures/tables

Post by php1ic »

You need to put the pagestyle outside of the float environment

Code: Select all

\documentclass{article}
\usepackage[british]{babel}
\usepackage{rotating}

\begin{document}
Text
\newpage
\thispagestyle{empty}
\begin{sidewaystable}[p]
\caption{This is a caption}
\end{sidewaystable}
\clearpage
Text
\end{document}
JoEgner
Posts: 5
Joined: Thu Jul 22, 2010 10:18 pm

Re: Change page layout in sideways figures/tables

Post by JoEgner »

Thanks, but this isn't what I'm after. \newpage and \clearpage make the floating page a "non-floating" object that appears at a deterministic location. In particular, there is a pagebreak due to \newpage which may occur right at the beginning of a page.

Jo
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Change page layout in sideways figures/tables

Post by php1ic »

The fancyhdr package provides a special page style for float only pages (see p14 of the manual)
http://www.ctan.org/tex-archive/macros/ ... /fancyhdr/

Code: Select all

\documentclass{article}

\usepackage{rotating}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{fancyhdr}

\pagestyle{\iffloatpage{empty}{fancy}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyfoot[C]{\iffloatpage{}{\thepage}}

\begin{document}
\Blindtext

\begin{sidewaystable}[htbp]
\caption{This is a caption}
\end{sidewaystable}

\blinditemize
\Blindtext

\begin{figure}[htb]
\caption{Figures caption}
\end{figure}

\blindtext
\end{document}
I haven't used it before and don't understand why the \iffloatpage command needs to be used for both the \pagestyle and \fancyfoot, but I think the above code does what you want.
JoEgner
Posts: 5
Joined: Thu Jul 22, 2010 10:18 pm

Re: Change page layout in sideways figures/tables

Post by JoEgner »

Excellent -- many thanks!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Change page layout in sideways figures/tables

Post by localghost »

Now that the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules.


Best regards
Thorsten
JoEgner
Posts: 5
Joined: Thu Jul 22, 2010 10:18 pm

Re: Change page layout in sideways figures/tables

Post by JoEgner »

done
Post Reply