1

I am trying to place a caption underneath the table to be centered in a two columned document. I want the table to be on top of the page and the first thing to come after the chapter title. So far I was able to place the table in the middle but the caption is as wide as the columns. Here is the code that I have:

\chapter{Results \& Discussion}\label{chapter:Results}
% Please add the following required packages to your document preamble:

\begin{table}[]
\resizebox{\textwidth}{!}{%
\begin{tabular}{@{}lcccc@{}}
\toprule
                 & \multicolumn{2}{c}{\textbf{Male}}         & \multicolumn{2}{c}{\textbf{Female}}       \\ \midrule
\textbf{Anatomy} & \textbf{Min. force} & \textbf{Max. force} & \textbf{Min. force} & \textbf{Max. force} \\ \midrule
Thyroid          & 2.32 $\pm$ 2.33      & 6.57 $\pm$ 1.84      & 1.8 $\pm$ 0.96       & 4.56 $\pm$ 1.74      \\ \midrule
Forearm artery   & 3.34 $\pm$ 1.5       & 8.04 $\pm$ 1.95      & 2.2 $\pm$ 1.17       & 6.58 $\pm$ 2.19      \\ \midrule
Calf muscles     & 1.67 $\pm$ 1.29      & 4.8 $\pm$ 1.5        & 1.33 $\pm$ 0.86      & 4.2 $\pm$ 0.95       \\ \midrule
Vertebrae        & 7.36 $\pm$ 4.19      & 27.83 $\pm$ 3.84     & 5.8 $\pm$ 4.82       & 23 $\pm$ 9.55        \\ \midrule
Abdominal aorta  & 7.19 $\pm$ 5.66      & 17.56 $\pm$ 7.54     & 8.47 $\pm$ 3         & 18.91$\pm$ 3.85      \\ \bottomrule
\end{tabular}%
}
\caption{Recorded minimum and maximum forces for all anatomies and gender. All forces measured in newtons.}
\label{tab:forceResults}
\end{table}

This is what it looks like: enter image description here

I want the caption of this table be basically the same width as the picture and not go to a separate line.

2
  • In a two-column document you would normally use table* to get a wide table spanning the two columns, otherwise the text of the other column may interfere. That will also give a wide caption. And it is strongly advised not to use \resizebox. Oct 28, 2022 at 19:01
  • you have a full width table overprinting the second column, any following text will over-print the table and be unreadable, you should make the table \columnwidth not \textwidth Oct 28, 2022 at 19:27

3 Answers 3

1

Here you have a two-column document that uses the multicol package (Chapter 1 in the example), then you temporarily end the two-column environment, start in one-column mode, add the tabular, and resume two columns.

a

\documentclass[openany]{book}

\usepackage{caption}% needed for captionof

\usepackage{booktabs}% rules
\usepackage{multicol}% two columns <<<

\usepackage{kantlipsum} % ONLY dummy text

\begin{document}
    
    \begin{multicols}{2}
        \chapter{Method}
            \kant[1-3] 
            \chapter{Results \& Discussion}\label{chapter:Results}          
    \end{multicols} % now start one column <<<<<<<<<<<<     

  \noindent\begin{tabular*}{\textwidth}{@{}lcccc@{}}
                \toprule
                & \multicolumn{2}{c}{\textbf{Male}}     & \multicolumn{2}{c}{\textbf{Female}}       \\ \midrule
                \textbf{Anatomy} & \textbf{Min. force} & \textbf{Max. force} & \textbf{Min. force} & \textbf{Max. force} \\ \midrule
                Thyroid          & 2.32 $\pm$ 2.33      & 6.57 $\pm$ 1.84      & 1.8 $\pm$ 0.96       & 4.56 $\pm$ 1.74      \\ \midrule
                Forearm artery   & 3.34 $\pm$ 1.5       & 8.04 $\pm$ 1.95      & 2.2 $\pm$ 1.17       & 6.58 $\pm$ 2.19      \\ \midrule
                Calf muscles     & 1.67 $\pm$ 1.29      & 4.8 $\pm$ 1.5        & 1.33 $\pm$ 0.86      & 4.2 $\pm$ 0.95       \\ \midrule
                Vertebrae        & 7.36 $\pm$ 4.19      & 27.83 $\pm$ 3.84     & 5.8 $\pm$ 4.82       & 23 $\pm$ 9.55        \\ \midrule
                Abdominal aorta  & 7.19 $\pm$ 5.66      & 17.56 $\pm$ 7.54     & 8.47 $\pm$ 3         & 18.91$\pm$ 3.85      \\ \bottomrule
            \end{tabular*}
    \captionof{figure}{Recorded minimum and maximum forces for all anatomies and gender. All forces measured in newtons.\label{tab:forceResults}}                       

    \begin{multicols}{2} % restart two column
    \kant[1-2]  
    \end{multicols}

\end{document}

Using instead

    \begin{multicols}{2}
        \chapter{Method}
            \kant[1-3] 
    \end{multicols} % now start one column <<<<<<<<<<<<
    
    \chapter{Results \& Discussion}\label{chapter:Results}  

will make

b

1
  • Thank you, this solved my problem.
    – dmr
    Oct 30, 2022 at 11:11
0

You can use the optional argument of \twocolumn to add full page stuff at the top of a page. The problem is that \chapter already does it, and you can only do it once per page.

\documentclass[twocolumn]{report}
\usepackage{booktabs}
\usepackage{caption}% for \captionof

\usepackage{lipsum}

\begin{document}

\cleardoublepage\thispagestyle{plain}%
\twocolumn[\vbox{\csname @twocolumnfalse\endcsname
  \csname @chapter\endcsname[Results \& Discussion]{Results \& Discussion}\label{chapter:Results}}
% Please add the following required packages to your document preamble:
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccc@{}}
\toprule
                 & \multicolumn{2}{c}{\textbf{Male}}         & \multicolumn{2}{c}{\textbf{Female}}       \\ \midrule
\textbf{Anatomy} & \textbf{Min. force} & \textbf{Max. force} & \textbf{Min. force} & \textbf{Max. force} \\ \midrule
Thyroid          & 2.32 $\pm$ 2.33      & 6.57 $\pm$ 1.84      & 1.8 $\pm$ 0.96       & 4.56 $\pm$ 1.74      \\ \midrule
Forearm artery   & 3.34 $\pm$ 1.5       & 8.04 $\pm$ 1.95      & 2.2 $\pm$ 1.17       & 6.58 $\pm$ 2.19      \\ \midrule
Calf muscles     & 1.67 $\pm$ 1.29      & 4.8 $\pm$ 1.5        & 1.33 $\pm$ 0.86      & 4.2 $\pm$ 0.95       \\ \midrule
Vertebrae        & 7.36 $\pm$ 4.19      & 27.83 $\pm$ 3.84     & 5.8 $\pm$ 4.82       & 23 $\pm$ 9.55        \\ \midrule
Abdominal aorta  & 7.19 $\pm$ 5.66      & 17.56 $\pm$ 7.54     & 8.47 $\pm$ 3         & 18.91$\pm$ 3.85      \\ \bottomrule
\end{tabular*}
\captionof{table}{Recorded minimum and maximum forces for all anatomies and gender. All forces measured in newtons.}
\label{tab:forceResults}
\vskip\intextsep]

\lipsum[1-2]

\end{document}
0

A hack, but, hey, it works!

Set the table in the chapter title.

\documentclass[a4paper,twocolumn]{book}

\usepackage{capt-of}
\usepackage{booktabs}
\usepackage{siunitx}

\sisetup{uncertainty-mode = separate}

\usepackage{lipsum} % for mock text

\begin{document}
\chapter[Results and Discussion]{%
  Results and Discussion\label{chapter:Results}\\[4ex]
  \normalsize\normalfont
  \begin{tabular*}{\textwidth}{
    @{\extracolsep{\fill}}
    l
    S[table-format=1.2(2)]
    S[table-format=2.2(2)]
    S[table-format=1.2(2)]
    S[table-format=2.2(2)]
    @{}
  }
  \toprule
  \textbf{Anatomy} &
  \multicolumn{2}{c}{\textbf{Male}} &
  \multicolumn{2}{c}{\textbf{Female}} \\
  \cmidrule{2-3} \cmidrule{4-5}
  &
  {\textbf{Min.\ force}} &
  {\textbf{Max.\ force}} &
  {\textbf{Min.\ force}} &
  {\textbf{Max.\ force}} \\
  \midrule
  Thyroid          & 2.32 \pm 2.33 &  6.57 \pm 1.84 & 1.8  \pm 0.96 &  4.56 \pm 1.74 \\
  Forearm artery   & 3.34 \pm 1.5  &  8.04 \pm 1.95 & 2.2  \pm 1.17 &  6.58 \pm 2.19 \\
  Calf muscles     & 1.67 \pm 1.29 &  4.8  \pm 1.5  & 1.33 \pm 0.86 &  4.2  \pm 0.95 \\
  Vertebrae        & 7.36 \pm 4.19 & 27.83 \pm 3.84 & 5.8  \pm 4.82 & 23    \pm 9.55 \\
  Abdominal aorta  & 7.19 \pm 5.66 & 17.56 \pm 7.54 & 8.47 \pm 3    & 18.91 \pm 3.85 \\
  \bottomrule
  \end{tabular*}\\
  \captionof{table}{Recorded minimum and maximum forces 
    for all anatomies and gender. All forces measured in
    newtons.\label{tab:forceResults}
  }
}

\lipsum

\end{document}

No \resizebox and yes siunitx. With tabular* you can make the table to the text width.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .