我在以下代码片段中使用嵌套表环境:
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{rX lX}
COURSEWORK & Machine Learning, Probabilitistic Learning, Probabilistic Graphical Models, Intermediate Statistics A \& B, Statistical Methodology I \& II, Statistical Computing, Information Retreival, Principles of Data Management, Data Structures, Computer Architecture\\
\\*
COURSEWORK & \begin{tabular}{ l l l }
Machine Learning & Probabilistic Learning & Probabilistic Graphical Models \\
Intermediate Statistics & Statistical Computing & Statistical Methods \\
Principles of Data & Data Structures & Computer Architecture \\
\end{tabular}\\
\end{tabularx}
生成以下文件:
现在,此渲染存在三个问题:
- 课程的表格列表似乎有额外的缩进(注意条目已经左对齐)&
- 表格列表中的章节标题“课程作业”出现在中间行的前面,我希望它从表格列表的顶部开始。我尝试使用,
\multirow
但它没有将章节标题放在中间行的上方。
请建议如何实现这些目标。
答案1
使用删除s\tabcolsep
开头和结尾的长度;可以使用 的可选参数来纠正对齐问题:tabular
@{}
t
tabular
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{@{} r X l X @{}}
COURSEWORK & Machine Learning, Probabilitistic Learning, Probabilistic Graphical Models, Intermediate Statistics A \& B, Statistical Methodology I \& II, Statistical Computing, Information Retreival, Principles of Data Management, Data Structures, Computer Architecture\\
\\*
COURSEWORK & \begin{tabular}[t]{@{} l l l @{} }
Machine Learning & Probabilistic Learning & Probabilistic Graphical Models \\
Intermediate Statistics & Statistical Computing & Statistical Methods \\
Principles of Data & Data Structures & Computer Architecture \\
\end{tabular}\\
\end{tabularx}
\end{document}