2

I want to add an image in a text with the following code:

\documentclass[english]{article}
\usepackage{babel}
\usepackage{graphicx}

\newcommand*\lavanda{\vcenter{\hbox{\includegraphics[height=5cm,width=1.5cm,angle=-60]{lavande_col}}}}

\begin{document}
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\ 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\ 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA \qquad \qquad \qquad$\lavanda$\\
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\ 
\end{document}

The result is this:

enter image description here

I would like to force the text to follow the contour of the image. So that I would have: (i) the same interspace before and after the image; and (ii) the text not stopping at the border of the image but at the border of the drawing.

And yeah... Unfortunately I do not know how to do that. Can someone help, please?

3
  • 1
    You can probably be helped by shapepar, ctan.org/tex-archive/macros/latex/contrib/shapepar. One thing though, TeX does not know (or care) about the contents of the image, so you can not automatically stop at the border of the drawing.
    – StefanH
    Commented Sep 8, 2017 at 11:44
  • @StefanH thanks! yeah.. I was hoping in some tikz-trick
    – shamalaia
    Commented Sep 8, 2017 at 11:48
  • You should take a look at the insbox plainTeX macro package.
    – Bernard
    Commented Sep 8, 2017 at 12:30

1 Answer 1

4

It is very easy with the insbox plain macro-package: it defines an \InsertBoxR command, to be used before a paragraph. It takes two mandatory arguments: the number of untouched lines before the insertion, and the inserted object, and one optional argument: the number of supplementary shorter lines, in case TeX doesn't make a correct computation of the necessary line. There's like wise an InsertBoxL command.

\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{graphicx} 
\input{insbox}
\makeatletter
\@InsertBoxMargin=1.5ex
\makeatother

\begin{document}

\InsertBoxR{3}{\includegraphics{lavender-drawing}}[1]

\lipsum[1-3]

\end{document} 

enter image description here

2
  • 1
    Correct, even down to the lavender! Commented Sep 8, 2017 at 14:17
  • Smells better than Pepe-le-Pew!
    – Bernard
    Commented Sep 8, 2017 at 14:20

You must log in to answer this question.

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