0

When I used the command \parpic of picins package inside enumerate environment, it made the trouble that the label item was not co-linear. I don't want change package so help me to fix it. Thanks.

Here is the sample code:

\documentclass{article}
\usepackage{picins}
\usepackage{lipsum}
\begin{document}

\begin{enumerate} \parpic[r]{\fbox{\parbox[4cm]{4cm}{\lipsum[4]}}} \item \lipsum[4] \item \lipsum[4] \item \lipsum[4] \item \lipsum[4] \item \lipsum[4]

\end{enumerate} \end{document}

Command \parpic inside enumerate environment.

1 Answers1

0

Welcome! I propose to use the plain TeX macro package insbox and enumitem, which defines a key to set the right margin of lists, and a resume key to interrupt an enumerate list and later start another one with the same counter.

\documentclass{article}
\usepackage{enumitem
\usepackage{insbox}
\usepackage{lipsum}

\begin{document}

\begin{enumerate}[rightmargin=4.5cm, before =\InsertBoxR{0}{\raisebox{-5.5ex}{\fbox{\parbox[t]{4cm}{\lipsum[4]}}}}, after =\vspace{-\partopsep}]%[4cm] %\parpic[r]} \item \lipsum[4] \item \lipsum[4] \end{enumerate} \begin{enumerate}[resume] \item \lipsum[4] \item \lipsum[4] \item \lipsum[4] \end{enumerate}

\end{document}

enter image description here

Bernard
  • 271,350
  • Thank for your suggest. But I can not remove picins package. Would you give me some other suggest? – Cong Hau May 09 '21 at 11:49
  • I'm sorry, I have no idea. I tried to install it on my system, but it's not part of MiKTeX (nor TeX Live). – Bernard May 09 '21 at 11:51
  • That package must be installed by your self. It is not available on MikTeX nor TexLive. Here is link to download that https://www.ctan.org/pkg/picins – Cong Hau May 09 '21 at 11:56
  • @CongHau given the fact the this is written for latex209, aka pre 1993, then no, noone should use this. It is similar to wrapfig, which warns about using it with lists. – daleif May 09 '21 at 12:37
  • @CongHau: The only way I could find to remove this behaviour was to load enumitem, and use the option begin{enumerate}[wide=0pt], which makes the list left margin the same as the text left margin. If it's fine for you, it is rather simple to modify your code. – Bernard May 09 '21 at 12:53
  • @Bernard This way is exactly what I need. Thank all! – Cong Hau May 09 '21 at 14:59