我正在尝试将标题放在表格下方,使其在两列文档中居中。我希望表格位于页面顶部,并且是章节标题之后的第一项。到目前为止,我能够将表格放在中间,但标题与列一样宽。这是我的代码:
\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}
我希望这个表格的标题与图片的宽度基本相同,并且不占一行。
答案1
这里您有一个使用该包的双列文档multicol
(示例中的第 1 章),然后您暂时结束双列环境,以单列模式启动,添加表格,并恢复两列。
\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}
改用
\begin{multicols}{2}
\chapter{Method}
\kant[1-3]
\end{multicols} % now start one column <<<<<<<<<<<<
\chapter{Results \& Discussion}\label{chapter:Results}
将会使
答案2
您可以使用可选参数\twocolumn
在页面顶部添加整页内容。问题是\chapter
已经这样做了,而且每页只能执行一次。
\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}
答案3
虽然这是一种黑客手段,但是,嘿,它确实有效!
布置桌面在章节标题中。
\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}
否\resizebox
,是siunitx
。tabular*
您可以使用该表格调整文本宽度。