带图片的列表中 \items 之间的水平间距

带图片的列表中 \items 之间的水平间距

我试图得到类似图片的东西,但我无法将矩形移到下一行,并且在项目之间留有水平空间

在此处输入图片描述

\usepackage[inline]{enumitem}
\begin{document}
\begin{enumerate*}[label=(\alph*)]
    \item eigth  \addtocounter{enumi}{1}
    \begin{tikzpicture}[%
        baseline=(current bounding box.north west),
        level/.style={sibling distance=10mm/#1},scale =0.5
      ]

      \draw [draw=black] (2,4) rectangle (0,0);

    \end{tikzpicture}

    \item 
    \begin{tikzpicture}[%
        baseline=(current bounding box.north),
        level/.style={sibling distance=10mm/#1},scale =0.5
      ]

      \draw [draw=black] (2,4) rectangle (0,0);

    \end{tikzpicture}
\end{enumerate*}
\end{document}

答案1

只需将文本作为一个节点,并将其作为基线tikzpicture

\documentclass{article}
\usepackage{tikz}
\usepackage[inline]{enumitem}
\begin{document}
\begin{enumerate*}[label=(\alph*)]
    \item  \begin{tikzpicture}[baseline=(X.base)]
      \node(X) {eigth};

      \draw [draw=black,path picture={
      \draw (path picture bounding box.south) -- 
      (path picture bounding box.north);
      }] ([yshift=-1ex]X.south west) rectangle ++ (2,-4);

    \end{tikzpicture}\addtocounter{enumi}{1}

    \item \begin{tikzpicture}[baseline=(X.base)]
      \node(X) {eleven};

      \draw [draw=black,path picture={
      \draw (path picture bounding box.south) -- 
      (path picture bounding box.north);
      }] ([yshift=-1ex]X.south west) rectangle ++ (2,-4);

    \end{tikzpicture}
\end{enumerate*}
\end{document}

在此处输入图片描述

这不会在项目之间引入水平间距,但您可以添加这种间距,例如通过添加\path ([xshift=2em]current bounding box.east);tikzpicture

相关内容