TransWikia.com

Page number missing on page after landscape page with thispagestyle{empty}

TeX - LaTeX Asked by Jan Lukas Bosse on August 9, 2021

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}

One Answer

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}

Correct answer by MadyYuvi on August 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP