我正在处理下表,但第一行未对齐。
我的出口如下
有人能帮我把标题对齐吗?
\documentclass[preprint,12pt,authoryear]{elsarticle}
% !TeX spellcheck = en_US
\usepackage{multirow} % para las tablas
\usepackage{siunitx}% paquete para manejo de números y unidades
\sisetup{detect-weight, detect-display-math}
\sisetup{detect-inline-weight=math}
% modo de unidades con barra en lugar de fracción de tamaño reducido
\sisetup{mode=text,per-mode=symbol}
\usepackage{booktabs}% para tablas
\usepackage{graphicx}% para gráficos
\usepackage{pgfplots}% para gráficos
\usepackage{pdflscape}% para gráficos
\pgfplotsset{compat=newest}% para gráficos
\usetikzlibrary{plotmarks}% para gráficos
\usetikzlibrary{arrows.meta}% para gráficos
\usepgfplotslibrary{patchplots}% para gráficos
\newlength\fwidth% definido en el código de Matlab
\setlength{\fwidth}{0.8\textwidth}% defino valor de parámetro fwidth de gráficos
\usepackage{tikzscale}% para gráficos
\pgfplotsset{plot coordinates/math parser=false}% para gráficos
\usepackage{overpic}% figuras
\usepackage{tikz}% figuras
\pgfplotsset{compat=1.15}
\usepackage{float}
\usepackage{etoolbox}
\usepackage{natbib}
\usepackage{hyperref,url}
\newcounter{bibcount}
\makeatletter
\patchcmd{\@lbibitem}{\item[}{\item[\hfil\stepcounter{bibcount}{\thebibcount.}}{}{}
\setlength{\bibhang}{2\parindent}
\renewcommand\NAT@bibsetup%
[1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\parindent}%
\setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
\makeatother
\bibliographystyle{agsm}
\usepackage[margin=2.5cm]{geometry}% setea márgenes de hoja
\usepackage{bicaption}
\usepackage{makecell}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\usepackage[skip=1ex, labelfont=bf]{caption}
\usepackage[skip=0.333\baselineskip]{caption}
\usepackage{amssymb}
\usepackage{url}
\usepackage{amsmath}
\def\UrlFont{\normalfont}
\begin{document}
\begin{table}[H]
\centering
\caption{Chemical properties of differents OS of the world}
\label{Chemical properties of OS on dry basis}
\begin{tabular}{l
*{10}S[table-format=2.0]
}
\toprule
&\multicolumn{6}{l}{\bfseries{Ultimate analysis (wt.\%)}}
& \multicolumn{9}{l}{\bfseries{Proximate analysis (wt.\%)}}
& \multicolumn{11}{l}{\bfseries{Calorific value (MJkg$^{-1}$)}} \\
\cmidrule(lr){2-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11}
{\bfseries{Region}} & {\bfseries{C}} & {\bfseries{H}} &
{\bfseries{O}} & {\bfseries{N}} & {\bfseries{S}} &
{\bfseries{VM}} & {\bfseries{FC$^\varphi$}} &
{\bfseries{Ash}} & {\bfseries{HHV}} & {\bfseries{LHV}} \\
\midrule
Mangrullo $^a$ & & & & & & & & & & \\
(Uruguay) & & & & & & & & &\\\\
Huadian$^b$ & 29.2 & 4.3 & * & 0.6 & 4.9 & 39.3 & 3.8 & 56.9 & * & 13.1 \\
(China) & & & & & & & & & &\\\\
Irati$^c$ & 16.5 & 1.8 & * & 0.5 & 4.0 & * & 76.9 & * & * & *\\
(Brazil) & & & & & & & & & &\\\\
Nongan$^b$ & 9.7 & 1.0 & * & 0.32 & 5.7 & 9.7 & 1.6 & 89.3 & * & 2.9\\
(China) & & & & & & & & & &\\\\
Estonia$^d$ & 30.4 & 3.0 & * & 0.1 & 1.6 & 49.6 & 1.1 & 49.3 & 11.9 & 11.\\
& & & & & & & & & &\\\\
Kentucky$^e$ & 10.3 & 1.3 & * & 0.4 & 2.7 & * & * & 83.6 & * & *\\
(USA) & & & & & & & & & &\\
\bottomrule
\end{tabular}\\\smallskip
\parbox{0.9\textwidth}{
\scriptsize.\\VM: volatile matter, FC: Fixed carbon.
All these values are expressed in dry basis\\
$\varphi$: Determined by difference: FC= 100\%-VM\%-Ash\%\\
a-obtained in this work\\
b-\cite{bai2015thermal}\\
c-\cite{carter1991testing}\\
d-\cite{yoruk2016oxy}\\
e-\cite{carter1985fluidized}\\
{*}: no data reported\\}
\end{table}
\end{document}
答案1
像这样吗?
我的主要建议是使用tabularx
环境而不是tabular
环境,以确保表格实际上适合文本块。我也会放弃使用加粗在表格的标题中:如果标题设计得很好,就没有必要喊。
还要注意,我已将序言简化为仅包含必要内容;您真的非常需要研究一下您真实文档的序言。
\documentclass[preprint,12pt,authoryear]{elsarticle}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\usepackage{booktabs}
\usepackage[margin=2.5cm]{geometry}
\usepackage[skip=0.333\baselineskip]{caption}
\usepackage{amssymb,amsmath}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document}
\begin{table}
\setlength\tabcolsep{4pt} % default value is '6pt'
\caption{Chemical properties of different OS of the world}
\label{Chemical properties of OS on dry basis}
\begin{tabularx}{\textwidth}{@{}l *{10}{C} @{}}
\toprule
Region
& \multicolumn{5}{>{\hsize=\dimexpr5\hsize+8\tabcolsep\relax}C}{Ultimate analysis}
& \multicolumn{3}{>{\hsize=\dimexpr3\hsize+4\tabcolsep\relax}C}{Proximate analysis}
& \multicolumn{2}{>{\hsize=\dimexpr2\hsize+2\tabcolsep\relax}C@{}}{Calorific value} \\
& \multicolumn{5}{c}{(wt. \%)}
& \multicolumn{3}{c}{(wt. \%)}
& \multicolumn{2}{c@{}}{(\si{\mega\joule\per\kilo\gram})}\\
\cmidrule(lr){2-6} \cmidrule(lr){7-9} \cmidrule(l){10-11}
& C & H & O & N & S & VM & FC$^\varphi$ & Ash & HHV & LHV \\
\midrule
Mangrullo$^a$ & & & & & & & & & & \\
(Uruguay)\\ \addlinespace
Huadian$^b$ & 29.2 & 4.3 & * & 0.6 & 4.9 & 39.3 & 3.8 & 56.9 & * & 13.1 \\
(China)\\ \addlinespace
Irati$^c$ & 16.5 & 1.8 & * & 0.5 & 4.0 & * & 76.9 & * & * & *\\
(Brazil)\\ \addlinespace
Nongan$^b$ & 9.7 & 1.0 & * & 0.32 & 5.7 & 9.7 & 1.6 & 89.3 & * & 2.9\\
(China)\\ \addlinespace
Estonia$^d$ & 30.4 & 3.0 & * & 0.1 & 1.6 & 49.6 & 1.1 & 49.3 & 11.9 & 11.\\ \addlinespace
Kentucky$^e$ & 10.3 & 1.3 & * & 0.4 & 2.7 & * & * & 83.6 & * & *\\
(USA)\\
\bottomrule
\end{tabularx}
\smallskip\footnotesize
VM: volatile matter, FC: Fixed carbon.
All values are expressed in dry basis.\\
$\varphi$: Determined by difference:
$\text{FC}=100\%-\text{VM\%}-\text{Ash\%}$.\\
a -obtained in this work\\
b -\cite{bai2015thermal}\\
c -\cite{carter1991testing}\\
d -\cite{yoruk2016oxy}\\
e -\cite{carter1985fluidized}\\
{*}: no data reported
\end{table}
\end{document}
答案2
编辑:现在我明白了,在我的答案的第一个版本中,我没有正确理解问题 :-(。但是,我仍然不清楚为什么州名在第二列。如果这样做的原因是为了给其他列腾出更多空间,那么就不能将其括起来\makecell[tl]{<province>\\<state>}
,正如我在下面翻新的 mwe 中所假设的那样。现在其中是更正后的列标题和注释:
- 对于表格,您文档序言中加载的大多数包都不相关。我将它们全部从我的 mwe 序言中删除
- 目前尚不清楚表格应该是什么样子。我认为,以州名开头的行是多余的(错误的假设,现已纠正)。
- 由于您有表格注释,我添加
threepartable
并使用它\note
命令
\documentclass[preprint,12pt,authoryear]{elsarticle}
\usepackage[margin=25mm]{geometry}
\usepackage{siunitx}% paquete para manejo de números y unidades
\sisetup{detect-weight,
detect-display-math,
detect-inline-weight=math,
mode=text,
per-mode=symbol}% modo de unidades con barra en lugar de fracción de tamaño reducido
\usepackage[skip=1ex, labelfont=bf]{caption}
\usepackage{booktabs, makecell, multirow, threeparttable}% para tablas
\renewcommand\theadfont{\bfseries\footnotesize}
\renewcommand\theadgape{}
\setcellgapes{3pt}
\begin{document}
\begin{table}[ht]
\caption{Chemical properties of differents OS of the world}
\label{Chemical properties of OS on dry basis}
\centering
\setlength\tabcolsep{3pt}
\makegapedcells
\begin{threeparttable}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
l
*{10}S[table-format=2.1]
@{}}
\toprule
\thead[l]{Region}
& \multicolumn{5}{c}{\thead{Proximate analysis\\ (wt.\%)}}
& \multicolumn{3}{c}{\thead{Ultimate analysis\\ (wt.\%)}}
& \multicolumn{2}{c}{\thead{Calorific value\\ (MJkg$^{-1}$)}}\\
\cmidrule(lr){2-6} \cmidrule(lr){7-9} \cmidrule(lr){10-11}
& {\thead{C}} & {\thead{H}} & {\thead{O}} & {\thead{N}} & {\thead{S}}
& {\thead{VM}} & {\thead{FC$^\varphi$}} & {\thead{Ash}}
& {\thead{HHV}} & {\thead{LHV}} \\
\midrule
\makecell[tl]{Mangrullo\tnote{a}\\ (Uruguay)}
& & & & &
& & &
& & \\
\makecell[tl]{Huadian\tnote{b}\\ (China)}
& 29.2 & 4.3 & {*} & 0.6 & 4.9
& 39.3 & 3.8 & 56.9
& {*} & 13.1 \\
\makecell[tl]{Irati\tnote{c}\\ (Brazil)}
& 16.5 & 1.8 & {*} & 0.5 & 4.0
& {*} & 76.9 & *
& {*} & {*} \\
\makecell[tl]{Nongan\tnote{b}\\ (China)}
& 9.7 & 1.0 & {*} & 0.32 & 5.7
& 9.7 & 1.6 & 89.3
& {*} & 2.9 \\
\makecell[tl]{Estonia\tnote{d}}
& 30.4 & 3.0 & {*} & 0.1 & 1.6
& 49.6 & 1.1 & 49.3
& 11.9 & 11. \\
\makecell[tl]{Kentucky\tnote{e}\\ (USA)}
& 10.3 & 1.3 & {*} & 0.4 & 2.7
& {*} & {*} & 83.6
& {*} & {*} \\
\bottomrule
\end{tabular*}
\begin{tablenotes}[flushleft]\footnotesize
\item[] VM: volatile matter, FC: Fixed carbon.¸All these values are expressed in dry basis
\item[]$\varphi$: Determined by difference:
$\text{FC} = \SI{100}{\%} - \text{VM}\,\% - \text{Ash}\,\%$
\item[a] obtained in this work
\item[b] \cite{bai2015thermal}
\item[c] \cite{carter1991testing}
\item[d] \cite{yoruk2016oxy}
\item[e] \cite{carter1985fluidized}
\item[*] no data reported
\end{tablenotes}
\end{threeparttable}
\end{table}