我创建了以下tabularx
环境(当然使用包tabularx
)作为简历的专门项目符号列表。
\begin{tabularx}{\textwidth}{r \p{3in} X r}
$\bullet$ & This is some experience & & startdate--enddate
\end{tabularx}
我本来希望使用 Itemize 环境,但我不知道如何获取日期的多个列。虽然生成的项目符号还不错,但它与环境中使用的间距不匹配itemize
。有没有办法可以始终模仿所使用的间距itemize
以使我的tabularx
环境匹配?
编辑:正如 DavideCarlisle 在他的回答中提到的,并且我在评论中提到过,我使用tabularx
X 列来为我提供灵活的空白。使用原始的,我可以用以下方式\extracolsep
重写我的示例。tabular*
\begin{tabular*}{\textwidth}{r \p{3in} @{\extracolsep{\fill}} r }
$\bullet$ & This is some experience & startdate--enddate
\end{tabular*}
我提到这一点是为了强调我的问题实际上是关于项目符号的位置,而不是表格其余部分的配置。不过,我确实想说,我很感谢大家的更一般的反馈。
答案1
您在评论中指出,您只想在最后一列之前使用弹性胶水。无需让 LaTeX 用一X
列来伪造这一点。在列之间添加弹性胶水是底层\halign
原语的一个原始功能,在核心 latex 格式中可用,使用tabular*
tabularx
是一种尝试复制语法,tabular*
但修改列宽而不是列间空间,它是远的效率较低tabular*
。
\documentclass{article}
\usepackage{array}
\begin{document}
\noindent\begin{tabular*}{\textwidth}{@{\hspace{\parindent}}r@{\hspace{\labelsep}}p{3in}@{\extracolsep{\fill}}r}
$\bullet$ & This is some experience & startdate--enddate\\
$\bullet$ & This is another experience & startdate--enddate
\end{tabular*}
\begin{itemize}
\item Test text
\item Test text
\end{itemize}
\noindent\begin{tabular*}{\textwidth}{@{\hspace{\parindent}}>{$\bullet$\hspace{\labelsep}}p{3in}@{\extracolsep{\fill}}r}
This is some experience & startdate--enddate\\
This is another experience & startdate--enddate
\end{tabular*}
\end{document}
或者更准确地复制列表布局,以 0pt parindent 为例:
\documentclass{article}
\parindent=0pt
\usepackage{array}
\begin{document}
\begin{itemize}
\item Test text
\item Test text
\end{itemize}
\noindent\begin{tabular*}{\textwidth}{@{\hspace{\labelwidth}\llap{\labelitemi}\hspace{\labelsep}}p{3in}@{\extracolsep{\fill}}r}
This is some experience & startdate--enddate\\[\itemsep]
This is another experience & startdate--enddate
\end{tabular*}
\end{document}
答案2
下面的例子显示了两种可能性;在第二种情况下,项目符号会自动添加:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent\begin{tabularx}{\textwidth}{@{\hspace{\parindent}}r@{\hspace{\labelsep}}p{3in}@{}X r}
$\bullet$ & This is some experience & & startdate--enddate\\
$\bullet$ & This is another experience & & startdate--enddate
\end{tabularx}
\begin{itemize}
\item Test text
\item Test text
\end{itemize}
\noindent\begin{tabularx}{\textwidth}{@{\hspace{\parindent}}>{$\bullet$\hspace{\labelsep}}p{3in} X r}
This is some experience & & startdate--enddate\\
This is another experience & & startdate--enddate
\end{tabularx}
\end{document}
作为沃纳在评论中提到,通过\arraystretch
方便的设置, 中的行之间的分隔与tabularx
标准itemize
环境中的项目之间的分隔相匹配:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
{
\renewcommand{\arraystretch}{1.75}
\noindent\begin{tabularx}{\textwidth}{@{\hspace{\parindent}}r@{\hspace{\labelsep}}p{3in}@{}X r}
$\bullet$ & This is some experience & & startdate--enddate\\
$\bullet$ & This is another experience & & startdate--enddate
\end{tabularx}
}
\begin{itemize}
\item Test text
\item Test text
\end{itemize}
{
\renewcommand{\arraystretch}{1.75}
\noindent\begin{tabularx}{\textwidth}{@{\hspace{\parindent}}>{$\bullet$\hspace{\labelsep}}p{3in} X r}
This is some experience & & startdate--enddate\\
This is another experience & & startdate--enddate
\end{tabularx}
}
\end{document}