Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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]
    \AddToShipoutPicture*
        {\put(500,700){\includegraphics[width=3cm,height=2cm]{image}}}
    \end{document}
    

enter image description here

  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}
    

enter image description here

share|improve this answer
    
Thank you :) for your answer –  equality Aug 7 '12 at 19:02
add comment

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}

wrapfigure

share|improve this answer
    
Thank you very much for answering! :) –  equality Aug 7 '12 at 18:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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