Here's the situation:
I have to use
memoir
(v3.6j), withgeometry
(v5.6) andLuaTeX
, version beta-0.70.1-2011061410 (rev 4277) in an A5 project which, in the final output have to be 3mm larger from any side, i.e., PDF dimensions should be 154x216mm. I usecrop
(v1.9) package for crop marks and setting the correct paper size.The project has two background images, each for both left and right pages, which fit 154x216mm size. For this purpose, I have to use
eso-pic
(v2.0c) this time (though suggestions regardingbackground
andwallpaper
packages are most welcome).Though I can manually tweak the position of those background images, I'd like to know if there is an automatic way to place them exactly centered regarding the page, if possible independent of changing paper dimensions with
crop
package (comment l.13, and uncomment l.14).
Here is a sample document code.
\documentclass[10pt,twoside]{memoir}
\DisemulatePackage{geometry}
\DisemulatePackage{crop}
\usepackage{geometry}
\geometry{%
papersize={148mm,210mm},%
hmargin={2cm,2cm},%
vmargin={2cm,2.2cm},
showframe}
\usepackage[width=15.4cm,height=21.6cm,center,cam]{crop}
%\usepackage[width=16.3cm,height=22.5cm,center,cam]{crop}
\usepackage{xcolor}
\newcommand{\bgleft}{{\color{yellow}\rule{154mm}{216mm}}}% Background for even pages
\newcommand{\bgright}{{\color{green}\rule{154mm}{216mm}}}% Background for odd pages
\usepackage{eso-pic}
\usepackage{ifthen}
\usepackage{lipsum}
\begin{document}
\AddToShipoutPicture{\ifthenelse{\isodd{\thepage}}%
{\bgright}%
{\bgleft}
}
\lipsum[1-15]
\end{document}
geometry
package would be ideal, since these dimensions are constant and do not change (with a note that background should be allowed to exceed margins and page boundaries), unlike paper dimensions set bycrop
package.