16

I am trying to add a background image at the upper right corner of my titlepage with 1cm margins to the top and the right.

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\title{Test}
\author{Test}
\date{\today}

\usepackage{eso-pic}
\usepackage[demo]{graphicx}

\providecommand*\LenToUnit[1]{#1\@gobble}

\newcommand\AtPageUpperRight[1]{\AtPageUpperLeft{
\put(\LenToUnit{0.5\paperwidth},\LenToUnit{-1cm}){#1}}
}

\begin{document}

\AddToShipoutPictureBG*{
 \AtPageUpperRight{\raisebox{-\height}{\includegraphics{logo.pdf}}}
}

\maketitle

\end{document}

Is it possible to right align the image?

1

2 Answers 2

6
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\title{Test}
\author{Test}
\date{\today}
\usepackage{eso-pic}
\usepackage[demo]{graphicx}
\newcommand\AtPageUpperRight[1]{\AtPageUpperLeft{%
   \makebox[\paperwidth][r]{#1}}}
\begin{document}

\AddToShipoutPictureBG*{%
  \AtPageUpperRight{\raisebox{-\height}{\frame{\includegraphics[width=8cm]{Uni-Logo}}}}}
\maketitle

\end{document}

enter image description here

10
  • Thanks for your answer but it only works with demo options. "LaTeX Error: Cannot determine size of graphic in logo.pdf (no BoundingBox)." How can i set margins to the right and top?
    – SLx64
    Commented Jun 13, 2014 at 9:06
  • did you run pdflatex?
    – user2478
    Commented Jun 13, 2014 at 10:25
  • Yes, i used pdflatex.
    – SLx64
    Commented Jun 13, 2014 at 10:38
  • Then your image is buggy. Can you provide it for a download?
    – user2478
    Commented Jun 13, 2014 at 10:52
  • I do not open exe files ...
    – user2478
    Commented Jun 13, 2014 at 10:57
15

Piece of cake with tikz

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\title{Test}
\author{Test}
\date{\today}

\usepackage{tikz}    
\begin{document}
\maketitle
\begin{tikzpicture}[remember picture,overlay]
   \node[anchor=north east,inner sep=0pt] at (current page.north east)
              {\includegraphics[scale=0.2]{example-image-a}};
\end{tikzpicture}

\end{document}

enter image description here

2
  • How do I put the picture in the bottom right corner? I tried to replace north with south and east with west but that won't work :(
    – Coxa
    Commented Aug 18, 2015 at 14:03
  • 1
    @Coxa anchor=south east and at (current page.south east). i.e., \node[anchor=south east,inner sep=0pt] at (current page.south east) {\includegraphics[scale=0.2]{example-image-a}};
    – user11232
    Commented Aug 18, 2015 at 14:43

You must log in to answer this question.

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