6

How to insert a picture next to the itemize by wrapfig?? Like this: enter image description here

I try this:

\subsection*{1. Persona}
\begin{wrapfigure}[4]{r}{2.5in}
\centering
\includegraphics[width=2in]{fig/person.pdf}
\end{wrapfigure}

\begin{itemize}
\item \textbf{Jméno} - Adam
\item \textbf{Pohlaví} - muž
\item \textbf{Věk} - 21 let
\item \textbf{Stav} - svobodný, bezdětný
\item \textbf{Práce} - student vysoké školy (Vysoké učení technické fakulta podnikatelská)\end{itemize}`

But it looks bad:

enter image description here

  • 1
    Welcome to TeX.SE. Have you read the wrapfig manual, especially the part that wrapfigure should not be used in list - like environment, e.g. itemize etc.? – user31729 Jan 22 '17 at 12:10
  • Unfortunately, that isn't a strength of TeX. – Johannes_B Jan 22 '17 at 12:15
  • 1
    And is there any solution to my problem? Or not? – Marek Vrchlický Jan 22 '17 at 12:46
  • @MarekVrchlický tex.stackexchange.com/questions/59101/… might be helpful for you. – Masroor Jan 22 '17 at 12:57
3

With package picins which is not part of TeXLive (license issue). Get it from CTAN: http://ctan.org/pkg/picins

\parpic(width,height)(x-offset,y-offset)[options][position]{image}

Only the {image} is mandatory, all other arguments are optional.

\documentclass{article}
\usepackage{picins}
\usepackage{graphicx}
\usepackage{blindtext}
\begin{document}
\subsection*{1. Persona}

\begin{itemize}
    \parpic(2in,1.5in)[r]{\includegraphics[width=2in]{tiger}}
    \item \textbf{Jméno} - Adam
    \item \textbf{Pohlaví} - muž
    \item \textbf{Věk} - 21 let
    \item \textbf{Stav} - svobodný, bezdětný
    \item \textbf{Práce} - student vysoké školy (Vysoké učení technické fakulta 
    podnikatelská)
    \item \blindtext    
\end{itemize}`

\blindtext
\end{document}

enter image description here

0

Here is a workaround, using enumitem and the insbox plain TeX macro package.

With enumitem, you can change the right margin of a list, choosing the number of items which correspond to the height of the graphics you want to insert, use the \InsertBoxR command before the list, then use the resume key in a new list. Some minor adjustment of vertical spacing between the two lists has to be done.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[showframe]{geometry}%
\usepackage{graphicx, enumitem}%
 \input{insbox}

\begin{document}

\subsection*{1. Persona}

Text text text text text text text text text text text text text. More text more text more text more text more text more text more text more text more text.


\begin{itemize}[,before=\setlength{\rightmargin}{2in}\vspace*{-\dimexpr\topsep + \partopsep}
\InsertBoxR{0}{\raisebox{-\dimexpr\height+\topsep+\partopsep+\baselineskip}[0pt][0pt]{\includegraphics{euclid}}}, after=\vspace{\dimexpr\itemsep-\topsep}]
  \item \textbf{Jméno} - Adam
  \item \textbf{Pohlaví} - muž
  \item \textbf{Věk} - 21 let
  \item \textbf{Stav} - svobodný, bezdětný
  \item \textbf{Práce} - student vysoké školy (Vysoké učení technické fakulta podnikatels
  \item \textbf{Stav} - svobodný, bezdětný
  \item \textbf{Práce} - student vysoké školy (Vysoké učení technické fakulta podnikatels
\end{itemize}
\begin{itemize}[topsep = 0pt]%
  \item \textbf{Práce} - student vysoké školy (Vysoké učení technické fakulta podnikatels
  \item \textbf{Práce} - student vysoké školy (Vysoké učení technické fakulta podnikatels
\end{itemize}

\end{document} 

enter image description here

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.