3 Answers
Like this?
\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}
- 136,588
-
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
pdflatexas expected. It doesn't work withLuaLaTeX, but I think it's awrapfigproblem, see https://tex.stackexchange.com/questions/237305/can-lualatex-make-wrapping-text-around-figures-easier – 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
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}
- 55,732
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}
- 271,350
-
-
It is documented as a
demo.pdffile, which has the necessary explanations, and for the optional argument, in the commented codedemo.tex. Plus an explanation in the code ofinsbox.texabout 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




wrapfigure(https://www.ctan.org/pkg/wrapfig?lang=en). Also see answerhttp://tex.stackexchange.com/questions/56176/handling-of-wrapfig-pictures-in-latexetc. – Zarko Oct 20 '15 at 15:11