我正在处理一个有多行和标题的表格。问题是,当我运行它时,行与行之间以及最后一列的末尾都添加了额外的空间。
\documentclass{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{array}
\usepackage{ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\hspace{0pt}}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand{\head}[1]{\textsf{\textbf{#1}}}
\usepackage{tabulary}
\usepackage{booktabs}
\usepackage{multirow} % Allows rows in tables to be combined.
\usepackage{tabulary}
\begin{document}
\begin{table*}
\caption{Summary of studies examining MENA or OPEC oil export revenues under climate policies}
\begin{tabular}{@{}C{2.0cm}C{2.0cm}P{2.0cm}P{3.0cm}C{1.0cm}C{1.0cm}@{}}
\toprule
\ \head{Study} & \head{Time horizon} & \multicolumn{1}{c}{\head{Climate policies}} & \head{\centering {Uncertainties tested}} & \multicolumn{2}{c}{\head{Impact on oil export revenue}} \\
\midrule
\ \multirow{4}{2.0cm}{ABC} & \multirow{4}{2.0cm}{Results: 2025, 2050; Model: 2100} & \multirow{4}{2.0cm}{550 ppm \& 650 ppm GHG stabilization} & \multicolumn{3}{c}{\head{Middle East \& Turkey region versus the Baseline}} \\
\ & & & & 2025 & 2050 \\
\ & & & 550 ppm & -10\% & -20\% \\
\ & & & 650 ppm & -25\% & -35\% \\
\midrule
\ \multirow{2}{2.0cm}{CEF} & \multirow{2}{2.0cm}{2030} & \multirow{2}{2.0cm}{Global carbon taxes} & \multicolumn{3}{c}{\head{OPEC wealth versus no carbon tax}} \\
\ & & & Carbon tax (\$50/TC -- \$2500/TC) & -3\% & -63\% \\
\bottomrule
\end{tabular}
\end{table*}
\end{document}
答案1
您不需要\␣
在每行开头使用命令(反斜杠 + 空格)。如果您删除它们,您的表格将按您预期的方式显示。
这样就消除了垂直空间,但仔细查看表格后,我实际上不太确定您希望表格如何构造。“中东...基线”是标题吗?还是单元格的内容?或者是某种子表中的标题?
我还删除了重复项\usepackage{tabulary}
,并注释掉了对 的另一个调用tabulary
,因为它似乎对输出没有任何影响。我\centering
还删除了单元格“未经测试的确定性”上的 (因为它不会改变输出,您可以指定该列应在表定义中居中)。
\documentclass{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{array}
\usepackage{ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\hspace{0pt}}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand{\head}[1]{\textsf{\textbf{#1}}}
% \usepackage{tabulary}
\usepackage{booktabs}
\usepackage{multirow} % Allows rows in tables to be combined.
\begin{document}
\begin{table*}
\caption{Summary of studies examining MENA or OPEC oil export revenues under climate policies}
\begin{tabular}{@{}C{2.0cm}C{2.0cm}P{2.0cm}P{3.0cm}C{1.0cm}C{1.0cm}@{}}
\toprule
\head{Study} & \head{Time horizon} & \multicolumn{1}{c}{\head{Climate policies}} & \head{Uncertainties tested} & \multicolumn{2}{c}{\head{Impact on oil export revenue}} \\
\midrule
\multirow{4}{2.0cm}{ABC} & \multirow{4}{2.0cm}{Results: 2025, 2050; Model: 2100} & \multirow{4}{2.0cm}{550 ppm \& 650 ppm GHG stabilization} & \multicolumn{3}{c}{\head{Middle East \& Turke\newline region versus the Baseline}} \\
& & & & 2025 & 2050 \\
& & & 550 ppm & -10\% & -20\% \\
& & & 650 ppm & -25\% & -35\% \\
\midrule
\multirow{2}{2.0cm}{CEF} & \multirow{2}{2.0cm}{2030} & \multirow{2}{2.0cm}{Global carbon taxes} & \multicolumn{3}{c}{\head{OPEC wealth versus no carbon tax}} \\
& & & Carbon tax (\$50/TC -- \$2500/TC) & -3\% & -63\% \\
\bottomrule
\end{tabular}
\end{table*}
\end{document}