如果我插入高度大于 的全页图像\textheight
,则图像前会插入一个空白页。我该如何避免这种情况?
查看最小示例:
\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}
预期:一份 3 页的文档
获取:一份 4 页的文件
如果height
设置为30mm
而不是301mm
,则不会出现空白页。
答案1
由于您的设置没有向 LaTeX 提供关于框高度的信息,因此检测到框太高,因此 LaTeX 跳过了一页。以下内容确实告诉 LaTeX 内容的\textheight
高度和\textwidth
宽度:
\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}