2

I have the following problem. I am writting my thesis and I need to change the page format from A4 to A3 to include a figure. After this, I would like to return to the original format.

However, an undesirable page break appears always at the end on the first page after the format change. I do not know how to eliminate it or why this problem appears.

I hope you can help me. Thanks you very much in advance.

\documentclass[listof=flat,a4paper,12pt,headsepline,bibliography=totoc,listof=totoc,index=totoc,cleardoublepage=empty,numbers=noenddot,headings=normal]{scrreprt}

% hack for KOMA package
\usepackage{scrhack}

% allow sophisticated control structures
\usepackage{ifthen}

% languages
\usepackage[ngerman,english]{babel}
\selectlanguage{english} % change to ngerman for a German thesis

% character encoding
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}

% page layout
\usepackage[paper=a4paper,left=50mm,right=20mm,top=20mm,bottom=20mm]{geometry}

% page header layout
\usepackage[automark]{scrpage2}
\pagestyle{scrheadings}
\renewcommand{\partpagestyle}{empty}
\renewcommand{\chapterpagestyle}{scrheadings}
\setkomafont{pagenumber}{\slshape}
\ihead[]{\headmark}
\chead{}
\ohead[]{\emph{\pagemark}}
\ifoot{}
\cfoot[]{}
\ofoot{}
\automark[section]{chapter}
\renewcommand{\sectfont}{\normalfont \bfseries} % header font

% paragraph formatting
\setlength{\parindent}{0cm}
\setlength{\parskip}{6pt plus 2pt minus 2pt}

% fonts
\usepackage{times} % use times as default font
\usepackage{pifont} % enable special PostScript fonts

% use colors
\usepackage{color}

% linespacing
\usepackage{setspace}

%possible penalties for layouting
%\binoppenalty=10000
%\relpenalty=10000
%\interfootnotelinepenalty=10000
%\brokenpenalty=10000
%\clubpenalty=10000
%\widowpenalty=10000
%\hyphenpenalty=5000
%\tolerance=3000

% numbering
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage{chngcntr}
\counterwithout{footnote}{chapter} % footnotes are numbered throughout the text

% fancy math
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}

% sophisticated enumerations
\usepackage{enumerate}

% fancy tables
\usepackage{booktabs}

% algorithms & code listings
\usepackage[english,vlined,algoruled]{algorithm2e}
\usepackage{listings}

% graphics & charts
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.3}

% Load float package, for enabling floating extensions
\usepackage{float}

% allow rotations
\usepackage{rotating}

% hyperlinks in PDF-document
\usepackage[colorlinks=true,linkcolor=black,citecolor=black,anchorcolor=black,urlcolor=black,pdftex]{hyperref}

% set the bibliography style
\usepackage[round]{natbib}
\bibliographystyle{bibliography/biblio_style}


\usepackage{tabularx}
\usepackage{multirow}
\usepackage{enumitem} 
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{ltxtable}
\usepackage{amsmath}
\usepackage{afterpage}
\usepackage{lipsum}

\begin{document}

\lipsum[7-15]

Figure \ref{Big figure}.

\afterpage{
\clearpage
\KOMAoptions{paper=A3, paper=landscape, pagesize}
\addtolength{\hoffset}{-3.5cm}
\recalctypearea
\begin{figure}[h]
   \includegraphics[height=1.25\textheight,width=1.25\textwidth,keepaspectratio]{images/leon.JPEG}
   \caption{Big picture}
     \label{Big picture}
\end{figure}
\clearpage
\KOMAoptions{paper=A4, paper=portrait, pagesize}
\recalctypearea
}

\lipsum[1-15]

\end{document}

That is what I mean:
enter image description here

3
  • 2
    I can't seem to identify what you mean by "an undesirable page break".
    – Werner
    Dec 19, 2016 at 18:39
  • Replace the second \clearpage\KONAoptions{...} with \afterpage{\clearpage\KOMAoptions{...}} INSIDE the first \afterpage. Dec 20, 2016 at 15:47
  • It does not work. :( A3 page disappears as well as the undesirable page break. However, I need the A3 page. Thanks you for the advice!! :) Dec 20, 2016 at 22:02

1 Answer 1

3

Your MWE does not compile. Did you see the warnings by package typearea?

Package typearea Warning: \typearea used at group level 3. Using \typearea inside any group, e.g. environments, math mode, boxes, etc. may result in many type setting problems. You should move the command \typearea outside all groups on input line 130.

You can insert the picture outside of all groups at a fixed position. To save the page layout use something like \storeareas\savedlayout. Then you can restore the page layout using \savedlayout.

\documentclass[12pt,
    parskip=half-% do not set parskip manually
]{scrreprt}
% page layout
\usepackage[left=50mm,right=20mm,top=20mm,bottom=20mm]{geometry}
% page header layout
\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ohead{\pagemark}
\cfoot{to show the footer position}
\renewcommand{\partpagestyle}{empty}
\renewcommand{\chapterpagestyle}{scrheadings}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[7-15]
Figure \ref{Big picture}.

\clearpage
\storeareas\savedlayout
\KOMAoptions{paper=a3, paper=landscape, DIV=25}
\includegraphics[height=.95\textheight,width=\linewidth]{example-image}
\captionof{figure}{Big picture}
\label{Big picture}
\clearpage
\savedlayout

\lipsum[1-15]
\end{document}

Another possibility is using a dummy page and dummy caption as placeholders in the document:

\documentclass[12pt,
parskip=half-% do not set parskip manually
]{scrreprt}
 %page layout
\usepackage[left=50mm,right=20mm,top=20mm,bottom=20mm]{geometry}
 %page header layout
\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\ohead{\pagemark}
\cfoot{to show the footer position}
\renewcommand{\partpagestyle}{empty}
\renewcommand{\chapterpagestyle}{scrheadings}
\usepackage{afterpage}
\usepackage{lipsum}
\begin{document}
\captionof{figure}{picture}
\captionof{figure}{picture}
\captionof{figure}{picture}
\lipsum[7-15]
Figure \ref{Big picture}

\afterpage{
\clearpage
This page should be replaced in a second step.
\captionof{figure}{Big picture}\label{Big picture}
\clearpage
}

\lipsum[1-15]
\end{document}

And replacing the placeholders in a second step:

\documentclass{scrreprt}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=1-2]{mydoc.pdf}% pages before dummy page
%
\storeareas\savedlayout
\clearpage
\setcounter{figure}{3}% set the figure number
\KOMAoptions{paper=a3,paper=landscape,DIV=20}
\centering
\includegraphics[height=.95\textheight,width=\linewidth]{example-image}
\captionof{figure}{Big picture}
\clearpage
\savedlayout
%
\includepdf[pages=4-]{mydoc.pdf}% pages after the dummy page
\end{document}

You must log in to answer this question.

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