![itemize 中项目的水平对齐](https://linux22.com/image/422728/itemize%20%E4%B8%AD%E9%A1%B9%E7%9B%AE%E7%9A%84%E6%B0%B4%E5%B9%B3%E5%AF%B9%E9%BD%90.png)
答案1
您可以使用tabto
:
\documentclass{article}
\usepackage{tabto}
\begin{document}
List:
\begin{itemize}
\item apple \tabto{10em} fruit
\item cucumber \tabto{10em} vegetable
\item steak \tabto{10em} meat
\end{itemize}
List:
\begin{itemize}
\item apple\tabto{10em}fruit
\item cucumber\tabto{10em}vegetable
\item steak\tabto{10em}meat
\end{itemize}
\end{document}
第二个列表只是为了表明周围的空格\tabto{10em}
被忽略,因此输入可以组织成看对齐。
答案2
您可以通过使用tabularx
环境作为 的一部分来获得所需的结果\item
。
\documentclass{article}
\usepackage{tabularx}
\begin{document}
List:
\begin{itemize}
\item
\begin{tabularx}{\linewidth}{XX}
apple & fruit
\end{tabularx}
\item
\begin{tabularx}{\linewidth}{XX}
cucumber & vegetable
\end{tabularx}
\item
\begin{tabularx}{\linewidth}{XX}
steak & meat
\end{tabularx}
\end{itemize}
\end{document}
如果您不希望两列之间有间距,您也可以使用环境tabular
并使用三列,其中一列是两个字符串之间的间距。这种方法的问题是,您需要至少为第一列和第二列定义固定宽度。
\documentclass{article}
\begin{document}
List:
\begin{itemize}
\item
\begin{tabular}[t]{p{10em}p{1em}l}
apple && fruit
\end{tabular}
\item
\begin{tabular}[t]{p{10em}p{1em}l}
cucumber && vegetable
\end{tabular}
\item
\begin{tabular}[t]{p{10em}p{1em}l}
steak && meat
\end{tabular}
\item
\begin{tabular}[t]{p{10em}p{1em}l}
a very long entry to sow why the central column is important to have && meat
\end{tabular}
\end{itemize}
\end{document}
答案3
只需使用表格即可。您可以使用适当的参数来匹配列表的间距和样式。
\documentclass{article}
\usepackage{array}
\newenvironment*{tabularitemize}[1]{%
\par\noindent
\begin{tabular}{ @{\hskip\leftmargin\llap{\labelitemi\hskip\labelsep}} #1 }%
}{%
\end{tabular}\par
}
\begin{document}
\begin{tabularitemize}{ l l }
apple & fruit \\
cucumber & vegetable \\
steak & meat \\
\end{tabularitemize}
\begin{itemize}
\item This is a real list.
\end{itemize}
\end{document}
表格的行和列之间的间距可以照常调整。
答案4
您还可以使用listliketab
包或标准逐项列举和eqparbox
包来执行此操作:
\documentclass{article}
\usepackage{listliketab}
\usepackage{eqparbox}
\begin{document}
List:
\storestyleof{itemize}
\begin{listliketab}
\begin{tabular}[t]{Ll@{\qquad}l }
\textbullet & apple & fruit \\
\textbullet & cucumber & vegetable \\
\textbullet & steak & meat
\end{tabular}
\end{listliketab}
\begin{itemize}
\item\eqmakebox[L][l]{apple} fruit
\item\eqmakebox[L][l]{cucumber\hspace{2em}\null} vegetable
\item\eqmakebox[L][l]{steak} meat
\end{itemize}
\end{document}