Graphics, Figures & TablesAdding explaining text under a table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Compaq
Posts: 6
Joined: Tue Feb 05, 2013 7:23 pm

Adding explaining text under a table

Post by Compaq »

Good morning,

I am studying chemistry at master level, and decided last semester to write some articles in LaTeX. This semester I found out I wanted to expand to write all my lab reports in LaTeX. This decision came with hours of hair-ripping ;)

I am trying to make good tables. I have installed the Booktabs package (whose documentation is one of the best I have ever seen). This package is very good, and gets me 90 % there. However, I am not able to get my explaining text under the table. Any table should have it, and so I assume there has to be an easy way to make it! I have tried a multicolumn, but the text just goes on forever on one line and extends outside my borders. My table is a very small one, and so that will be my working example (although it may be slightly more than "minimal").

Code: Select all

\documentclass[12pt]{report}

\usepackage{booktabs}
\usepackage{textgreek}


\begin{document}

\begin{table}
\caption{Shielding of Radiation with Different Materials}
\centering

\begin{tabular}{l r r r } \toprule 

\multicolumn{4}{r}{Measured sources [cps]} \\ \cmidrule(l){2-4}
Shielding Device & \textsuperscript{36}Cl & \textsuperscript{22}Na & \textsuperscript{239}Pu \\ \midrule
Unshielded	    & 320  & 70    & 53 \\
Paper		    & 70    & 69    & 0.10 \\
Glass		    & 0.03 & 1.4   & 0.04 \\
Thin Lead Sheet   & 0.05 & 1.0   & 0.04 \\
Thick Lead Sheet & 0.05 & 0.15  & 0.04 \\ \midrule
Type of Radiation & \textbeta & \textgamma & \textalpha \\ \bottomrule
\end{tabular}
\label{tab:shielding}
\end{table}

\end{document}
Another small detail that is bothering me is the placement of "Measured source" above the cmidrule. I am not able to fine-tune its placement, and now it stands slightly off-center from where I would like it to be.

I will appreciate any help on this matter.

Sincerely,
Anders

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Adding explaining text under a table

Post by Johannes_B »

Hi,

you can simply insert text after the tabular

Code: Select all

\documentclass[12pt]{report}

\usepackage{booktabs}
\usepackage{textgreek}
\usepackage{threeparttable}

\begin{document}

\begin{table}
\caption{Shielding of Radiation with Different Materials}
\label{tab:shielding}
\centering

\begin{tabular}{l r r r } \toprule 

&\multicolumn{3}{c}{Measured sources [cps]} \\ \cmidrule(l){2-4}
Shielding Device & \textsuperscript{36}Cl & \textsuperscript{22}Na & \textsuperscript{239}Pu \\ \midrule
Unshielded          & 320  & 70    & 53 \\
Paper               & 70    & 69    & 0.10 \\
Glass               & 0.03 & 1.4   & 0.04 \\
Thin Lead Sheet   & 0.05 & 1.0   & 0.04 \\
Thick Lead Sheet & 0.05 & 0.15  & 0.04 \\ \midrule
Type of Radiation & \textbeta & \textgamma & \textalpha \\ \bottomrule
\end{tabular}

\bigskip
%\medskip
You can simply put text here
\end{table}


\begin{table}
\centering
\begin{threeparttable}
\caption{a caption is here}
\begin{tabular}{c}
\toprule
thhe whole table has the width of the tabular\\
something\tnote{1}\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [1]hello, i'm a note of something
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
Do you know the packages siunitx and chemmacros. They might be helpful for a chemist.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Compaq
Posts: 6
Joined: Tue Feb 05, 2013 7:23 pm

Re: Adding explaining text under a table

Post by Compaq »

The threeparttable-solution looked far better, in my opinion, and so that will be my way of doing it from now on.

Thank you for your help! I will definitely check out the other packages you mentioned, those will come in handy!
Post Reply