General Understanding
Basically, what I'm trying to do is streamline the entire process of creating tables for one or possibly a number of scientif papers. The ultimate objective would be to find something like a common style for tables, i.e. a rough draft/frame for (regular) tables as well as long tables. It should be said that I would like to cover strictly scientific tables.
I'm well aware of the fact that one should pose questions that are rather designed to have a clear answer than to trigger a discussion. Nevertheless, a stream of "Best practice questions" has emerged here, yet an issue like this one was never really dealt with. I've read quite a lot through the basics of typography of tables, scientific rules and packages relevant for tables; here's what I found most helpful:
- A quite comprehensive guide on tables with many examples
- Best practice typography and all kinds of scientif advise and many more
- An overview of packages, and something like a recommendation/best practice
However, I would like to take this a step further, and address how users actually employ packages and code to create tables.
Most importantly, I want these types of tables to look the same to the extent possible.
Questions that could be addressed:
- What packages do you use? (Is there something more sofisticated that makes sense, like tabu etc.?)
- How do you scale to textwidth or whatever? (Personally, I find the resize/scalebox-approach quite appealing, because it gives you continous scalability as compared to discrete fontsizes. Anyway, I also kind of see the pitfalls and it won't work for longtables, right? Or, do you always use something like tabularx etc.)
- In which cases do you go to landscape mode?
- How do you choose to align columns? Is there a sensible way to align something like "56 (16%)" or would you choose two columns?
- How do you include formulae/equations in your tables?
- How do you achieve consistency in terms of style between regular and long tables? (As far as I'm concerned, the standard design seems to be quite dissimilar)
- How do you format your table notes? Iyo, what should be the smallest fontsize for table contents and notes compared to regular textsize?
- +Pretty much whatever comes to you mind
- How do you make sure you use this standardized tablesetting? I've created .xml files with the environment names/definitions, but have also seen new environments defined in the preamble.
Anyway, to sum this up, what I'm looking for is the answer to the question how do you personally fomat your tables.
To get an idea, in the following I will post an MWE for a regular and a long table:
MWE/Environments
Preamble/Packages
\usepackage{longtable}
\usepackage{ifthen}
\usepackage{array}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\usepackage{threeparttablex}
\usepackage{dcolumn}
\usepackage[labelfont=bf,format=plain,labelsep=colon,textformat=period,font={small,singlespacing},justification=justified,singlelinecheck=false,skip=6pt,belowskip=-6pt]{caption}
Standard Table
\begin{table}[htb]
\newcolumntype{.}{D{.}{.}{}}
\scalebox{1}{
\begin{threeparttable}
\begin{tabular}{ll}
\toprule
\midrule
\bottomrule
\end{tabular}
\begin{tablenotes}
\footnotesize
\item\quad
\end{tablenotes}
\end{threeparttable}}
\caption{}
\label{tab:}
\end{table}
Long Table
\begin{ThreePartTable}
\begin{TableNotes}
\vspace{-12pt}
\scriptsize\singlespacing
\item[a]
\end{TableNotes}
\begin{longtable}{ll}
\toprule
\toprule
\multicolumn{4}{c}{\textbf{Two-Stage Cross-Sectional Regressions}}\\
\endfirsthead
\multicolumn{4}{c}
{{\bfseries\tablename\ \thetable{}} -- {\itshape continued}}\\ \\
\endhead
%\midrule
%\multicolumn{3}{|r|}{{Continued~on~next~page}}
%\\
%\midrule
\endfoot
\endlastfoot
%Tablecontents
%&//* &//
\insertTableNotes\\
\caption{}
\label{tab:}
\end{longtable}
\end{ThreePartTable}
Gladly, I will accept other tips for the automatization of including data into Latex tables. Also, I will do the necessary to keep this topic as well organized as possible. Please cosider keeping it open for a while, maybe I will be able to create a guideline from it.
Edit:
Ok, there seems to be a need to further clarify what I am aiming at. Since I'm trying to figure out what a best practice - either in general or for my personal purposes - could look like, I would like to see glimpses or more of the "table practice". So if anyone who uses a somewhat standardized approach that goes beyond just typing in some basic tabular environment and is willing to share it, please do so!
pgfplotstable
is something I hadn't taken into consideration, but I will look into it.