1

I'm trying to insert a fullpage picture into a document taking into account a 3mm bleed. I've used the zwpagelaout package to setup my page and tikz to position / scale the image. I'm able to draw a rectangle at the right position with the right size but the image is not positioned correctly for some reason. Image background.png size is 1819 × 2551 pixels at 300dpi which corresponds to 154mmx216mm.

\documentclass[a5paper]{article}
\usepackage{graphicx}
\usepackage[a5, margins=0mm, croplength=10mm,
                cropgap=3mm, cropmarks, cropframe]{zwpagelayout}
% \usepackage{fgruler}
\usepackage{tikz}

\begin{document}

% This not positioned correctly
\begin{tikzpicture}[remember picture,overlay, shift={(current page.north west)}]
  \node[anchor=north west,xshift=-3mm,yshift=-3mm]{
    \includegraphics[width=154mm]{background.png}};
\end{tikzpicture}

% This is positioned correctly
\begin{tikzpicture}[remember picture,overlay,shift={(current page.south west)}]
  \draw[black,xshift=-3mm,yshift=-3mm] (0mm,0mm) rectangle (154mm,216mm);
\end{tikzpicture}

\end{document}

Edit Adding inner sep=0pt seems to fix the x positioning, and the "right" y shift seems to be -23mm that corresponds to 2xcroplength+3mm.

enter image description here

1 Answer 1

2

It is a known problem that crop (which is used in the zwpagelayout package) messes up with current page. I tried to draw a rectangle connecting all four current page corners and it seems that the south west corner of this rectangle sits at the right place, but the north east corner sits far off outside the actual paper, which results in wrong placement of the picture if you anchor it to the north or east.

As you already found that using current page.south west as anchor seems to work, you could just anchor the image to this coordinate as well. Further, it is probably a bit more straighforward to position the node that includes the image directy without shifting the whole tikzpicture. Also, you should of course set the inner sep of the node to zero. The following should be working:

\documentclass[a5paper]{article}
\usepackage{graphicx}
\usepackage[a5, margins=0mm, croplength=10mm,
                cropgap=3mm, cropmarks, cropframe]{zwpagelayout}
% \usepackage{fgruler}
\usepackage{tikz}

\begin{document}

% This should be positioned correctly
\begin{tikzpicture}[remember picture, overlay]
  \node[anchor=south west, inner sep=0pt, xshift=-3mm, yshift=-3mm] at (current page.south west) {\includegraphics[width=154mm]{background.png}};
\end{tikzpicture}

\end{document}

The result should then be something like this:

enter image description here

You must log in to answer this question.

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