centerentry 命令/垂直 + 水平空间

centerentry 命令/垂直 + 水平空间

我使用 centerentry 命令

使用文本左侧的图标和文本行中的符号

但正如您在示例中看到的,这两个符号列表没有很好地分组。您有什么想法吗?

  1. 垂直获取标题前后的一些景观?

  2. 水平移动?该命令assmargin不起作用。还有其他方法吗?


  \documentclass{article}
  \usepackage{graphicx, tabularx}
    \usepackage[nopar]{lipsum}
    \usepackage[export]{adjustbox}

    \newenvironment{centerentry}[2][]
      {\renewcommand{\tabularxcolumn}[1]{m{##1}}
       \noindent
       \tabularx{\linewidth}{ @{} m{\imagecolwidth} X @{} }
         \includegraphics[width=\linewidth,#1]{#2} &
      }{%
       \endtabularx%
      }
    \newlength{\imagecolwidth}
    \setlength{\imagecolwidth}{2em}

    \sloppy% Just for this example

    \begin{document}
    \section {Write some text}
    Some important symbols (I)\\
    %\begin{addmargin}[0.2cm]{0.3cm} %%% DOES NOT WORK
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    %\end{addmargin} %%% DOES NOT WORK
    Some important symbols (II)\\
    %\begin{addmargin}[0.2cm]{0.3cm} %%% DOES NOT WORK
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    %\end{addmargin} %%% DOES NOT WORK
    \end{document}

在此处输入图片描述

答案1

您可以使用合理的分段命令获得更好的垂直间距。要移动边缘处的图像,您可以使用表格中的负空间:

 \documentclass{article}
  \usepackage{graphicx, tabularx}
    \usepackage[nopar]{lipsum}
    \usepackage[export]{adjustbox}

    \newenvironment{centerentry}[2][]
      {\renewcommand{\tabularxcolumn}[1]{m{##1}}%
       \noindent
       \tabularx{\linewidth}{ @{\hspace{\dimexpr-2em-2\tabcolsep\relax}} m{\imagecolwidth} X @{} }
         \includegraphics[width=\linewidth,#1]{#2} &
      }{%
       \endtabularx%
      }
    \newlength{\imagecolwidth}
    \setlength{\imagecolwidth}{2em}

    \sloppy% Just for this example

    \begin{document}
    \section {Write some text}

    \subsection*{Some important symbols (I)}
    %\begin{addmargin}[0.2cm]{0.3cm} %%% DOES NOT WORK
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    %\end{addmargin} %%% DOES NOT WORK
\subsection*{Some important symbols (II)}
    %\begin{addmargin}[0.2cm]{0.3cm} %%% DOES NOT WORK
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    \begin{centerentry}{example-image-a}  Write some text to get more lines. Write some text to get more lines. \end{centerentry}
    %\end{addmargin} %%% DOES NOT WORK
    \end{document}

在此处输入图片描述

相关内容