如何拆分标题的标签和文本

如何拆分标题的标签和文本

我不知道如何拆分标签和标题文本,就像这样:

在此处输入图片描述

答案1

您应该caption使用选项加载包labelsep=newlinesinglelinecheck=false来加载该包。

此外,如果您希望标题与相关tabular材料占据相同的宽度,则应将标题和表格材料都放在一个threeparttable环境中。

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,dcolumn,caption,threeparttable}
\newcolumntype{d}[1]{D..{#1}}
\captionsetup{labelsep=newline,
              singlelinecheck=false,
              skip=0.25\baselineskip}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\begin{table}
\caption{BBCM coefficients for vertical sensors in the four cardinal orientations.}
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}*{4}{d{2.4}}}
\toprule
Coeff. & \mc{North} & \mc{South} & \mc{East} & \mc{West} \\
\midrule
$a_1$ &  1.1097 &  0.9141 &  1.1065 &  1.0670 \\
$\vdots$ \\
$c_2$ & -0.2464 &  0.2997 & -0.0947 &  0.5877 \\
$\vdots$ \\
$b_4$ &  0.0400 & -0.0299 &  0.0442 &  0.0853 \\
\bottomrule
\end{tabular*}
\end{table}

\begin{table}[htbp] 
\centering  
\begin{threeparttable}
\caption{Average daily maximum hourly radiation and its average environmental temperature for each evaluated month.}\label{table:1} 
\begin{tabular}{lcc} 
\toprule 
Month & Radiation [W/m$^2$] & Temperature [$^{\circ}$C]  \\
\midrule
January & 791 & 31.6 \\ 
April & 686 & 30.5 \\ 
July & 636 & 26.6 \\ 
October & 855 & 30.7 \\ 
\bottomrule 
\end{tabular} 
\end{threeparttable}
\end{table}
\end{document}

相关内容