0

First:

  1. I am very new to LaTeX.
  2. Therefore, please assume I know next to nothing about LaTeX - because I probably know next to nothing about LaTex!

Problem: How can I add multiple paragraphs of text at the top of a longtable?

Context: I'm working on creating potentially dozens of tables. Some of them will be quite long in length, so I have opted to use the \longtable format. I have attached a picture of a table from the Journal of Finance which shows more or less what I am trying to accomplish.
(For whatever it is worth, the citation for the article the picture came from is as follows: Fama, Eugene F., and Kenneth R. French, 1996, Multifactor Explanations of Asset Pricing Anomalies Journal of Finance 51, 55-84.)

As you can see, there are a couple of paragraphs of explanatory text between the chart title and the beginning of the chart information. I'm trying to do something like that.

Here's what I've tried so far:

  1. I tried using the captions directly, but they didn't seem to work well with multiple paragraphs.
  2. I've tried using ThreePartTable with the package for \longtable, but I wasn't able to get multiple paragraphs working properly.
  3. I finally used a multicolumn with a single column table inside it, and with a minipage inside that. That option sort of worked, but setting the width of the minipage is problematic. For tables of some widths using \LTcapwidth worked well, and for others it did not. Fixing the width sort of worked, but one problem is that I am producing a lot of these tables and some of them need to be landscape, and that is when the fixed width starts looking lousy. If I use \linewidth as the width of the minipage it leads to column distortion in my present setup.
  4. I looked into floatarow a bit, but I haven't been able to figure out how to get that to work.

Here is a representative code sample of where I am presently:


\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}

Any ideas?

Here is the Journal of Finance picture:


Journal of Finance Example

  • To display code properly you may surround it with <pre> </pre> tags as in regular HTML. – texnezio Jun 13 '15 at 2:12
  • Thank you! I wish I'd seen your comment sooner - I just spent a few minutes putting four spaces in front of each line! – user80052 Jun 13 '15 at 2:22
  • Welcome! I don't really understand right now what you are trying to do. Or, at least, why you are trying to do it this way in particular. Why don't you just put the paragraphs before the start of the longtable environment? You can use \captionof... to create the caption itself, then put the paragraphs and then put the longtable. Note that the example is almost certainly not produced this way because the table is not placed at a natural point in the text. (longtable is not really a table. It cannot float. It just starts wherever you set it.) – cfr Jun 13 '15 at 2:48
  • Cfr, I'm not entirely sure why it is common in finance journals to have one or more paragraphs on top of the data in the table but below the caption/table number, but that seems to be the case. I suppose it is due to always having a detailed explanation of what is in the table. In any case, as I am very new at this, I will have to read up on the \captionof capabilities. One big problem I've had so far is in getting the darn paragraphs of explanation to align neatly with the edges of the table they are related to and explaining - and that is the crux of the problem. – user80052 Jun 13 '15 at 3:58
  • @user80052: Does it have to be a longtable? Does the content span across the page boundary? – Werner Jun 13 '15 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.