Here's my shot at it without crop
, geometry
, or eso-pic
.
I'm assuming you need the color to bleed over the trim, and therefore need the background underneath the crop marks (that's what the first, mystical line does).
Note the use of memoir
dimensions. All you need to do to remove/add the trims is to update \setstocksize
and \settrims
\RequirePackage{atbegshi}\AtBeginShipoutInit
\documentclass[10pt,twoside,showtrims]{memoir}
\setstocksize{216mm}{154mm}
\settrimmedsize{210mm}{148mm}{*}
\settrims{3mm}{3mm}
\setulmarginsandblock{20mm}{22mm}{*}
\setlrmarginsandblock{20mm}{20mm}{*}
\checkandfixthelayout
\trimLmarks
\usepackage{xcolor}
\newcommand{\bgleft}{{\color{yellow}\rule{\stockwidth}{\stockheight}}}% Background for even pages
\newcommand{\bgright}{{\color{green}\rule{\stockwidth}{\stockheight}}}% Background for odd pages
\usepackage{picture}
\usepackage{ifthen}
\usepackage{lipsum}
\begin{document}
\AtBeginShipout{%
\AtBeginShipoutUpperLeft{%
\ifthenelse{\isodd{\thepage}}%
{\put(0,-\stockheight){\bgright}}%
{\put(0,-\stockheight){\bgleft}}%
}%
}
\lipsum[1-15]
\end{document}
Following Meho's comments, I went back to the drawing-board, and here's the result. I haven't parameterised the image size, the trimmed size, nor yet the 3mm difference, but I believe this solution works (is correct?, even), for any arbitrary stock size and trimming geometry that ends up at A5 after trimming.
I have halved the size of the coloured backgrounds to help in testing. Their north-east corners correspond to the center point of Meho's images.
Uncomment the lines shown and tinker with the values there -- the coloured boxes should not move relative to the page (and text).
Here it is, then:
\RequirePackage{atbegshi}\AtBeginShipoutInit
\documentclass[10pt,twoside,draft,showtrims,a5paper]{memoir}
\settypeoutlayoutunit{mm}
\usepackage{lipsum}
\usepackage{ifthen}
\usepackage{picture}
\usepackage{xcolor}
\settrimmedsize{210mm}{148mm}{*}
% Un-comment to play with stock size and trimming arrangements
% \setstocksize{256mm}{184mm}
% \settrims{10mm}{10mm}
\setulmarginsandblock{20mm}{22mm}{*}
\setlrmarginsandblock{20mm}{30mm}{*}
\checkandfixthelayout
\trimLmarks
\newcommand{\bgleft}{{\color{yellow!50}\rule{77mm}{108mm}}}% Background for even pages
\newcommand{\bgright}{{\color{green!50}\rule{77mm}{108mm}}}% Background for odd pages
\newlength{\yboth}
\newlength{\xrecto}
\newlength{\xverso}
\yboth=\dimexpr\trimtop+\paperheight+3mm
\xrecto=\dimexpr\stockwidth-\trimedge-\paperwidth-3mm
\xverso=\dimexpr\trimedge-3mm
\AtBeginShipout{%
\AtBeginShipoutUpperLeft{%
\ifthenelse{\isodd{\thepage}}%
{\put(\xrecto,-\yboth){\bgright}}%
{\put(\xverso,-\yboth){\bgleft}}%
}%
}
\begin{document}
\lipsum[1-15]
\end{document}
Looks to me like a bug in the code. The package switches to twoside within the calculations for the layout=a5paper
but neglects to move the whole area within the paper area as well (which it should in that case, I would say).
So I guess the answer is to do this manually:
\makeatletter
\newlength\hcorr
\setlength\hcorr{\paperwidth}
\addtolength\hcorr{-\Gm@layoutwidth}
\makeatother
\geometry{layouthoffset=.5\hcorr,
layoutvoffset=1in}
The value of \Gm@layoutwidth
is simply the internal width calculated by the layout=
key or specified by layoutwidth=
. The assumption is that \paperwidth
minus that length divided by 2 puts our page smack in the middle horizonatally. And the layoutvhoffset=1in
is just there to move the top cropmark onto the paper, you may not want that.
Best Answer
You can use the
crop
package to place your pages on a A4 paper. It can center and frame it for you:It looks like this:
If you don't like the info line above the frame use the
noinfo
package option.