我终于完成了工作中一篇文章的转录,其中有一个很长的表格,里面有很多文字,由于操作系统(debian wheezy)的原因,必须在超级表格环境中构建(无法识别 tabularx + xtab)。这是表格的摘录,该表格连续多页,并且基本具有相同的结构。
\documentclass[12pt,twoside]{article}
\usepackage{rotating}
\usepackage{supertabular}
\usepackage{multirow}
\usepackage{array}
\begin{supertabular}{| c | p{4cm} | p{11cm} |}
\hline
\multicolumn{2}{|c|}{\textbf{Teoría}} & \textbf{Descripción} \\
\hline
\multirow{4}{*}[-3cm]{ \rotatebox[origin=c]{90}{ENFOQUES DE COMPORTAMIENTO}}
& Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\cline{2-3}
& Teoría sobre recompensas y castigos (líder positivo y líder negativo)(James Burns) & Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\
\cline{2-3}
& Liderazgo autocrático, participativo(Víctor Vroom y Phillip Yetton) y laissez-faire (Kurt Lewin) & Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\cline{2-3}
& Teoría del Grid Gerencial (Robert Blake y Jane Mounton) & Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\
\hline
\multirow{3}{*}[-3cm]{ \rotatebox[origin=c]{90}{ENFOQUES DE CONTINGENCIA}}
& Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\cline{2-3}
& Long Title & Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\cline{2-3}
& Long Title & Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\
\hline
\end{supertabular}
\end{document}
我的问题是,当单元格停止继续下一页时,文本不会继续,与页面底部重叠。我已经阅读了所有相关帖子但无法解决问题。
我的问题是多行中的垂直旋转标题不居中,当单元格停止继续下一页时,文本不会居中,并且会与页面底部重叠。我已经阅读了所有相关帖子,但无法解决问题。
答案1
免责声明
下面的代码仅尝试修复第一个问题。就目前的问题而言,我无法理解第二个问题到底是什么。
多行的问题
multirow
通常需要手动进行垂直调整,如其手册中所述:
第 2 节,使用多行
几乎不可能正确处理降部。文本将设置为居中,但其基线可能与旁边内容的基线不匹配,特别是当旁边的内容有降部而文本没有时。这可能会导致轻微的错位。所能做的就是使用 fixup 可选参数对文本进行最后的修饰。(提示:如果您使用 .1ex 之类的度量,那么即使您更改点大小,修复仍然很有可能是正确的。)
因此,可以通过目测来解决这个问题\multirow{4}{*}[-14ex]{ \rotatebox[origin=c]{90}{ENFOQUES DE COMPORTAMIENTO}}
,当然,这远非理想,但我建议对整个表格采用非常不同的方法。
建议
- 不要混合垂直和水平书写。考虑一下你的读者。人们要么旋转页面,要么移动书颈。改用标题。添加一个
\label{tab:example}
,这会带来额外的好处,即能够自动引用表格,包括页码等,使用\ref{tab:example}
或`\pageref{tab:example}。各种软件包也增强了这一点,比如cleverref。 - 不要使用垂直线,除非阅读方向是垂直的。线条应遵循文本的方向。这可以让读者在页面上看到更自然的流动和移动。
- 使用不同宽度的线条来区分表格的开始和结束行,以及更改的线条,这些线条具有更改或分隔表格内容的含义。 软件包中
booktabs
有一些定义非常精美的线条,以及许多其他内容,包括很好的建议。\toprule
,\mudrule
并且\bottomrule
所有线条都具有出色的专业外观。 - 根据内容,用行分隔表格中的内容可能有点过头了。在这些行之间添加一些额外的空间可以更自然、更舒适地进行区分。同样,从
booktabs
那里有一个命令,\addlinespace
它有一个预定义的(当然是可更改的)空间,看起来非常漂亮。 - 省点事。设置您自己的宏来格式化和重复内容。对于您的标题,我创建了一个名为的宏来
\tableHeader{text}
设置格式。这使标题的格式在所有表格中保持一致,如果您稍后决定要更改格式,例如,小写字母,您只需更改该宏,而不是更改每个表格的每个标题。
输出,原始修复与建议的改进
原始代码,已修复
\documentclass[12pt,twoside]{article}
\usepackage{rotating}
\usepackage{supertabular}
\usepackage{multirow}
\begin{document}
\begin{supertabular}{| c | p{4cm} | p{11cm} |}
\hline
\multicolumn{2}{|c|}{\textbf{Teoría}} & \textbf{Descripción} \\
\hline
\multirow{4}{*}[-14ex]{ \rotatebox[origin=c]{90}{ENFOQUES DE COMPORTAMIENTO}} & Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\cline{2-3}&&\\
& Teoría sobre recompensas y castigos (líder positivo y líder negativo)(James Burns) & Text Text Text Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\
\cline{2-3}&&\\
& Liderazgo autocrático, participativo(Víctor Vroom y Phillip Yetton) y laissez-faire (Kurt Lewin) & Text Text Text Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\cline{2-3}&&\\
& Teoría del Grid Gerencial (Robert Blake y Jane Mounton) & Text Text Text Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\ \hline
\end{supertabular}
\end{document}
代码,建议改进
\documentclass[12pt,twoside]{article}
\usepackage{booktabs}
\usepackage{caption}
\newcommand{\tableHeader}[1]{\textbf{#1}}
\begin{document}
\begin{table}
\caption{ENFOQUES DE COMPORTAMIENTO}
\begin{tabular}{ p{4cm} p{11cm} }
\toprule
\tableHeader{Teoría} & \tableHeader{Descripción} \\
\midrule
Text Text Text Text & A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\addlinespace
Teoría sobre recompensas y castigos (líder positivo y líder negativo)(James Burns) & Text Text Text Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\
\addlinespace
Liderazgo autocrático, participativo(Víctor Vroom y Phillip Yetton) y laissez-faire (Kurt Lewin) & Text Text Text Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text. \\
\addlinespace
Teoría del Grid Gerencial (Robert Blake y Jane Mounton) & Text Text Text Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text A lot of Text.\\
\bottomrule
\end{tabular}
\end{table}
\end{document}