I spent an inordinate amount of time creating 2 beautiful tables for a manuscript. Paper accepted!
Turns out the journal wants either Word or LaTeX, but not a mix, and the tables must be in the main text itself, not separate.
This leaves me with two options:
- Convert the tables to Word
- Rewrite the paper in LaTeX (still doing most writing in Word).
(2) Seemed to be the logical choice, and I was making progress until I realized my tables can't simply cut and paste into the LaTeX document. There are all sorts of clashing errors that are extremely unfriendly to newbies. They are also landscape (wide) tables, which isn't helping.
I tried (1) using pandoc, but I get absolute garbage – jibberish and missing 90% of the text.
Table Text as follows:
\documentclass[a4paper, landscape]{article}
% Make Landscape
\usepackage[a4paper,margin=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{dcolumn}
% dcolumn to line up decimals
\usepackage{booktabs,caption}
\captionsetup[table]{name=Table}
\usepackage[flushleft]{threeparttable}
% The above two to allow that last line with the dagger as a bottom note.
\usepackage{caption}
\captionsetup{skip=0pt}
% Eliminates the space between the caption and the table itself.
\begin{document}
\begin{table}[!htbp] \centering
\begin{threeparttable}
\caption{Regression models linking number of pregnancies to telomere length (models 1-4) and DNAmAge (models 5-8).}
\label{table2}
\begin{tabular}{
>{\bfseries}l
D{.}{.}{3}
D{.}{.}{3}
D{.}{.}{3}
D{.}{.}{3}
D{.}{.}{3}
D{.}{.}{3}
D{.}{.}{3}
D{.}{.}{3} }
\\[-1.8ex]\hline
\hline \\[-1.8ex]
\\[-1.8ex] & \multicolumn{4}{c}{\textbf{Telomere Length~}} & \multicolumn{4}{c}{\textbf{DNAmAge~}} \\
\\[-1.8ex] & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)$^{\dagger}$} & \multicolumn{1}{c}{(3)$^{\dagger}$} & \multicolumn{1}{c}{(4)$^{\dagger}$} & \multicolumn{1}{c}{(5)} & \multicolumn{1}{c}{(6)$^{\dagger}$} & \multicolumn{1}{c}{(7)$^{\dagger}$} & \multicolumn{1}{c}{(8)$^{\dagger}$}\\
% You need the $ to 'leave' the text and get back to a command
\hline \\[-1.8ex]
%%%%%%%%%
Age & -0.047 & -0.029 & -0.028 & -0.029 & 0.485 & 0.667 & 0.656 & 0.645 \\
& p = 0.003^{**} & p = 0.071^{+} & p = 0.073^{+} & p = 0.068^{+} & p = 0.293 & p = 0.157 & p = 0.158 & p = 0.165 \\
No.Pregnancies & -0.014 & -0.013 & -0.014 & -0.016 & 0.363 & 0.326 & 0.459 & 0.510 \\
& p = 0.025^{*} & p = 0.039^{*} & p = 0.031^{*} & p = 0.020^{*} & p = 0.026^{*} & p = 0.049^{*} & p = 0.007^{**} & p = 0.005^{**} \\
SES & & -0.006 & -0.006 & -0.004 & & -0.180 & -0.214 & -0.291 \\
& & p = 0.143 & p = 0.161 & p = 0.395 & & p = 0.146 & p = 0.081^{+} & p = 0.055^{+} \\
Currently Pregnant (Y) & & & 0.011 & 0.011 & & & -1.472 & -1.460 \\
& & & p = 0.534 & p = 0.540 & & & p = 0.001^{**} & p = 0.001^{**} \\
No.Pregnancies x SES & & & & -0.004 & & & & 0.106 \\
& & & & p = 0.362 & & & & p = 0.385 \\
Intercept & 1.826 & 1.337 & 1.332 & 1.343 & 14.818 & 10.319 & 10.611 & 10.850 \\
& p < 0.001^{**} & p < 0.001^{**} & p < 0.001^{**} & p < 0.001^{**} & p = 0.138 & p = 0.318 & p = 0.297 & p = 0.287 \\
\hline \\[-1.8ex]
\normalfont{Observations} & \multicolumn{1}{c}{821} & \multicolumn{1}{c}{821} & \multicolumn{1}{c}{821} & \multicolumn{1}{c}{821} & \multicolumn{1}{c}{397} & \multicolumn{1}{c}{397} & \multicolumn{1}{c}{397} & \multicolumn{1}{c}{397} \\
\normalfont{Adjusted R$^{2}$} & \multicolumn{1}{c}{0.015} & \multicolumn{1}{c}{0.063} & \multicolumn{1}{c}{0.062} & \multicolumn{1}{c}{0.062} & \multicolumn{1}{c}{0.011} & \multicolumn{1}{c}{0.041} & \multicolumn{1}{c}{0.067} & \multicolumn{1}{c}{0.067} \\
%%%%%%%%%%%%%%
\hline \\[-1.8ex]
\end{tabular}
\begin{tablenotes}
\small
\item $^{\dagger}$Marked models include controls for top 10 principal components of genetic variation and average urbanicity-score (complete results in Supplementary Table S1).
+p\textless{0.1};
*p\textless0.05;
**p\textless0.01;
***p\textless0.001
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
Journal (Scientific Reports) Template here
Please help! I have been trying to transition to LaTeX (with R and RMarkdown) and convince others this is a good idea, but am seriously let down when I can't even embed a simple table into a pre-existing template!
Best Answer
I think you should aim to declutter the look of the table, say by moving the "p-value" reminders into the header column. Incidentally, don't bother showing the p-values of the intercept terms: Nobody cares whether these terms are significant or not.
Also, do provide more structure to the
d
columns; that'll tighten up the look of the table tremendously. I'd also remove all bold-facing: it doesn't actually help make the table more readable or understandable. Since you're loading thebooktabs
package anyway, you might as well (should?!) use its line-drawing macros instead of the generic-LaTeX\hline
directive. And, since you're loading thethreeparttable
environment, why not also make use of the\tnote
macro for the "dagger" markers in the second header row.Off-topic: Is "urbanicity" a real word? Might "urbanization" work for you? In my view, the term "urbanicity" is particularly unfortunate as it contains the particles "urb[is]" and "city" -- two terms for, well, cities...