0

My document is split into multiple chapters that I can compile separately using subfiles. In the appendix, which is a separate chapter, I have some landscape oriented pages with \thispagestyle{empty} for especially large, landscape figures. The first page after these special pages has a heading, but the page number is somehow missing. Weirdly, this only happens if I compile the whole document and not if I only compile the corresponding chapter. Does anyone have an idea, what could be causing this and how to get the page number back on the page after the landscape figures?

Here is also the corresponding code:

\newgeometry{textheight=750pt, textwidth=460pt}
\begin{landscape}
    \thispagestyle{empty}
    \begin{figure}[htb!]
        % a whole lot of figure code
    \end{figure}
\end{landscape}
\restoregeometry

\newgeometry{textheight=750pt, textwidth=460pt}
\begin{landscape}
    \thispagestyle{empty}
    \begin{figure}[htb!]
        % a whole lot of figure code
    \end{figure}
\end{landscape}
\restoregeometry

\begin{figure}[htb!]
    % the code for the first portrait figure.
    % Figure + caption are a little less then \textheight
\end{figure}

\begin{figure}[htb!]
    % the code for the second portrait figure
    % Figure + caption are a little less then \textheight
\end{figure}

And two screenshots showing the results when compiling the whole document and when compiling only the appendices chapter.

when compiling everything

This is what the special pages and the following two pages look like, when compiling the whole document. The special pages are correctly landscape and have no pagenumbers. The next following page has a heading, but no pagenumber and after that everything is back to normal

When compiling only the appendices chapter

And this is the result of only compiling the appendices chapter. Now everything is as it should be and the first page after the landscape pages also has a pagenumber.

Edit: Sort of fixed it.

Putting the first non-landscape figure in a makebox instead of a figure (so non-float) and using \thisfloatpagestyle{empty} instead of \thispagestyle{empty} somehow fixed the problem. Here is the new code:

\newgeometry{textheight=750pt, textwidth=460pt}
\begin{landscape}
    \begin{figure}
    \thisfloatpagestyle{empty}
    % here goes the figure code
    \end{figure}
\end{landscape}
%\restoregeometry

\begin{landscape}
    \begin{figure}
    \thisfloatpagestyle{empty}
    % and the next landscape figure
    \end{figure}
%    \end{sidewaysfigure}
\end{landscape}
\restoregeometry
\clearpage  % not sure if this actually helps

\begin{minipage}{\linewidth}
    \makebox[\linewidth]{
        \centering
        \inputpgf{../figures/plots}{string_order_melting1.pgf}
    }
    \captionof{figure}{
        The caption, duh
    }
    \label{fig:label}
\end{minipage}
\vfill % not sure, if this actually has any effect.

\begin{figure}[htb!]
    % figure and caption for the last figure
\end{figure}
3
  • 2
    Since the code you provided works fine when you compiling just the part that contains the code ... you can't really call it the "corresponding code" for the problem you have... Please add more info in your question and if possible ass a MWE (tex.meta.stackexchange.com/questions/228/…)
    – koleygr
    Commented Sep 26, 2020 at 10:31
  • 1
    just try with \begin{sidewaysfigure}...\end{sidewaysfigure} from the package rotating.sty instead of landscape
    – MadyYuvi
    Commented Sep 26, 2020 at 11:01
  • @MadYuvi Thanks for pointing out sidewaysfigure. It definitely does the job. But since I want the file to be nice in print and on screen I will stick with landscape. Commented Sep 26, 2020 at 13:04

1 Answer 1

0

If you want to remove the running heads and page numbers where a figure/table which occupies a full page, then floatpag will help you as expected, and the MWE is:

\usepackage[figuresright]{rotating}
\usepackage{floatpag}
\begin{document}
...
\begin{sidewaysfigure}
\thisfloatpagestyle{empty}
....
\end{sidewaysfigure}
1
  • 1
    Didn't know about \thisfloatpagestyle, but it did help! Commented Sep 26, 2020 at 13:17

You must log in to answer this question.

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