我想将包含的 PDF 放置在双面文档中,实际尺寸为 C5,但打印在 A4 纸上,显示裁剪标记。包含的 PDF 已设置hmarginratio
为 2:3,因此我需要正确居中。下面的示例正确放置在右侧。
\documentclass[ %draft
% , demo % black boxes instead of figures
, 8pt, a4paper, twoside, openright]{extbook}
\usepackage%[showframe]
{geometry}
% Basic geometry of document
\geometry
{ headsep = \baselineskip
, textwidth = 42\baselineskip
, textheight = 60\baselineskip
, hmarginratio = 2:3
, vmarginratio = 2:3
, bindingoffset = 0cm
, onecolumn
, layout=c5paper
, layoutoffset = {2cm,2cm}
, showcrop
}
% Geometry of the cover pages
\newcommand\covergeometry{\newgeometry
{ textwidth = 42\baselineskip
, textheight = 60\baselineskip
, hmarginratio = 1:1
, vmarginratio = 2:3
, bindingoffset = 0cm
, onecolumn
, layout=c5paper
, layoutoffset = {2cm,2cm}
, showcrop
}}
\usepackage{pdfpages}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\clearpage
\lipsum[1-2]
\clearpage
\lipsum[1-2]
\clearpage
\lipsum[1-2]
\clearpage
\lipsum[1-2]
\clearpage
\covergeometry
\makeatletter
\includepdf[
pages={2,1,3,4},
turn=false,
width=\Gm@layoutwidth,
height=\Gm@layoutheight,
offset={\dimexpr(\Gm@layoutwidth-\paperwidth)/2+\Gm@layouthoffset\relax}
{\dimexpr(\paperheight-\Gm@layoutheight)/2-\Gm@layoutvoffset\relax}
]{gram.pdf}
\makeatother
\restoregeometry
\clearpage
\end{document}
答案1
在几何设置中将布局偏移居中
, layouthoffset=\dimexpr(\paperwidth-\csname Gm@layoutwidth\endcsname)/2\relax
, layoutvoffset = 2cm
结合调整包含的 pdf 的偏移量有助于调整包含的 pdf。
offset={\dimexpr(\paperwidth-\csname Gm@layoutwidth\endcsname)/2-\csname Gm@layouthoffset\endcsname\relax}
{\dimexpr(\paperheight-\csname Gm@layoutheight\endcsname)/2-\csname Gm@layoutvoffset\endcsname\relax}