3

If I insert a full-page image with height > \textheight, then an empty page will be inserted before the image. How can I avoid that?

See minimal example:

\documentclass[twocolumn]{scrbook}
\usepackage{epigraph}% needed for \cleartoevenpage
\usepackage{graphicx}% needed for \includegraphics
\usepackage[left=2.2cm,right=2.2cm,bottom=2.6cm,top=3.2cm]{geometry}
% beschnittrand (what is that called in english?)
\usepackage[cam,noinfo,width=9.15278in,height=12.5833in,center]{crop}

\newcommand{\FullPageImg}[2][width=\textwidth]{% insert large image
    \onecolumn% otherwise there will be too much white space on the left side
    \cleartoevenpage% image shall be on the left side
    \thispagestyle{empty}% no page number
    \vspace*{-38mm}% move image to top of page
    \noindent\makebox[\textwidth]{\includegraphics[#1]{#2}}%include image
    \clearpage%continue on next page
    \twocolumn%switch back to twocolumn style
}
\begin{document}
this is a book. 
this page contains some twocolumn text. 
the following page should contain a fullpage image, but it is empty. 
the page after the image contains again some text.
\FullPageImg[width=214mm,height=301mm,draft]{./graphics/somegraphicsfile.png}%
some text on the page after the image
\end{document}

Expecting: a 3-page document

Getting: a 4-page document

If height is set to 30mm instead of 301mm, the empty page won't be there.

1
  • In an MWE you might use example-image for any image which should be included. For a bit of variance there are example-image-a, example-image-b and example-image-c, too.
    – Skillmon
    Commented Aug 21, 2017 at 18:13

1 Answer 1

4

Because your setup doesn't lie to LaTeX about the height of the box, it is detected to be too high and therefore LaTeX skips a page. The following does tell LaTeX that the contents are \textheight high and \textwidth wide:

\documentclass[twocolumn]{scrbook}
\usepackage{epigraph}% needed for \cleartoevenpage
\usepackage{graphicx}% needed for \includegraphics
\usepackage[left=2.2cm,right=2.2cm,bottom=2.6cm,top=3.2cm]{geometry}
% beschnittrand (what is that called in english?)
\usepackage[cam,noinfo,width=9.15278in,height=12.5833in,center]{crop}

\newcommand{\FullPageImg}[2][width=\textwidth]{% insert large image
    \onecolumn% otherwise there will be too much white space on the left side
    \cleartoevenpage% image shall be on the left side
    \thispagestyle{empty}% no page number
    \vspace*{-38mm}% move image to top of page
    \noindent\vbox to \textheight{%
        \hbox to \textwidth{%
            \hskip0.5\textwidth\makebox[0pt][c]{\includegraphics[#1]{#2}}}}%include image
    \clearpage%continue on next page
    \twocolumn%switch back to twocolumn style
}
\begin{document}
this is a book. 
this page contains some twocolumn text. 
the following page should contain a fullpage image, but it is empty. 
the page after the image contains again some text.
\FullPageImg[width=214mm,height=301mm]{example-image}%
some text on the page after the image
\end{document}
0

You must log in to answer this question.

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