3

I would like to position a logo at 1cm top, 1cm left. However if I use (1, -1) this takes in account the geometry margins. With (current page.north west), I don't have offesets.

\documentclass[11pt]{article}
\usepackage[a4paper,left=3.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}

\begin{document}
\begin{tikzpicture}[remember picture, overlay, anchor=west]
    \node[anchor=north west, inner sep=0pt] (logo) at (current page.north west) {%
    \includegraphics[height=2cm]{logo.pdf} \\
    Foobar
    };
\end{tikzpicture}

How can I position my node from an absolute position?

1
  • If you want to shift a position, use the shift keys: either xshift=1cm, yshift=-1cm or shift={(1cm, -1cm)}. That can be done either as options to the \node or as options to the at coordinate. Commented Aug 22, 2022 at 12:11

2 Answers 2

5

Another possibility: use \path ... node

\documentclass[11pt]{article}
\usepackage[a4paper,left=3.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[remember picture, overlay]
    \path (current page.north west) +(1,-1) node[anchor=north west, inner sep=0pt, align=center] (logo) {% \includegraphics[height=2cm]{example-image} \\
    Foobar
    };
\end{tikzpicture}
\end{document}
1
  • It should be noted that in non-overlay cases the bounding box will include that first coordinate which doesn't happen when [x|y]shifting or even calc's ($(current page.north west)+(1,-1)$) are used. Commented Aug 22, 2022 at 12:17
4

Apply the shift to the at parameter:

\documentclass[11pt]{article}
\usepackage[a4paper,left=3.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[remember picture, overlay, anchor=west]
    \node[anchor=north west, inner sep=0pt, align=center] (logo) at ([shift={(1cm,-1cm)}]current page.north west) {%
    \includegraphics[height=2cm]{example-image} \\
    Foobar
    };
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

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