[Tex/LaTex] How to position a picture precisely on a page

graphicspositioning

I’m new to Latex and I’m trying to place a picture (my university’s logo) at an exact spot on my titlepage. For this, I would like to specify the coordinates on the page at which I would like the picture to be placed.

Up to now, I have written the following code, but it doesn’t work.

\documentclass{article}
%...
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}

\begin{document}

\begin{titlepage}

\begin{tikzpicture}[overlay, remember picture]
%...
\begin{picture} (10cm, 10cm) (0cm, 0cm)
\put(0.5cm, 0.5cm) {\includegraphics [width=5cm]{logo}} 
\end{picture}
%...
\end{tikzpicture} 

\end{titlepage}
%...
\end{document}

When I compile it (Pdftex, using TeXShop), the following error message appears:

./Sans-titre.tex:56: Illegal unit of measure (pt inserted).
<to be read again> 
               \setbox 
l.56    \begin{picture} (10cm, 10cm) (0cm, 0cm)

Also, I will need to write some text and draw lines at specific spots on my title page, and I fear I will encounter the same problems.

Best Answer

You are mixing two graphic systems (tikz and the original picture environment of latex). With tikz you should place graphics (and text) with nodes:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{graphicx}

\begin{document}

\begin{titlepage}

\begin{tikzpicture}[overlay, remember picture]
\node[anchor=north west, %anchor is upper left corner of the graphic
      xshift=5cm, %shifting around
      yshift=-5cm] 
     at (current page.north west) %left upper corner of the page
     {\includegraphics[width=5cm]{tiger}}; 
\end{tikzpicture}

\end{titlepage}
\end{document}
Related Question