3

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.

3
  • Use textpos package, as described here tex.stackexchange.com/questions/6185/…
    – alfC
    Aug 20 '12 at 21:34
  • If you are using TikZ and the remember picture option to tikzpicture you can place the logo in a \node positioned relative to the current page coordinate. Aug 20 '12 at 21:48
  • How do you want your title page to look like? Can you post a picture of what exactly you have in mind (may be using some other editor like word)?
    – user11232
    Aug 20 '12 at 23:04
10

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}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.