我对 itemize 示例中项目符号的对齐方式有疑问,这里有一个简短的示例。基本上,我有一个带有插入表的 \item,我希望项目符号位于表的顶部
有什么方法可以实现这个吗?
\begin{itemize}
\item \begin{tabular}{c p{11.4cm}} 04.2014 - 05.2014: & teeeeeeeeeeeeeeeeeeessssssssssssssssssssstttttttttttttttttttttt
pppppppppphhhhhhhhhhaaaaaaaaaasssssssssseeeeeeeeeeeee \end{tabular}
\end{itemize}
答案1
打字
\begin{itemize}
\item \begin{tabular}[t]{c p{11.4cm}} 04.2014 - 05.2014: & teeeeeeeeeeeeeeeeeeessssssssssssssssssssstttttttttttttttttttttt
pppppppppphhhhhhhhhhaaaaaaaaaasssssssssseeeeeeeeeeeee \end{tabular}
\end{itemize}
将解决问题,但我的印象是你使用错误的工具来完成这项工作。
尝试一下这个:
\documentclass{article}
\usepackage{enumitem}
\usepackage{microtype}
\usepackage{lipsum} % just for the example
\newenvironment{cvitemize}
{\begin{itemize}[leftmargin=\citemwd,labelwidth=\citemwd,labelsep=0pt]}
{\end{itemize}}
\newlength{\citemwd}
\AtBeginDocument{%
\settowidth{\citemwd}{\textbullet\ 00.0000--00.0000:\ }%
}
\newcommand{\citem}[1]{%
\item[\textbullet\ #1:\ ]%
}
\begin{document}
\lipsum[2]
\begin{cvitemize}
\citem{04.2014--05.2014} \lipsum*[3]
\end{cvitemize}
\lipsum[4]
\end{document}
答案2
有一个可选参数用于tabular
指定垂直位置。 t
指定顶行的基线应与周围文本对齐。
\documentclass{article}
\begin{document}
\begin{itemize}
\item \begin{tabular}[t]{c p{11.4cm}} 04.2014 - 05.2014: & teee
eeeeeee eeeeeeee essssss ssssssss ssssssst ttttttt ttttttttt ttttt
pp pppp pppphhh hhhhhh haaaaa aaaaas ssssss ssseee eeeeee
eeee \end{tabular}
\end{itemize}
\end{document}
如果不选择任何选项,则tabular
垂直居中,相对于周围的文本。如果b
选择该选项,则使用表格最后一行的基线;请注意,p
列中将是该条目行的基线,因此在您的情况下,这将产生您要求的相同对齐方式:
\documentclass{article}
\begin{document}
\begin{itemize}
\item \begin{tabular}[t]{c p{5cm}} 04.2014 - 05.2014: & teee
eeeeeee eeeeeeee essssss ssssssss ssssssst ttttttt ttttttttt ttttt
pp pppp pppphhh hhhhhh haaaaa aaaaas ssssss ssseee eeeeee
eeee \end{tabular}
\item \begin{tabular}{c p{5cm}} 04.2014 - 05.2014: & teee
eeeeeee eeeeeeee essssss ssssssss ssssssst ttttttt ttttttttt ttttt
pp pppp pppphhh hhhhhh haaaaa aaaaas ssssss ssseee eeeeee
eeee \end{tabular}
\item \begin{tabular}[b]{c p{5cm}} 04.2014 - 05.2014: & teee
eeeeeee eeeeeeee essssss ssssssss ssssssst ttttttt ttttttttt ttttt
pp pppp pppphhh hhhhhh haaaaa aaaaas ssssss ssseee eeeeee
eeee \end{tabular}
\end{itemize}
\end{document}
答案3
您可以使用该listliketab
包:表格环境,其中第一列可以模拟任何列表环境:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage[showframe, nomarginpar, textwidth = 15cm]{geometry}
\usepackage{listliketab}
\newcommand{\tabitem}{\textbullet}
\pagestyle{empty}
\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dic- tum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem.Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.
\storestyleof{itemize}
\begin{listliketab}
\begin{tabular}{Lc p{8cm}}
\tabitem & 04.2014 - 05.2014: & Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dic- tum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\end{tabular}
\end{listliketab}
\end{document}