特定符号后均匀对齐

特定符号后均匀对齐

我想列出类似这样的内容,但所有:符号应与列表中所有其他项目位于同一水平空间

答:jkajdkpajd

银行:odoida

kaak ka: asjad

除了表格之外,如何在乳胶中实现这一点?

答案1

这里我展示了三种方式:\makeboxtabbingtabular

\documentclass{article}
\parindent 0in
\begin{document}
RAW: \par
A : jkajdkpajd\par
Bnk : odoida\par
kaak ka: asjad

\bigskip
\newlength\longest
\setbox0=\hbox{kaak ka}
\setlength\longest{\wd0}
MAKEBOX:\par
\makebox[\longest][l]{A}: jkajdkpajd\par
\makebox[\longest][l]{Bnk}: odoida\par
\makebox[\longest][l]{kaak ka}: asjad

\bigskip
TABBING:
\begin{tabbing}
kaak ka\=\kill
A \>: jkajdkpajd\\
Bnk \>: odoida\\
kaak ka\>: asjad
\end{tabbing}

\bigskip
TABULAR:\par
\begin{tabular}{@{}l@{}l}
A &: jkajdkpajd\\
Bnk &: odoida\\
kaak ka&: asjad
\end{tabular}
\end{document}

在此处输入图片描述

答案2

enumitem

\documentclass{article}
\usepackage{enumitem,calc}
\begin{document}
\begin{itemize}[align=left,labelwidth=\widthof{kaak ka}]
\item[A]: jkajdkpajd\par
\item[Bnk]: odoida\par
\item[kaak ka]: asjad
\end{itemize}
\end{document}

在此处输入图片描述

相关内容