2

I would like to have a floating figure in landscape placed on a new and empty page (without header, footer and number). The plot shall become as wide as possible. It doesn't matter if the caption is in landscape or not. Any suggestions how to achieve this?

\documentclass{scrbook}

\usepackage{lipsum}
\usepackage{pgfplots}

\begin{document}

\lipsum[1]
\begin{figure}
  \begin{tikzpicture}
    \begin{axis}[width=\linewidth]
     \addplot {x^2};
    \end{axis}
  \end{tikzpicture}
  \caption{Dummy caption}
\end{figure}
\lipsum[2]

\end{document}
0

2 Answers 2

1

You could try something like this:

\documentclass{scrbook}
\usepackage{graphicx}
\usepackage{lipsum,atbegshi}
\usepackage{floatpag}
\usepackage{zref-abspage,zref-user}
\AtBeginShipout{\MyShipoutHook}
\makeatletter
\newlength\oripaperwidth
\oripaperwidth\paperwidth
\newcommand\MyShipoutHook{%
  \ifnum\c@page=\zref@extractdefault{mylargefigure}{abspage}{0}   
    \pdfpagewidth=2\paperwidth\relax
  \else\pdfpagewidth=\oripaperwidth\relax
 \fi}
\makeatother
\begin{document}
\lipsum

\begin{figure}[!p]\zlabel{mylargefigure}
\thisfloatpagestyle{empty}
\linewidth=2.5\linewidth
\rule{\linewidth}{0.9\textheight}
\caption[toc]{\lipsum[1]}
\end{figure}

\lipsum 
\lipsum \lipsum 
\lipsum \lipsum
\end{document}

enter image description here

1

Key things that can change the size/location of the figure are

1) the first two arguments to \atxy which govern the x and y placement of the sideways page number.

2) the width= and height= specification of the axis specification, which govern the size of the graph.

3) the value of the downward shift of the image as the first argument to the \raisebox

4) the value of the final \kern for shifting the image left/right.

\documentclass{scrbook}
\usepackage{everypage,pgfplots}
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
\usepackage{pdflscape}
\usepackage{afterpage}
\usepackage{capt-of}% or use the larger `caption` package
\usepackage{lipsum}% dummy text
\begin{document}
\lipsum % Text before
\afterpage{%
    \clearpage% Flush earlier floats (otherwise order might not be correct)
    \thispagestyle{empty}% empty page style (?)
    \atxy{\dimexpr\paperwidth-.3in}{.5\paperheight}{\rotatebox[origin=center]{90}{\thepage}}
    \begin{landscape}% Landscape page
        \centering % Center table
        \setbox2=\vbox{\setbox0=\hbox{%
         \begin{tikzpicture}
           \begin{axis}[width=1.35\linewidth,height=1.3\textheight]
             \addplot {x^2};
           \end{axis}
        \end{tikzpicture}%
        }\ht0=.95\textheight\makebox[\textwidth]{\box0}
        \captionof{table}{Table caption}% Add 'table' caption
        }\ht2=0pt\makebox[\textwidth]{\smash{\raisebox{-80pt}{\box2\kern75pt}}}
    \end{landscape}
    \clearpage% Flush page
}
\lipsum % Text after
\end{document}

enter image description here

You must log in to answer this question.

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