Graphics, Figures & Tables ⇒ How to generate tables like in scientific journals
How to generate tables like in scientific journals
sorry to bother you with my table questions, but I have always wondered how one could generate in LaTeX a table with a bottomrule under the tablenotes (well, in fact I would like to make such a table). I have included a screenshot of a journal article to serve as example. I had to pixelize it because it is probably copyrighted material, but I think one can still make out the general structure. The table has a short rule above the footnotes (labeled a and b) and a heavy rule beneath them. Is it possible to generate such a table with LaTeX?
- Attachments
-
- Table.png (22.11 KiB) Viewed 11992 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
How to generate tables like in scientific journals
I recommend to use the booktabs package for that purpose, have a look at its documentation.
Stefan
Re: How to generate tables like in scientific journals
thank you for your reply. I am already using the booktabs package but what I do not know is how to actually get the footnotes into the table. I am using treeparttable to generate tablenotes and can only get them under the table...
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to generate tables like in scientific journals
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont={bf,sf},tableposition=top]{caption}
\usepackage{booktabs}
\begin{document}
\begin{table}[!ht]
\caption{Table caption}\label{tab:notes}
\centering
\begin{tabular}{lccccc}\toprule
Item & n & Mean & Median & Minimum & Maximum \\
An item & 1 & Value\textsuperscript{1} & Value\textsuperscript{2} & Value\textsuperscript{3} & Value\textsuperscript{4} \\ \cmidrule{1-2}
\multicolumn{6}{l}{\footnotesize \textsuperscript{1}\,Footnote inside a table} \\
\multicolumn{6}{l}{\footnotesize \textsuperscript{2}\,Footnote inside a table} \\
\multicolumn{6}{l}{\footnotesize \textsuperscript{3}\,Footnote inside a table} \\
\multicolumn{6}{l}{\footnotesize \textsuperscript{4}\,Footnote inside a table} \\ \bottomrule
\end{tabular}
\end{table}
\end{document}
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: How to generate tables like in scientific journals
Re: How to generate tables like in scientific journals
How to generate tables like in scientific journals
Code: Select all
\newenvironment{TableNotes}[1]
{\begin{list}{}%
{\renewcommand\makelabel[1]{\textsuperscript{##1}\hfill}%
\singlespacing
\setlength\topsep{0pt}
\setlength\itemsep{0pt}
\setlength\parsep{0pt}
\setlength\partopsep{0pt}
\settowidth\labelwidth{\makelabel{#1}}%
\setlength\leftmargin{\labelwidth+\labelsep}}}%
{\end{list}}%
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to generate tables like in scientific journals
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont={bf,sf},tableposition=top]{caption}
\usepackage{booktabs,tabularx}
\begin{document}
\begin{table}[!ht]
\caption{Table caption}\label{tab:notes}
\centering
\begin{tabularx}{\linewidth}{Xccccc}\toprule
Item & n & Mean & Median & Minimum & Maximum \\ \midrule
An item & 1 & Value\textsuperscript{1} & Value\textsuperscript{2} & Value\textsuperscript{3} & Value\textsuperscript{4} \\
An item & 2 & Value & Value & Value & Value \\
An item & 3 & Value & Value & Value & Value \\ \addlinespace
\end{tabularx}
\footnoterule
\footnotesize
\begin{tabularx}{\linewidth}{@{}l@{\,}X@{}}
\textsuperscript{1}& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\
\textsuperscript{2}& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\
\textsuperscript{3}& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\
\textsuperscript{4}& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\ \bottomrule
\end{tabularx}
\end{table}
\end{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: How to generate tables like in scientific journals
thank you very much for that idea. That also looks good, but I will first have to have a look at the tabularx package to be able to understand what it does

In the meantime I also came up with a nasty solution for the space problem, which is adding \vspace*{-2em} before and \vspace*{-1.25em} after the list environment. Does the job, but can't really be the way to do it, can it?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to generate tables like in scientific journals
It can't do any harm if you provide a minimal working example (MWE) where you show your idea. That would be something to tinker.Isopropyl wrote:[...] In the meantime I also came up with a nasty solution for the space problem, which is adding \vspace*{-2em} before and \vspace*{-1.25em} after the list environment. Does the job, but can't really be the way to do it, can it?
In the meantime I modified my example once more and added features of the array package (loaded by tabularx) to get a higher degree of automatism concerning the table notes.
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont={bf,sf},tableposition=top]{caption}
\usepackage{booktabs,tabularx}
\begin{document}
\begin{table}[!ht]
\caption{Table caption}\label{tab:notes}
\centering
\begin{tabularx}{\linewidth}{Xccccc}\toprule
Item & n & Mean & Median & Minimum & Maximum \\ \midrule
An item & 1 & Value\textsuperscript{1} & Value\textsuperscript{2} & Value\textsuperscript{3} & Value\textsuperscript{4} \\
An item & 2 & Value & Value & Value & Value \\
An item & 3 & Value & Value & Value & Value \\ \addlinespace
\end{tabularx}
\footnoterule
\footnotesize
\newcounter{tabnote}
\begin{tabularx}{\linewidth}{@{}>{\stepcounter{tabnote}\textsuperscript{\thetabnote}}l@{\,}X@{}}
& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\
& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\
& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\
& Footnote inside a table. Footnote inside a table. Footnote inside a table. Footnote inside a table. \\ \bottomrule
\end{tabularx}
\end{table}
\end{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10