2

I'm trying to insert an image at the upper left corner, and then move it down toward the center of the page. Similar questions lead me to try the following:

\documentclass{article}
\usepackage{fullpage}
\usepackage{eso-pic} 
\usepackage{graphics}

\AddToShipoutPictureBG{%
\AtPageUpperLeft{\raisebox{-\height}{\hspace*{1cm}\vspace*{-1cm}
         \includegraphics[width=1.5in]{/Path/To/Image/animage.png}}}
}
\begin{document}
some words
\end{document}

It works for the horizontal shift, but not the vertical shift. How can I fix this?

1

You can define a point by yourself in the following manner:

\newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
 \put(\LenToUnit{1cm},\LenToUnit{-1cm}){#1}%
 }}%

Change 1cm and -1cm as you wish.

Full code:

\documentclass{article}
%% \usepackage{fullpage}  %% Use geometry instead
\usepackage{eso-pic}
\usepackage{graphicx}
\newcommand\AtPageUpperMyleft[1]{\AtPageUpperLeft{%
 \put(\LenToUnit{1cm},\LenToUnit{-1cm}){#1}%
 }}%
\AddToShipoutPictureBG{%
\AtPageUpperMyleft{\raisebox{-\height}{%
         \includegraphics[width=1.5in]{example-image-a}}}
}
\begin{document}
some words
\end{document}

enter image description here

Here is another option with tikz:

\documentclass{article}
%% \usepackage{fullpage}  %% Use geometry instead
\usepackage{eso-pic}
\usepackage{tikz}

\AtBeginDocument{%
    \AddToShipoutPictureBG{%
      \begin{tikzpicture}[overlay,remember picture]
        \node[anchor=north west] at ([shift={(1cm,-1cm)}]current page.north
                  west){\includegraphics[width=1.5in]{example-image-a}};
      \end{tikzpicture}
    }%
  }
\begin{document}
some words
\end{document}

Change the shift={(1cm,-1cm) as you wish. This takes atleast 2-3 compilation runs to settle down.

  • You can also use the background package if you wish. – user11232 Aug 8 '14 at 5:17

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.