我有一份这样的文件
\textbf{Company Name}, \textit{Position} \hfill{City, State} \hfill Jan 2018--May 2018
\begin{itemize}
\item Some bullet point
\end{itemize}
\textbf{Longer Company Name}, \textit{Position} \hfill{City, State} \hfill Jan 2018--May 2018
我希望该City, State
部分居中对齐(或者如果不居中,则在不同条目之间一致对齐)。也许tabular
可以,但我不知道如何将itemize
其放入tabular
并允许其跨越整条线。
答案1
您可以将l
eft、c
entre 和r
component 设置为适当对齐\makebox
的零宽度:
\documentclass{article}
\usepackage[margin=1in]{geometry}% Just for this example
\begin{document}
\textbf{Company Name}, \textit{Position} \hfill{City, State} \hfill Jan 2018--May 2018
\begin{itemize}
\item Some bullet point
\end{itemize}
\textbf{Longer Company Name}, \textit{Position} \hfill{City, State} \hfill Jan 2018--May 2018
\noindent\hrulefill
\makebox[0pt][l]{\textbf{Company Name}, \textit{Position}}\hfill
\makebox[0pt][c]{City, State}\hfill
\makebox[0pt][r]{Jan 2018--May 2018}
\begin{itemize}
\item Some bullet point
\end{itemize}
\makebox[0pt][l]{\textbf{Longer Company Name}, \textit{Position}}\hfill
\makebox[0pt][c]{City, State}\hfill
\makebox[0pt][r]{Jan 2018--May 2018}
\end{document}
答案2
使用包tabularx
和enumitem
:
\documentclass{article}
\usepackage{tabularx}
\newcolumntype{M}{>{\csname @minipagetrue\endcsname}X}
\usepackage{enumitem}
\newlist{tabitem}{itemize}{1} % <-- defined new list
\setlist[tabitem]{nosep, % <-- new list setup
leftmargin=*,
label=$\bullet$,
after=\vspace{-\baselineskip}
}
\begin{document}
\begin{tabularx}{\linewidth}{@{}
>{\raggedright\arraybackslash}M c
>{\raggedleft\arraybackslash}M @{}}
\textbf{Company Name}, \textit{Position}
\begin{tabitem}
\item Some bullet point
\end{tabitem}
& City, State & Jan 2018--May 2018 \\
\textbf{Longer Company Name}, \textit{Position}
& City, State & Jan 2018--May 2018
\end{tabularx}
\end{document}