5

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?

2 Answers 2

7

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

0
5

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

1
  • Thank you so much. I was just looking for something you provided. Very useful and to the point.
    – Yes
    Commented May 12, 2015 at 9:41

You must log in to answer this question.

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