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.

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...

share|improve this question
    
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 Aug 5 '11 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. –  Martin Scharrer Aug 5 '11 at 16:38
add comment

1 Answer

up vote 5 down vote accepted

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).

share|improve this answer
    
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 Aug 6 '11 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 Aug 7 '11 at 15:52
add comment

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.