Tabularx 和多个多行单元格

Tabularx 和多个多行单元格

我想绘制一个表格,左边的单元格比右边的少,也就是说,对于某些行,左边的每个单元格对应右边的两个单元格。对于其他行,则是一对一。

我得到了下面的内容,至少从技术上讲,它是可行的。但是,有几件事我想改进:

  • 随机的额外行是一个临时拼凑,必须是一个更好的方法。
  • 如果可能的话,我真的不想使用水平线,因为它太乱了,我看不出有什么办法。如果用乳胶的正常美感来铺垫,我想我可以避免使用它们。

下面我提供的例子与文档的其余部分有一些不同之处。

  • tabularx 导入由 classic thesis 提供。我不确定所有设置是否相关,但我想我会将它们包括在内,以防万一。
  • 我在我的论文中多次引用了我的研究问题,因此将它们做成了宏。

工作示例:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx} % better tables
    \setlength{\extrarowheight}{3pt} % increase table row height
\newcommand{\tableheadline}[1]{\multicolumn{1}{c}{\spacedlowsmallcaps{#1}}}
\newcommand{\myfloatalign}{\centering} % to be used with each float for alignment
\usepackage{multirow} % to span multiple rows
\usepackage{caption}

\def\QuestionOtherData{Given the diverse information environment within the rail industry, how can heterogeneous datasources be combined, where there is value in so doing?}
\def\QuestionChange{Can an intermediary layer isolate information systems from changes to datastore interfaces?}
\def\QuestionSecurity{How can datastore security be managed within the setting of an ontology and IT infrastructure?}
\def\QuestionCombine{Given that that many stakeholders can benefit from combining multiple data sources, what techniques enable this?}
\def\QuestionSkillz{Given the current shortage of engineers with experience editing or connecting to ontologies, is it possible to create tools which improve their uptake and adoption?}
\def\QuestionCanOntologyScale{Given the velocity and volume of data within the rail domain, can an ontology based architectures be deployed on the scale of a national rail network?} 


\begin{document}

\noindent\begin{tabularx}{\textwidth}{@{}XX@{}} 
Question & Investigated In\\

\multirow{2}{*}{\mbox{\parbox{\linewidth}{\QuestionOtherData}}} & Chapter four \\
& Chapter six \\
& \\ %This is an ugly bodge to make it not draw the questions on top of each other
& \\
\hline
\multirow{2}{*}{\setlength{\fboxsep}{-\fboxrule}\mbox{\parbox{\linewidth}{\QuestionSkillz}}} & Chapter five \\
& Chapter six \\
& \\ 
& \\
\hline
\multirow{2}{*}{\setlength{\fboxsep}{-\fboxrule}\mbox{\parbox{\linewidth}{\QuestionCombine}}} & Chapter five \\
& Chapter six \\
& \\
\hline
\QuestionChange & Chapter five \\
\hline
\QuestionCanOntologyScale & Chapter six \\
\hline
\multirow{2}{*}{\mbox{\parbox{\linewidth}{\QuestionSecurity}}} & Chapter five \\
& Chapter six \\
\end{tabularx}
\end{document}

任何帮助都将不胜感激。有人可以让它整齐地排列,这样我就不需要水平线了?

答案1

我想建议对材料的内容进行以下重组(重组?)tabularx。请注意,没有所有\multirow包装器。还请注意,第一列占用了(更多)空间,而第二列占用的空间(相应地)少得多——基本上:只是最低限度。我已放弃表格主体中的所有水平线,而是使用空白来提供视觉分隔。

在此处输入图片描述

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{caption}
\usepackage[british]{babel} % for "bodge"

\newcommand{\mycell}[1]{%
  \begin{tabular}[t]{@{}l@{}} #1 \end{tabular}}

\def\QuestionOtherData{Given the diverse information environment within the rail industry, how can heterogeneous datasources be combined, where there is value in so doing?}
\def\QuestionChange{Can an intermediary layer isolate information systems from changes to datastore interfaces?}
\def\QuestionSecurity{How can datastore security be managed within the setting of an ontology and IT infrastructure?}
\def\QuestionCombine{Given that that many stakeholders can benefit from combining multiple data sources, what techniques enable this?}
\def\QuestionSkillz{Given the current shortage of engineers with experience editing or connecting to ontologies, is it possible to create tools which improve their uptake and adoption?}
\def\QuestionCanOntologyScale{Given the velocity and volume of data within the rail domain, can an ontology based architectures be deployed on the scale of a national rail network?} 

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{@{}Xl@{}} 
Question & Investigated in\\ 
\midrule
\QuestionOtherData & \mycell{Chapter four \\ Chapter six}\\ \addlinespace
\QuestionSkillz    & \mycell{Chapter five \\ Chapter six}\\ \addlinespace
\QuestionCombine   & \mycell{Chapter five \\ Chapter six}\\ \addlinespace
\QuestionChange    & Chapter five \\                        \addlinespace
\QuestionCanOntologyScale & Chapter six \\                  \addlinespace
\QuestionSecurity  & \mycell{Chapter five \\ Chapter six} \\ 
\bottomrule
\end{tabularx}
\end{document}


附录展示如何进一步简化表格:右侧列中的材料可以(也可能应该)通过一次只使用一行来简化,如下例所示。

在此处输入图片描述

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx,booktabs}
\usepackage[british]{babel} % for "bodge" :-)

\def\QuestionOtherData{Given the diverse information environment within the rail industry, how can heterogeneous datasources be combined, where there is value in so doing?}
\def\QuestionChange{Can an intermediary layer isolate information systems from changes to datastore interfaces?}
\def\QuestionSecurity{How can datastore security be managed within the setting of an ontology and IT infrastructure?}
\def\QuestionCombine{Given that that many stakeholders can benefit from combining multiple data sources, what techniques enable this?}
\def\QuestionSkillz{Given the current shortage of engineers with experience editing or connecting to ontologies, is it possible to create tools which improve their uptake and adoption?}
\def\QuestionCanOntologyScale{Given the velocity and volume of data within the rail domain, can an ontology based architecture be deployed on the scale of a national rail network?} 

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{@{} X l @{}} 
Question           & Investigated in \\ \midrule
\QuestionOtherData & Chapters 4 \& 6 \\ \addlinespace
\QuestionSkillz    & Chapters 5 \& 6 \\ \addlinespace
\QuestionCombine   & Chapters 5 \& 6 \\ \addlinespace
\QuestionChange    & Chapter 5       \\ \addlinespace
\QuestionCanOntologyScale & Chapter 6\\ \addlinespace
\QuestionSecurity  & Chapters 5 \& 6 \\ \bottomrule
\end{tabularx}
\end{document}

答案2

像这样?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabularx} % better tables   
\newcommand{\tableheadline}[1]{\multicolumn{1}{c}{\spacedlowsmallcaps{#1}}}
\newcommand{\myfloatalign}{\centering} % to be used with each float for alignment
\usepackage{makecell, booktabs}
\usepackage{caption}
\usepackage{soulutf8}
\usepackage[table, svgnames]{xcolor}

\def\QuestionOtherData{Given the diverse information environment within the rail industry, how can heterogeneous datasources be combined, where there is value in so doing?}
\def\QuestionChange{Can an intermediary layer isolate information systems from changes to datastore interfaces?}
\def\QuestionSecurity{How can datastore security be managed within the setting of an ontology and IT infrastructure?}
\def\QuestionCombine{Given that that many stakeholders can benefit from combining multiple data sources, what techniques enable this?}
\def\QuestionSkillz{Given the current shortage of engineers with experience editing or connecting to ontologies, is it possible to create tools which improve their uptake and adoption?}
\def\QuestionCanOntologyScale{Given the velocity and volume of data within the rail domain, can an ontology based architectures be deployed on the scale of a national rail network?}

\newcommand{\nl}{\newline}

\begin{document}


\noindent\begin{tabularx}{\linewidth}{@{}>{\hsize=1.5\hsize\arraybackslash}X@{\qquad}>{\hsize=0.5\hsize\arraybackslash}X@{}}
\caps{Question}& \caps{Investigated In} \\
\arrayrulecolor{LightSteelBlue}\midrule[\heavyrulewidth]
\QuestionOtherData & Chapter four \nl Chapter six \\
\addlinespace
\QuestionSkillz & Chapter five \nl Chapter six \\
\addlinespace
\QuestionCombine & Chapter five \nl Chapter six \\
\addlinespace
\QuestionChange & Chapter five \\
\addlinespace
\QuestionCanOntologyScale & Chapter six \\
\addlinespace
\QuestionSecurity & Chapter five \nl Chapter six \\
\bottomrule
\end{tabularx}

\end{document} 

在此处输入图片描述

相关内容