在表格中逐项列出,不留多余空间

在表格中逐项列出,不留多余空间

我正在尝试在表格环境中创建项目要点列表。当我使用 itemize 时,我的简历上不同工作之间的分隔线不再分开。但是,当我手动使用 cdot 时,第二行上的文本与第一行上的文本不对齐。

\documentclass{article} 

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\bf{}\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{10pt} % Spacing around section

\usepackage{tabularx}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\begin{document}

\section{Work Experience}

\begin{tabularx}{\linewidth}{R{2cm}|p{12cm} R{5cm}}
 \textsc{Jun-Aug} & \textbf{Job 1} & place, \textsc{Netherlands}\\
\textsc{2014}&  \emph{Position name}&\\
&$\cdot$ Here goes all the text that I want to align at on the second line with the alignment on the first line&\\
\multicolumn{3}{c}{} \\
 \textsc{Jun-Jul}& \textbf{Job 2} & Paris, \textsc{France}\\
 \textsc{2013}&  \emph{Position name}&\\
& $\cdot$ Responsible for followed by a list of things I was responsible for&\\
\multicolumn{3}{c}{} \\
\end{tabularx}

\end{document}

答案1

您可以calc按如下所示使用该包。

\documentclass{article} 

\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\bf{}\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{10pt} % Spacing around section

\usepackage{tabularx}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

\usepackage{calc}
\newcommand\custombullet{\hspace*{-1ex}\parbox{1ex}{$\cdot$ }}

\begin{document}

\section{Work Experience}

\begin{tabularx}{\linewidth}{R{2cm}|p{12cm} R{5cm}}
 \textsc{Jun-Aug} & \textbf{Job 1} & place, \textsc{Netherlands}\\
\textsc{2014}&  \emph{Position name}&\\
&\custombullet Here goes all the text that I want to align at on the second line with the alignment on the first line&\\
\multicolumn{3}{c}{} \\
 \textsc{Jun-Jul}& \textbf{Job 2} & Paris, \textsc{France}\\
 \textsc{2013}&  \emph{Position name}&\\
& \custombullet Responsible for followed by a list of things I was responsible for&\\
\multicolumn{3}{c}{} \\
\end{tabularx}

\end{document}

代码示例

答案2

makecell您可以使用包(允许在单元格内换行,并在序言中定义常见的格式)和 booktabs(\addlinespace比空的更简单\multicolumn{3}{c}{},但可以完成相同的工作)来做类似的事情。

我假设第二列只包含职位描述。为了简化输入,我定义了一个job计数器和一个J自动插入的列类型Job n,然后开始一个itemize环境。您所要做的就是输入\position{…}以斜体显示职位名称并插入一个小的垂直间距,然后输入 \item 和职位描述。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{titlesec} % Used to customize the \section command
\titleformat{\section}{\Large\bf{}\scshape\raggedright}{}{0em}{}[\titlerule] % Text formatting of sections
\titlespacing{\section}{0pt}{3pt}{10pt} % Spacing around section
\usepackage[x11names]{xcolor}
\usepackage{enumitem}
\usepackage{tabularx}
\usepackage{makecell}
\renewcommand\cellset{\scshape}
\renewcommand\cellalign{tr}
\usepackage{array, booktabs}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcounter{job}
\newcommand\job{\refstepcounter{job}\textbf{\color{LightSkyBlue2}Job \thejob}}
\newcommand\position[1]{\item[\emph{#1}]\leavevmode\smallskip}

\newcolumntype{J}{>{\arraybackslash\job\itemize[wide=0pt, nosep, label= \color{LightSkyBlue2}\textbullet]}X<{\mbox{}\vspace{-\baselineskip}\enditemize}}

\begin{document}

\section{Work Experience}

\noindent\begin{tabularx}{\linewidth}{@{}>{\scshape} r!{\color{LightSkyBlue2}\vrule width 2pt}Jr}
\makecell{Jun-Aug\\2014} &
\position{First position name}%
\item Here goes all the text that I want to align at on the second line with the alignment on the first line.
& place, \textsc{Netherlands}\\
\addlinespace[3ex]
 \makecell{Jun-Jul\\2013}&
 \position{Second position name}
\item Responsible for followed by a list of things I was responsible for.
& Paris, \textsc{France}\\
\end{tabularx}

\end{document} 

在此处输入图片描述

相关内容