有一张长桌
\documentclass[14pt, a4paper]{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX},Renderer=Basic}
\setmainfont[Ligatures={TeX,Historic}]{Times New Roman}
\usepackage{indentfirst}
\frenchspacing
%%% Tables.
\usepackage{array, booktabs, longtable}
\usepackage{makecell, multirow}
%
\usepackage{siunitx}
% Caption of Table
\usepackage[format=hang,
labelsep = space,
skip=1ex,
singlelinecheck=false]{caption}
%%% Page
\usepackage{extsizes}
\usepackage{geometry}
\geometry{top=20mm, bottom=20mm, left=20mm, right=15mm}
\begin{document}
\begingroup
\sisetup{table-column-width=7.5ex}
\begin{longtable}[l]{c S[table-format= 4.1]
S[table-format=-3.1, table-column-width=9.5ex]
S[table-format=-3.1]
S[table-format= 1.4]
S[table-format= 1.2]
S[table-format=-2.1]
S[table-format=-2.1]
}
\caption{--- Caption of long table}
\label{tableLabel} \\
\toprule
\multirow{3}{*}{Date}
& {\multirow{3}{*}{\makecell{Ratio of the \\ volume of, \\ transactions \\ to the number \\ of transactions \\ EURO}}}
& \multicolumn{2}{c}{\makecell{Absolute \\ increases, \\ EURO}}
& \multicolumn{2}{c}{Coefficients}
& \multicolumn{2}{c}{\makecell{Rates of\\ growth \%}} \\
\cmidrule(lr){3-8}
& & {chain}
& {base}
& {chain}
& {base}
& {chain}
& {base} \\
\midrule
{1} & {2} & {3} & {4} & {5} & {6} & {7} & {8} \\
\midrule
\endfirsthead
%
\multicolumn{8}{r}{Table continuation \ref{tableLabel}} \\
\midrule
\multirow{3}{*}{Date}
& {\multirow{3}{*}{\makecell{Ratio of the \\ volume of, \\ transactions \\ to the number \\ of transactions \\ EURO}}}
& \multicolumn{2}{c}{\makecell{Absolute \\ increases}}
& \multicolumn{2}{c}{Coefficients}
& \multicolumn{2}{c}{\makecell{Rates of\\ growth \%}} \\
\cmidrule(lr){3-8}
& & {chain}
& {base}
& {chain}
& {base}
& {chain}
& {base} \\
\midrule
{1} & {2} & {3} & {4} & {5} & {6} & {7} & {8} \\
\midrule
\endhead
\midrule
\multicolumn{8}{r}{Table continuation \ref{tableLabel} on the next page\ldots}
\endfoot
\bottomrule
\endlastfoot
%
30.09.2014 & 1438 & {--} & {--} & {--} & 1 & {--} & {--} \\
01.10.2014 & 1358,6&-79,4&-79,4&0,945&0,94&-5,5&-5,5 \\
02.10.2014&796,3&-562,3&-641,7&0,586&0,55&-41,4&-44,6 \\
03.10.2014&685,5&-110,8&-752,5&0,861&0,48&-13,9&-52,3 \\
06.10.2014&574,8&-110,7&-863,2&0,839&0,4&-16,1&-60 \\
\addlinespace
07.10.2014&620,7&45,9&-817,3&1,08&0,43&8&-56,8 \\
08.10.2014&696,9&76,2&-741,1&1,123&0,48&12,3&-51,5 \\
09.10.2014&647,1&-49,8&-790,9&0,929&0,45&-7,1&-55 \\
10.10.2014&734,6&87,5&-703,4&1,135&0,51&13,5&-48,9 \\
13.10.2014&764,8&30,2&-673,2&1,041&0,53&4,1&-46,8 \\
\addlinespace
01.10.2014&1358,6&-79,4&-79,4&0,945&0,94&-5,5&-5,5 \\
02.10.2014&796,3&-562,3&-641,7&0,586&0,55&-41,4&-44,6 \\
03.10.2014&685,5&-110,8&-752,5&0,861&0,48&-13,9&-52,3 \\
06.10.2014&574,8&-110,7&-863,2&0,839&0,4&-16,1&-60 \\
07.10.2014&620,7&45,9&-817,3&1,08&0,43&8&-56,8 \\
\addlinespace
08.10.2014&696,9&76,2&-741,1&1,123&0,48&12,3&-51,5 \\
09.10.2014&647,1&-49,8&-790,9&0,929&0,45&-7,1&-55 \\
10.10.2014&734,6&87,5&-703,4&1,135&0,51&13,5&-48,9 \\
13.10.2014&764,8&30,2&-673,2&1,041&0,53&4,1&-46,8 \\
01.10.2014&1358,6&-79,4&-79,4&0,945&0,94&-5,5&-5,5 \\
\addlinespace
02.10.2014&796,3&-562,3&-641,7&0,586&0,55&-41,4&-44,6 \\
03.10.2014&685,5&-110,8&-752,5&0,861&0,48&-13,9&-52,3 \\
06.10.2014&574,8&-110,7&-863,2&0,839&0,4&-16,1&-60 \\
07.10.2014&620,7&45,9&-817,3&1,08&0,43&8&-56,8 \\
08.10.2014&696,9&76,2&-741,1&1,123&0,48&12,3&-51,5 \\
\addlinespace
09.10.2014&647,1&-49,8&-790,9&0,929&0,45&-7,1&-55 \\
10.10.2014&734,6&87,5&-703,4&1,135&0,51&13,5&-48,9 \\
13.10.2014&764,8&30,2&-673,2&1,041&0,53&4,1&-46,8 \\
01.10.2014&1358,6&-79,4&-79,4&0,945&0,94&-5,5&-5,5 \\
02.10.2014&796,3&-562,3&-641,7&0,586&0,55&-41,4&-44,6 \\
\addlinespace
03.10.2014&685,5&-110,8&-752,5&0,861&0,48&-13,9&-52,3 \\
06.10.2014&574,8&-110,7&-863,2&0,839&0,4&-16,1&-60 \\
07.10.2014&620,7&45,9&-817,3&1,08&0,43&8&-56,8 \\
08.10.2014&696,9&76,2&-741,1&1,123&0,48&12,3&-51,5 \\
09.10.2014&647,1&-49,8&-790,9&0,929&0,45&-7,1&-55 \\
\addlinespace
10.10.2014&734,6&87,5&-703,4&1,135&0,51&13,5&-48,9 \\
13.10.2014&764,8&30,2&-673,2&1,041&0,53&4,1&-46,8 \\
01.10.2014&1358,6&-79,4&-79,4&0,945&0,94&-5,5&-5,5 \\
02.10.2014&796,3&-562,3&-641,7&0,586&0,55&-41,4&-44,6 \\
03.10.2014&685,5&-110,8&-752,5&0,861&0,48&-13,9&-52,3 \\
\addlinespace
\end{longtable}
\endgroup
\end{document}
该表格的第二列标题中有很多文本。这些文本超出了他的单元格的范围。
如何增加第二列的标题高度,以使文本适合该高度?
答案1
把大象放进手提箱是不可能的……
有两种可能的解决方案:
- 使第二列标题更短,并在表格底部给出其解释(如上图所示)。对于此解决方案,您需要更改以下表格代码行:
\sisetup{table-column-width=6.5ex}
\begin{longtable}[l]{@{}c
S[table-column-width=11ex,
table-format= 4.1]
S[table-format=-3.1]
S[table-format=-3.1]
S[table-format= 1.4]
S[table-format= 1.2]
S[table-format=-2.1]
S[table-format=-2.1]
@{}}
\caption{--- Caption of long table}
\label{tableLabel} \\
\toprule
\multirow{3}{*}{Date}
& {\multirow{3}{*}[1ex]{\makecell{Ratio V/N\\ transactions$^*$\\ EURO}}}
& \multicolumn{2}{c}{\makecell{Absolute increases, \\ EURO}}
& \multicolumn{2}{c}{Coefficients}
& \multicolumn{2}{c}{\makecell{Rates of\\ growth \%}} \\
\cmidrule(lr){3-4}
\cmidrule(lr){5-6}
\cmidrule(lr){7-8}
& & {chain}
& {base}
& {chain}
& {base}
& {chain}
& {base} \\
\midrule
{1} & {2} & {3} & {4} & {5} & {6} & {7} & {8} \\
\midrule
\endfirsthead
%
\multicolumn{8}{r}{Table continuation \ref{tableLabel}} \\
\midrule
\multirow{3}{*}{Date}
& {\multirow{3}{*}[1ex]{\makecell{Ratio V/N\\ transactions$^*$\\ EURO}}}
& \multicolumn{2}{c}{\makecell{Absolute \\ increases}}
& \multicolumn{2}{c}{Coefficients}
& \multicolumn{2}{c}{\makecell{Rates of\\ growth \%}} \\
\cmidrule(lr){3-4}
\cmidrule(lr){5-6}
\cmidrule(lr){7-8}
& & {chain}
& {base}
& {chain}
& {base}
& {chain}
& {base} \\
\midrule
{1} & {2} & {3} & {4} & {5} & {6} & {7} & {8} \\
\midrule
\endhead
\midrule
\multicolumn{5}{@{}l}{\footnotesize
$^*$: Ratio of the volume of, transactions to the number of transactions in EURO}
& \multicolumn{3}{r}{\footnotesize Continuation on the next page}
\endfoot
\bottomrule
\multicolumn{8}{@{}l}{\footnotesize
$^*$: Ratio of the volume of, transactions to the number of transactions in EURO}
\endlastfoot
- 或者对第二列标题使用较小的字体:
其中您需要将下表代码行更改如下:
\sisetup{table-column-width=6ex}
\begin{longtable}[l]{@{}c
S[table-column-width=13ex,
table-format= 4.1]
S[table-format=-3.1]
S[table-format=-3.1]
S[table-format= 1.4]
S[table-format= 1.2]
S[table-format=-2.1]
S[table-format=-2.1]
@{}}
\caption{--- Caption of long table}
\label{tableLabel} \\
\toprule
\multirow{3}{*}{Date}
& {\multirow{3}{*}[1ex]{\footnotesize\makecell{Ratio of the volume\\
of, transactions to the \\
number of transactions\\
EURO}}}
& \multicolumn{2}{c}{\makecell{Absolute increases, \\ EURO}}
& \multicolumn{2}{c}{Coefficients}
& \multicolumn{2}{c}{\makecell{Rates of\\ growth \%}} \\
\cmidrule(lr){3-4}
\cmidrule(lr){5-6}
\cmidrule(lr){7-8}
& & {chain}
& {base}
& {chain}
& {base}
& {chain}
& {base} \\
\midrule
{1} & {2} & {3} & {4} & {5} & {6} & {7} & {8} \\
\midrule
\endfirsthead
%
\multicolumn{8}{r}{Table continuation \ref{tableLabel}} \\
\midrule
\multirow{3}{*}{Date}
& {\multirow{3}{*}[1ex]{\footnotesize\makecell{Ratio of the volume\\
of, transactions to the \\
number of transactions\\
EURO}}}
& \multicolumn{2}{c}{\makecell{Absolute \\ increases}}
& \multicolumn{2}{c}{Coefficients}
& \multicolumn{2}{c}{\makecell{Rates of\\ growth \%}} \\
\cmidrule(lr){3-4}
\cmidrule(lr){5-6}
\cmidrule(lr){7-8}
& & {chain}
& {base}
& {chain}
& {base}
& {chain}
& {base} \\
\midrule
{1} & {2} & {3} & {4} & {5} & {6} & {7} & {8} \\
\midrule
\endhead
在两种情况下也需要重新定义列宽。我会选择第一种情况。除了描述之外,可能还有其他解决方案,但我留给了其他答案(如果有的话)