10

I need to include a jpg into my document created with memoir as a full separate page. The jpg is colored and has 3 mm bleed out into the stock paper. A bit naively I thought I could just use negative vspace and hspace but it is not working very intuitively. This is my attempt for the moment:

\documentclass[showtrims, 10pt]{memoir}

\stockaiv
\settrims{20mm}{20mm}
\trimFrame

\pagesmallroyalvo

\setbinding{4mm}
\settypeblocksize{*}{24.5pc}{1.618}
\setlrmargins{*}{*}{1.5}
\setulmarginsandblock{6pc}{7pc}{*}
\setmarginnotes{6pt}{6pc}{12pt}
\strictpagecheck
\setlength{\topskip}{1.6\topskip}
\checkandfixthelayout
\sloppybottom

\begin{document}

\pagestyle{empty}
\cleardoublepage

\vspace*{-\uppermargin}
\vspace*{-6mm} % no idea where this space is comming from
\vspace*{-3mm}
\hspace*{-\spinemargin}
\hspace*{-5mm} % no idea where this space is comming from
\hspace*{-3mm}
% input a page sized jpg with 3 mm bleed
\includegraphics{page.jpg}

\end{document}

EDIT: I have hacked up something looking like what I have written above. There are some magic numbers there though. I would love to udnerstand where they are comming from...

2
  • I realised that \trimtop is the diff between the stock paper so I don't want that there. I also realised that I can't have a white line before the \includegraphics so changd those two things. However there is still som air left between the paper border and my figure and I don't know where it comes from... Oh nd thre was a missing - before the 3mm but that was just a typo... :)
    – jonalv
    Commented Aug 5, 2011 at 15:20
  • I would just convert the JPG into a PDF and use the pdfpages package: \includepdf{image}. Maybe it even works with JPGs directly. Commented Aug 5, 2011 at 16:38

1 Answer 1

12

Option 1: Using the eso-pic package.

The eso-pic package provides a means to add content to the background|foreground of a|every page using a number of commands:

  • \AddToShipoutPictureBG: Content added to background of every page;
  • \AddToShipoutPictureBG*: Content added to background of current page;
  • \AddToShipoutPictureFG: Conent added to foreground of every page;
  • \AddToShipoutPictureFG*: Content added to foreground of current page.

The default coordinate origin for content placement is the lower-left corner of the page (also obtained through the package option pscoord), but this can be modified to the upper-left corner of the page if needed (by using the package option texcoord).

Additional macros for placing content at predefined locations is provided by (with their meaning being obivous)

  • \AtPageUpperLeft
  • \AtPageLowerLeft
  • \AtPageCenter
  • \AtTextUpperLeft
  • \AtTextLowerLeft
  • \AtTextCenter
  • \AtStockUpperLeft
  • \AtStockLowerLeft
  • \AtStockCenter

The definitions of \..Stock..., \..Page... and \..Text coincide with memoir's use of the lengths \stock..., \paper... and \text.... Consequently, using your document preamble settings, the following minimal example

\documentclass[showtrims, 10pt]{memoir}
\usepackage{lipsum}% Dummy text/Lorem Ipsum
\usepackage{eso-pic}% www.ctan.org/pkg/eso-pic
\usepackage{graphicx}
...
\begin{document}

\pagestyle{empty}

\lipsum[1-5]% Dummy text/Lorem Ipsum

\clearpage \null
\AddToShipoutPictureBG*{% Add picture to current page
  \AtStockLowerLeft{% Add picture to lower-left corner of paper stock
    \includegraphics[width=\stockwidth,height=\stockheight]{tiger}}% http://latex.tug.org/texlive/devsrc/Master/texmf-dist/doc/generic/pstricks/images/tiger.eps
}
\clearpage

\lipsum[6-10]% Dummy text/Lorem Ipsum

\end{document}

produces

Image on single page using eso-pic

I would assume the lengths used here are much more self-explanatory, and can be modified (if needed) to produce exactly what you want.


Option 2: Using the pdfpages package.

The pdfpages package allows for the inclusion of external documents using the \includepdf[...]{...} command. It can even include images in the formats supported by pdfTeX (PNG, JPG, etc.), although this has to be explicitly specified in the form <image.ext>. Using a similar setup as above, you would use

\includepdf[noautoscale]{<image.ext>}

to insert <image.ext> without scaling into your document. Assuming that your image is sized exactly as needed, this should also produce the desired result. See the package documentation for more options (like fitpaper=true if you want the paper to sized accord to your image; this would allow you to use your printer's "Fit to page" printing option).

2
  • I am trying option 1 but since I have bleed on my pictures I need to use \AtPageLowerLeft and somehow remove some space. I can get \hspace*{-6mm} to work but for some reason I can't get \vspace*{6mm} to do anything. Is there a reason for why vertical space doesn't work inside the block you suggest?
    – jonalv
    Commented Aug 6, 2011 at 8:55
  • @jonalv: For horizontal alignment, \hspace[*]{>len>} should work fine. For vertical alignment, use \raisebox{<len>}{<stuff>} from the graphicx package. In your case, \raisebox{-6mm}{<image>} should work.
    – Werner
    Commented Aug 7, 2011 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .