第一的:
- 我对 LaTeX 还很陌生。
- 因此,请假设我对 LaTeX 几乎一无所知——因为我可能对 LaTeX 几乎一无所知!
问题:如何在长表顶部添加多段文本?
背景:我正在创建可能数十个表格。其中一些表格会很长,所以我选择使用 \longtable 格式。我附上了一张来自《金融杂志》的表格图片,它或多或少地显示了我想要完成的任务。
(无论如何,图片出自以下文章:Fama,Eugene F. 和 Kenneth R. French,1996 年,《资产定价异常的多因素解释》《金融杂志》51,55-84。)
如您所见,图表标题和图表信息开头之间有几段说明性文字。我正在尝试做类似的事情。
以下是我迄今为止尝试过的方法:
- 我尝试直接使用标题,但它们似乎无法很好地适用于多个段落。
- 我曾尝试将 ThreePartTable 与 \longtable 包一起使用,但无法使多个段落正常工作。
- 我最终使用了多列,其中有一个单列表格,并在其中有一个迷你页面。该选项有点管用,但设置迷你页面的宽度是有问题的。对于某些宽度的表格,使用 \LTcapwidth 效果很好,但对于其他宽度的表格则不行。固定宽度有点管用,但有一个问题是,我正在制作很多这样的表格,其中一些需要横向显示,这时固定宽度就开始显得很糟糕。如果我使用 \linewidth 作为迷你页面的宽度,则会导致我当前设置中的列失真。
- 我研究了一下 floatarow,但还是不知道如何让它工作。
以下是我目前所在位置的代表性代码示例:
\documentclass[titlepage, 12pt]{article}
%table heading formatting options
\renewcommand{\thetable}{\Roman{table}}
[font=normal,format=plain,labelfont=bf,textfont=normal]{caption}
\captionsetup[longtable]{labelsep=newline, labelfont={bf}, textfont=bf,justification=centering}
\usepackage[autolanguage]{numprint}
\usepackage{textgreek}
\usepackage[group-separator={,}]{siunitx}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{lscape}
\usepackage{pdflscape}
\begin{document}
\begin{footnotesize}
\begin{center}
\sisetup{
table-number-alignment = center,
table-figures-integer = 2,
table-figures-decimal = 3 ,
group-separator = {,},
group-minimum-digits = 4,
table-alignment = center,
table-text-alignment = center,
table-alignment = center
}
\begin{longtable}{
l
c
S[table-figures-decimal = 0, table-figures-integer = 6]
S[table-auto-round, table-figures-integer = 2]
S[table-auto-round]
S[table-auto-round, table-figures-integer = 4]
}
\caption[Summary Statistics - Five Year Model, Full Sample: Means]{}
\label{SUMSTAT01_5_full} \\
\multicolumn{6}{l}{
\begin{minipage}{\LTcapwidth}
\begin{center}
\textbf{Summary Statistics - Five Year Model, Full Sample: Means}
\end{center}
This should be easier to do! Why isn't this easier to do? Please help me figure it out! I've tried all sorts of things. Since I have lots and lots of tables to create it would be a real pain to try to set the width every single time.
\par \medskip
Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah.
\smallskip
\end{minipage}
}\\
\toprule
& {COL1} & {COL2} & {COL3} & {COL4} & {COL5} \\
\midrule
\endfirsthead
\midrule
\multicolumn{6}{c}{{\bfseries \tablename\ \thetable{} -- continued from the previous page}} \\
\midrule
& {COL1} & {COL2} & {COL3} & {COL4} & {COL5} \\
\midrule
\endhead
\midrule
\multicolumn{6}{r}{{continued on the next page}}\\
\midrule
\endfoot
\bottomrule
\endlastfoot
Trial & YES & 151815 & 8.2305954837 & 0.5513711463 & 450.75781766 \\
Trial & YES2 & 127531 & 7.5297313765 & 0.4943696243 & 485.10425355 \\
Trial & NYES2 & 23681 & 11.757722059 & 1.0090898125 & 182.35834537 \\
Trial & MYES2 & 603 & 17.942064831 & 0.4946424531 & 279.23812997 \\
Trial & YES & 151815 & 10.718360856 & 0.7656048317 & 1039.9406661 \\
Trial & YES2 & 127531 & 9.4807831025 & 0.7124781639 & 1016.8742469 \\
Trial & NYES2 & 23681 & 17.520985282 & 1.173702597 & 1168.098722 \\
Trial & MYES2 & 603 & 5.3063864738 & 0.6627817549 & 48.809692677 \\
Trial & YES & 151815 & 9.9146933603 & 0.2688930162 & 1042.4965239 \\
Trial & YES2 & 127531 & 8.878489454 & 0.2222813219 & 1075.9381969 \\
Trial & NYES2 & 23681 & 15.677220199 & 0.6291159789 & 856.11646782 \\
Trial & MYES2 & 603 & 2.7600040137 & 0.0672161106 & 19.41349738 \\
Trial & YES & 151815 & 6.3468883568 & 0.1737891726 & 384.31016995 \\
Trial & YES2 & 127531 & 5.3677618357 & 0.1269725926 & 299.33380335 \\
Trial & NYES2 & 23681 & 11.717182039 & 0.5205426579 & 681.38510039 \\
Trial & MYES2 & 603 & 2.5244334379 & -0.016130709 & 17.509923373 \\
Trial & YES & 133627 & 3.00259351 & 0.0342590644 & 58.209967773 \\
Trial & YES2 & 113049 & 2.3802075163 & -0.039793444 & 49.284415047 \\
Trial & NYES2 & 20222 & 6.4445976388 & 0.6705317062 & 93.449108461 \\
Trial & MYES2 & 356 & 5.1259269838 & 0.2266487243 & 60.987551338 \\
Trial & YES & 133627 & 4.2294824502 & 0.1831488408 & 178.25225147 \\
Trial & YES2 & 113049 & 3.3954464713 & 0.11164883 & 170.80519768 \\
Trial & NYES2 & 20222 & 8.9261436997 & 0.7950387415 & 216.42292083 \\
Trial & MYES2 & 356 & 2.2942285165 & 0.1270704114 & 11.883009242 \\
Trial & YES & 133627 & 3.5372425078 & -0.190200047 & 235.3636565 \\
Trial & YES2 & 113049 & 3.1017223322 & -0.253853329 & 253.26206576 \\
Trial & NYES2 & 20222 & 5.8562794995 & 0.314694337 & 83.619180653 \\
Trial & MYES2 & 356 & 10.109024197 & -0.061181175 & 165.55957453 \\
Trial & YES & 133627 & 3.7369994282 & -0.26062239 & 291.15425792 \\
Trial & YES2 & 113049 & 3.0121634787 & -0.321935201 & 299.64694313 \\
Trial & NYES2 & 20222 & 7.8236627329 & 0.2206365747 & 241.23548778 \\
Trial & MYES2 & 356 & 1.7748475111 & -0.12297606 & 11.359612768 \\
\end{longtable}
\end{center}
\end{footnotesize}
%the landscape problem
\begin{landscape}
\begin{footnotesize}
\begin{center}
\sisetup{
table-number-alignment = center,
table-figures-integer = 2,
table-figures-decimal = 3 ,
group-separator = {,},
group-minimum-digits = 4,
table-alignment = center,
table-text-alignment = center,
table-alignment = center
}
\begin{longtable}{
l
c
S[table-figures-decimal = 0, table-figures-integer = 6]
S[table-auto-round, table-figures-integer = 2]
S[table-auto-round]
S[table-auto-round, table-figures-integer = 4]
S[table-auto-round]
S[table-auto-round, table-figures-integer = 4]
S[table-auto-round]
S[table-auto-round, table-figures-integer = 4]
}
\caption[Summary Statistics - Five Year Model, Full Sample: Means]{}
\label{SUMSTAT01_5_full} \\
\multicolumn{8}{l}{
\begin{minipage}{\LTcapwidth}
\begin{center}
\textbf{Summary Statistics - Five Year Model, Full Sample: Means}
\end{center}
This should be easier to do! Why isn't this easier to do? Please help me figure it out! I've tried all sorts of things. Since I have lots and lots of tables to create it would be a real pain to try to set the width every single time.
\par \medskip
Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah. Blah blah blah blah blah.
\smallskip
\end{minipage}
}\\
\toprule
& {COL1} & {COL2} & {COL3} & {COL4} & {COL5} & {COL6} & {COL7}\\
\midrule
\endfirsthead
\midrule
\multicolumn{8}{c}{{\bfseries \tablename\ \thetable{} -- continued from the previous page}} \\
\midrule
& {COL1} & {COL2} & {COL3} & {COL4} & {COL5} & {COL6} & {COL7}\\
\midrule
\endhead
\midrule
\multicolumn{8}{r}{{continued on the next page}}\\
\midrule
\endfoot
\bottomrule
\endlastfoot
Trial & YES & 151815 & 8.2305954837 & 0.5513711463 & 450.75781766 & 0.5513711463 & 450.75781766 \\
Trial & YES2 & 127531 & 7.5297313765 & 0.4943696243 & 485.10425355 & 0.4943696243 & 485.10425355 \\
Trial & NYES2 & 23681 & 11.757722059 & 1.0090898125 & 182.35834537 & 1.0090898125 & 182.35834537 \\
Trial & MYES2 & 603 & 17.942064831 & 0.4946424531 & 279.23812997 & 0.4946424531 & 279.23812997 \\
Trial & YES & 151815 & 10.718360856 & 0.7656048317 & 1039.9406661 & 0.7656048317 & 1039.9406661 \\
Trial & YES2 & 127531 & 9.4807831025 & 0.7124781639 & 1016.8742469 & 0.7124781639 & 1016.8742469 \\
Trial & NYES2 & 23681 & 17.520985282 & 1.173702597 & 1168.098722 & 1.173702597 & 1168.098722 \\
Trial & MYES2 & 603 & 5.3063864738 & 0.6627817549 & 48.809692677 & 0.6627817549 & 48.809692677 \\
Trial & YES & 151815 & 9.9146933603 & 0.2688930162 & 1042.4965239 & 0.2688930162 & 1042.4965239 \\
Trial & YES2 & 127531 & 8.878489454 & 0.2222813219 & 1075.9381969 & 0.2222813219 & 1075.9381969 \\
Trial & NYES2 & 23681 & 15.677220199 & 0.6291159789 & 856.11646782 & 0.6291159789 & 856.11646782 \\
Trial & MYES2 & 603 & 2.7600040137 & 0.0672161106 & 19.41349738 & 0.0672161106 & 19.41349738 \\
Trial & YES & 151815 & 6.3468883568 & 0.1737891726 & 384.31016995 & 0.1737891726 & 384.31016995 \\
Trial & YES2 & 127531 & 5.3677618357 & 0.1269725926 & 299.33380335 & 0.1269725926 & 299.33380335 \\
Trial & NYES2 & 23681 & 11.717182039 & 0.5205426579 & 681.38510039 & 0.5205426579 & 681.38510039 \\
Trial & MYES2 & 603 & 2.5244334379 & -0.016130709 & 17.509923373 & -0.016130709 & 17.509923373 \\
Trial & YES & 133627 & 3.00259351 & 0.0342590644 & 58.209967773 & 0.0342590644 & 58.209967773 \\
Trial & YES2 & 113049 & 2.3802075163 & -0.039793444 & 49.284415047 & -0.039793444 & 49.284415047 \\
Trial & NYES2 & 20222 & 6.4445976388 & 0.6705317062 & 93.449108461 & 0.6705317062 & 93.449108461 \\
Trial & MYES2 & 356 & 5.1259269838 & 0.2266487243 & 60.987551338 & 0.2266487243 & 60.987551338 \\
Trial & YES & 133627 & 4.2294824502 & 0.1831488408 & 178.25225147 & 0.1831488408 & 178.25225147 \\
Trial & YES2 & 113049 & 3.3954464713 & 0.11164883 & 170.80519768 & 0.11164883 & 170.80519768\\
Trial & NYES2 & 20222 & 8.9261436997 & 0.7950387415 & 216.42292083 & 0.7950387415 & 216.42292083 \\
Trial & MYES2 & 356 & 2.2942285165 & 0.1270704114 & 11.883009242 & 0.1270704114 & 11.883009242 \\
Trial & YES & 133627 & 3.5372425078 & -0.190200047 & 235.3636565 & -0.190200047 & 235.3636565 \\
Trial & YES2 & 113049 & 3.1017223322 & -0.253853329 & 253.26206576 & -0.253853329 & 253.26206576 \\
Trial & NYES2 & 20222 & 5.8562794995 & 0.314694337 & 83.619180653 & 0.314694337 & 83.619180653 \\
Trial & MYES2 & 356 & 10.109024197 & -0.061181175 & 165.55957453 & -0.061181175 & 165.55957453 \\
Trial & YES & 133627 & 3.7369994282 & -0.26062239 & 291.15425792 & -0.26062239 & 291.15425792 \\
Trial & YES2 & 113049 & 3.0121634787 & -0.321935201 & 299.64694313 & -0.321935201 & 299.64694313 \\
Trial & NYES2 & 20222 & 7.8236627329 & 0.2206365747 & 241.23548778 & 0.2206365747 & 241.23548778 \\
Trial & MYES2 & 356 & 1.7748475111 & -0.12297606 & 11.359612768 & -0.12297606 & 11.359612768\\
\end{longtable}
\end{center}
\end{footnotesize}
\end{landscape}
\end{document}
有任何想法吗?
以下是《金融杂志》的图片: