# How to put a picture to the top right of a page?

I have written in TeX the following:

\section{A}
... somethingA ...

\begin{picture}(100, 100)(-250, -110)
\includegraphics[scale=1]{face.png}
\end{picture}

\section{B}
... somethingB ...


I have put specific parameters in picture (-250, -110) so that the picture is added in the top right of the created page. Although this works just fine, face.png appears where I want it, the problem is that there is a big gap between somethingA and somethingB. So I have something like this in the created document:

... somethingA ...

... somethingB ...


Any ideas how to solve this?

-

There are several possibilities:

1. Using the eso-pic package:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{eso-pic}
\usepackage{lipsum}

\begin{document}
\lipsum[1-3]
{\put(500,700){\includegraphics[width=3cm,height=2cm]{image}}}
\end{document}


1. Using TikZ:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usepackage{lipsum}

\begin{document}
\lipsum[1-3]
\begin{tikzpicture}[overlay, remember picture]
\node[xshift=-3cm,yshift=-2cm] at (current page.north east) {\includegraphics[width=3cm,height=2cm]{image}};
\end{tikzpicture}

\end{document}


-
Thank you :) for your answer –  equality Aug 7 '12 at 19:02

Maybe the package wrapfig might solve your problem.

Try this code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[demo]{graphicx}
\usepackage{blindtext}
\usepackage{wrapfig}

\begin{document}

\section{A}

\begin{wrapfigure}{r}{3cm}
\includegraphics{test}
\end{wrapfigure}

\blindtext

\section{B}
\blindtext

\end{document}


-
Thank you very much for answering! :) –  equality Aug 7 '12 at 18:52