1

I would like to have something like this: enter image description here

  • 1
    Try to do with package wrapfigure (ctan.org/pkg/wrapfig?lang=en). Also see answer http://tex.stackexchange.com/questions/56176/handling-of-wrapfig-pictures-in-latex etc. – Zarko Oct 20 '15 at 15:11
6

Like this?

enter image description here

\documentclass{article}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{graphicx}

\begin{document}

\begin{wrapfigure}[5]{l}{3cm}
\includegraphics[width=2.5cm]{example-image-a}
\end{wrapfigure}
\lipsum[1]

\begin{wrapfigure}[6]{l}{3cm}
\includegraphics[width=2.5cm]{example-image-b}
\end{wrapfigure}
\lipsum[1]
\end{document}
|improve this answer|||||
  • Over here the code does not produce the same result as shown in the above screenshot - isn't your code compatible with lualatex (I use: TL2019 and lualatex). Thx! – lAtExFaN Jul 19 '19 at 11:48
  • @lAtExFaN The code works with pdflatex as expected. It doesn't work with LuaLaTeX, but I think it's a wrapfig problem, see tex.stackexchange.com/questions/237305/… – Ignasi Jul 19 '19 at 12:11
  • Yes it seems so, sadly wrapfig is very problematic in connection with lualatex. thx, for your feedback. – lAtExFaN Jul 19 '19 at 12:26
5

The question shows a misunderstanding of what \includegraphics{} does and how it should be used, assuming that it has to be used always as part of a figure environment. This is not the case.

You can write \includegraphics{foo} at any point of your text, even in the middle of a paragraph, and the graphic will be inserted at that point, as if it was any other char (only that, probably, bigger).

In particular you can use an external image even as argument of \item[], which provides another possible answer for your question:

\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum}
\def\Duck{\includegraphics[width=3ex]{duck}}
\def\Turtle{\includegraphics[width=4ex]{turtle}}

\begin{document}
\lipsum[1]

\begin{itemize}
\item[\Duck] \lipsum[2]
\item[\Turtle] \lipsum[3]
\end{itemize}
\end{document}

Result

|improve this answer|||||
3

If it must not float, the simplest is to write in your preamble

\input{insbox}

(it's a set of plain tex macros) and use in the body of your document, before each paragraph,

\InsertBoxL{n}{\includegraphics{your_figure}}

where n is the number of lines that must remain full length before the graphics file is inserted — typically in your case, n=0. An optional argument allows for a correction (in number of supplementary lines to be indented).

Demo:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx} 

\input{insbox}

\begin{document}

\InsertBoxL{2}{\includegraphics[scale=0.25]{sendak.png}}Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius dapibus metus eget ultrices. Nulla sagittis mauris rutrum, blandit augue eget, laoreet augue. Phasellus enim odio, sagittis in mi sed, fringilla mollis odio. Phasellus quis purus ultricies, tempor purus at, tempus quam. Donec ultricies, ligula ac pretium porttitor, nibh nunc. Integer eros nibh, cursus at est sed, volutpat tristique justo. Donec ornare facilisis lorem, id feugiat elit pellentesque at. Nulla odio mauris, luctus sed faucibus id, dignissim dictum velit. Morbi vehicula velit at massa tristique rhoncus.%

\InsertBoxL{0}{\includegraphics[scale=0.25]{sendak.png}}%
Phasellus quis purus ultricies, tempor purus at, tempus quam. Donec ultricies, ligula ac pretium porttitor, nibh nunc.Integer eros nibh, cursus at est sed, volutpat tristique justo. Donec ornare facilisis lorem, id feugiat elit pellentesque at. Nulla odio mauris, luctus sed faucibus id, dignissim dictum velit. Morbi vehicula velit at massa tristique rhoncus.

\end{document} 

enter image description here

|improve this answer|||||
  • Where is insbox documented? – Ignasi Oct 20 '15 at 17:19
  • It is documented as a demo.pdf file, which has the necessary explanations, and for the optional argument, in the commented code demo.tex. Plus an explanation in the code of insbox.tex about the \@InsertBoxMargin, if you want to change it (its value is 2mm). – Bernard Oct 20 '15 at 17:29
  • Sorry, it's the first time I hear about it and you didn't mention CTAN. Now I've found it. Thanks. – Ignasi Oct 20 '15 at 18:18
  • Oh! I'm sorry. In my mind it went without saying it was on CTAN; and above all it is part of MiKTeX and TeX Live. – Bernard Oct 20 '15 at 18:28

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.