I have a document with a large tikz image. To display this image using pdflatex, I've created macros to switch papersize, and I'm using the pdflscape
package to rotate the pages when displayed in the pdf viewer. Using this technique, I'm able to display the figure as desired on a rotated larger-size page, but the following page is missing the page number in the footer (and without a manual \clearpage
, text doesn't properly break to the next page, instead it continues through the footer and into the invisible abyss beyond). At the second page following the figure, the page number returns.
The minimum working example below demonstrates this phenomenon:
\documentclass{article}
\usepackage{tikz}
\usepackage{pdflscape}
\usetikzlibrary{shapes}
% Macros for changing paper size
\newcommand{\startPaperSizeB}{%
\begingroup
\clearpage
\setlength{\pdfpagewidth}{11in}
\setlength{\pdfpageheight}{17in}
\setlength{\paperwidth}{\pdfpagewidth}
\setlength{\paperheight}{\pdfpageheight}
\setlength{\oddsidemargin}{0pt}
\setlength{\textwidth}{650pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\textheight}{1084pt}
}
\newcommand{\stopPaperSizeB}{\endgroup \clearpage}
\begin{document}
Some text on the first page.
\startPaperSizeB
\begin{landscape}
\begin{figure}
\centering
\begin{tikzpicture}[]
\node [draw, rectangle, minimum height=625pt, minimum width=1000pt] (1) {};
\end{tikzpicture}
\caption{Caption for the large size figure}
\end{figure}
\end{landscape}
\stopPaperSizeB
Missing page number on this page?
\clearpage
Now the page number is back!
\end{document}
I recently asked a very similar question, execpt I left the figure out of the MWE. This question was answered, but the solution doesn't work when inserting a tikzpicture
on the larger landscape page - instead, there is no larger landscape page and no figure - they just disappear. I get a warning about an overfull box, but no figure. The MWE below demonstrates this:
\documentclass{article}
\usepackage{tikz}
\usepackage{pdflscape}
\usetikzlibrary{shapes}
% Macros for changing paper size
\newcommand{\startPaperSizeB}{%
\setlength{\pdfpagewidth}{11in}
\setlength{\pdfpageheight}{17in}
\setlength{\paperwidth}{\pdfpagewidth}
\setlength{\paperheight}{\pdfpageheight}
\setlength{\oddsidemargin}{0pt}
\setlength{\textwidth}{650pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\textheight}{1084pt}
}
\newcommand{\stopPaperSizeB}{}
\begin{document}
Some text on the first page.
\begin{landscape}
\startPaperSizeB
\begin{figure}
\centering
\begin{tikzpicture}[]
\node [draw, rectangle, minimum height=625pt, minimum width=1000pt] (1) {};
\end{tikzpicture}
\caption{Caption for the large size figure}
\end{figure}
\stopPaperSizeB
\end{landscape}
The page number is here, but the figure is not.
\end{document}
If the size of the rectangle is reduced enough (to 525 by 550, for example), then the figure appears on a page at the end of the document, although the page is a normal size and the figure runs off the page. This led me to try the [H]
option from the float
package, which seems to be getting me closer, but I'm still not there. Any ideas?