首页 > 解决方案 > 在逐项 LaTex 中对齐图形和文本

问题描述

我正在尝试使用latex中的“itemize”功能来说明一些图标,左侧的图标和右侧的解释,两个问题1)左图与右文本不对齐,文本总是低于图。2)整个items块太靠近左边缘,为整个itemize块添加左边的空间?

\begin{itemize}

    \item[{\includegraphics[width=7em]{ui_t_1.jpg}}] \textbf{Home}\\ Select to go to the Main Menu screen.\\
    \item[{\includegraphics[width=7em]{ui_t_2.jpg}}] \textbf{History}\\ Select to check the running history.\\
    \item[{\includegraphics[width=7em]{ui_t_3.jpg}}] \textbf{System}\\ Select to set up the system parameters.\\
    \item[{\includegraphics[width=7em]{ui_t_4.jpg}}] \textbf{Log Off}\\ Select to log off or shut down the system.\\
\end{itemize}

标签: latex

解决方案


adjustboxexport选项允许您访问valignwithin \includegraphics,您可以在其中指定您所包含的图像相对于周围文档元素的v位置。align你最有可能在valign=c.

在此处输入图像描述

\documentclass{article}

\usepackage[export]{adjustbox}

\begin{document}

\begin{itemize}
  \item[{\includegraphics[width=2em,valign=B]{example-image-a}}] \textbf{Home}
  
  Select to go to the Main Menu screen.
  
  \item[{\includegraphics[width=2em,valign=c]{example-image-b}}] \textbf{History}
  
  Select to check the running history.
  
  \item[{\includegraphics[width=2em,valign=t]{example-image-c}}] \textbf{System}
  
  Select to set up the system parameters.
  
  \item[{\includegraphics[width=2em,valign=c]{example-image}}]  \textbf{Log Off}
  
  Select to log off or shut down the system.
\end{itemize}

\end{document}

推荐阅读