Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is what I'm trying to do... Please note that the images that will be used in the final version are of slightly uneven size, so that should ideally be taken into account. I've been through the usual suspects and hope someone can help!

Normal pages should look like this:

enter image description here

Pages with a background image (and no text whatsoever) like this:

enter image description here

Close up, notice the crop marks:

enter image description here

I'm using memoir with showtrims (custom page size), here's an MWE in just in case...

\documentclass[book,openany,showtrims]{memoir}
%  Crop settings via  http://latex-my.blogspot.dk/2009/10/setting-page-size -and-margins.html

%% The stock paper size
\setstocksize{236mm}{161mm}

%% The 'real' page size
\settrimmedsize{230mm}{155mm}{*}

%% The stock paper will be trimmed 3mm from the
%% top edge and 3mm from the left edge
\settrims{3mm}{3mm}

%% Spine and trim page margins from main typeblock
\setlrmarginsandblock{20mm}{15mm}{*}

%% Top and bottom page margins from main typeblock
\setulmarginsandblock{20mm}{20mm}{*}

%% Header occupies height of a single line;
%% Bottom edge of footer is 7mm from bottom edge
%% of typeblock
\setheadfoot{\baselineskip}{7mm}

%% Bottom edge of header is 7mm from top edge of
%% typeblock
\setlength\headsep{7mm}

\checkandfixthelayout

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\begin{document}
 Bla
\end{document}
share|improve this question
    
It seems that this might be relevant, but the crop marks and the scaling is not as it should be in my case... –  Kristian Nordestgaard Jul 20 '13 at 20:08
1  
Nothing to do with the question but do not forget to use the microtype package for improved typography. –  pluton Jul 20 '13 at 22:17
1  
WHen you say "Pages with a background image (and no text whatsoever)", are those pages float only pages automatically produced by the floating mechanism or are those pages manually created? –  Gonzalo Medina Jul 20 '13 at 22:27
    
Dupe of tex.stackexchange.com/questions/46280/… in addition to all that you should set the trim and bleed pdf boxes. –  WillAdams Jul 21 '13 at 1:55
    
@GonzaloMedina - they're manually created! –  Kristian Nordestgaard Jul 21 '13 at 6:28

1 Answer 1

up vote 6 down vote accepted

Here's a possible solution. The "behind" part of the question is addressed in SNIPLET C.5 (BACKGROUND IMAGE AND TRIMMARKS) of the memoir manual:

This sniplet comes from another problem described in CTT. If one use the eso-pic package to add a background image, this image ends up on top of the trim marks. To get it under the trim marks Rolf Niepraschk suggested the following trick

\RequirePackage{atbegshi}\AtBeginShipoutInit
\documentclass[...,showtrims]{memoir}
...
\usepackage{eso-pic}
...

The "beyond" part can be solved using TikZ and its current page node. I defined a command \AddBackground to be placed on those pages where the background should appear (according to a comment to the question, these pages are manually created).

The code:

\RequirePackage{atbegshi}
\AtBeginShipoutInit
\documentclass[book,openany,showtrims]{memoir}

\setstocksize{236mm}{161mm}
\settrimmedsize{230mm}{155mm}{*}
\settrims{3mm}{3mm}
\setlrmarginsandblock{20mm}{15mm}{*}
\setulmarginsandblock{20mm}{20mm}{*}
\setheadfoot{\baselineskip}{7mm}
\setlength\headsep{7mm}
\checkandfixthelayout

\usepackage{eso-pic}
\usepackage{tikz}
\usepackage{lipsum}

\definecolor{bgcolor}{RGB}{220,123,228}

\newcommand\AddBackground{%
\AddToShipoutPictureBG*{%
\AtPageCenter{%
\tikz[remember picture,overlay]
\fill[bgcolor] 
  ([xshift=5pt,yshift=5pt]current page.south west) 
  rectangle 
  ([xshift=12pt,yshift=12pt]current page.north east);}}%
}

\begin{document}

\lipsum[1-4]
\clearpage
\AddBackground%
\null\vfill
{\centering\Huge IMAGE\par}
\vfill
\clearpage
\lipsum[1-4]

\end{document}

enter image description here

A close-up showing the desired positioning of the background with respect to the crop marks:

enter image description here

Of course, the same principle can be applied with an included image:

\RequirePackage{atbegshi}
\AtBeginShipoutInit
\documentclass[book,openany,showtrims]{memoir}

\setstocksize{236mm}{161mm}
\settrimmedsize{230mm}{155mm}{*}
\settrims{3mm}{3mm}
\setlrmarginsandblock{20mm}{15mm}{*}
\setulmarginsandblock{20mm}{20mm}{*}
\setheadfoot{\baselineskip}{7mm}
\setlength\headsep{7mm}
\checkandfixthelayout

\usepackage{eso-pic}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]
\clearpage
\null\AddToShipoutPictureBG*{%
\tikz[remember picture,overlay]
\node at ([xshift=8pt,yshift=8.5pt]current page.center)
  {\includegraphics[width=\dimexpr\paperwidth+10pt\relax,height=\dimexpr\paperheight+10pt\relax]{example-image-a}};}
\clearpage
\lipsum[1-4]

\end{document}

enter image description here

And a close-up:

enter image description here

share|improve this answer
    
I knew I had written that down somewhere ;-) –  daleif Aug 12 '13 at 19:29
    
Thanks, this seems to work! –  Kristian Nordestgaard Aug 13 '13 at 20:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.