2

Is it possible to add a full bleed image to a page, using the memoir class, without resorting to using the geometry package or to manual adjustment?

The best option I've found so far is to manually add negative \vspace and \hspace, but it requires you to manually adjust the amount, and it seems like there should be a better way.

Here is a minimal working example, using stock that is 6mm wider and longer than A5 in order to get 3mm bleed on every edge.

\documentclass[showtrims, 11pt, twoside]{memoir}
\usepackage{showframe}
\usepackage[utf8]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage{graphicx}
\graphicspath{ {./} }

\setstocksize{216mm}{154mm}
\settrimmedsize{210mm}{148mm}{*}
\settrims{3mm}{3mm}
\setlrmarginsandblock{18mm}{15mm}{*}
\setulmarginsandblock{15mm}{15mm}{*}
\checkandfixthelayout
\title{memoirlayouttest}
\author{SMuJ}
\date{July 2024}
\begin{document}
\vspace*{-\uppermargin}
\vspace*{-5mm}
\hspace*{-\spinemargin}
\hspace*{-7mm}
\includegraphics[width=\stockwidth]{test}
\end{document}

This produces the following result. It works, but it seems like there should be better way to do this without manual adjustment. Is there?

Result of minimal working example

N.b. I don't need to add text to this page as well (i.e. it's not a background image, it's an illustration that should take up the entire page). So one other option I considered would be to change the trims and margins for that page only so that the text block takes up the entire stock size, and then add an image that is the full \stockwidth

1 Answer 1

2
\documentclass[showtrims, 11pt, twoside]{memoir}
\usepackage{showframe}
\usepackage[UKenglish]{babel}
\usepackage{graphicx}
\graphicspath{ {./} }

\setstocksize{216mm}{154mm}
\settrimmedsize{210mm}{148mm}{*}
\settrims{3mm}{3mm}
\setlrmarginsandblock{18mm}{15mm}{*}
\setulmarginsandblock{15mm}{15mm}{*}
\checkandfixthelayout
\title{memoirlayouttest}
\author{SMuJ}
\date{July 2024}
\begin{document}
\AddToHookNext{shipout/background} %or shipout/foreground
{\put(0,-\stockheight){\includegraphics[width=\stockwidth,height=\stockheight]{example-image}}}
\mbox{}
\clearpage
next page
\end{document}

utf8 is the default since 6 years, so inputenc is no longer needed.

4
  • This works really well, thank you! In this case, why does the \put command work outside the picture environment?
    – SMuJ
    Commented Jul 14 at 13:42
  • 1
    there is a picture environment around the hook. Commented Jul 14 at 13:48
  • Ah, that makes sense, thanks! Is the purpose of \mbox{} just to add content so there's something for latex to process?
    – SMuJ
    Commented Jul 14 at 14:01
  • yes, there must be something on the page. Commented Jul 14 at 14:03

You must log in to answer this question.

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