我正在使用下面给出的代码并粘贴输出。我想对齐这个表,有什么指导吗?
\documentclass[onecolumn]{svjour3}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage[font=small, labelfont=bf]{caption}
\usepackage{sidecap}
\usepackage{subcaption}
\usepackage{multirow}
\usepackage{cite}
\usepackage{flushend}
\usepackage{booktabs,siunitx}
\newcolumntype{A}{>{\raggedright\arraybackslash}p{0.24\linewidth}}
\newcolumntype{B}{>{\centering\arraybackslash}p{0.04\linewidth}}
\newcolumntype{C}{>{\centering\arraybackslash}p{0.05\linewidth}}
\newcolumntype{D}{>{\centering\arraybackslash}p{0.04\linewidth}}
\newcolumntype{E}{>{\centering\arraybackslash}p{0.04\linewidth}}
\newcolumntype{F}{>{\centering\arraybackslash}p{0.04\linewidth}}
\newcolumntype{G}{>{\centering\arraybackslash}p{0.05\linewidth}}
\newcolumntype{H}{>{\centering\arraybackslash}p{0.04\linewidth}}
\newcolumntype{I}{>{\centering\arraybackslash}p{0.07\linewidth}}
\newcolumntype{J}{>{\centering\arraybackslash}p{0.06\linewidth}}
\newcolumntype{K}{>{\centering\arraybackslash}p{0.1\linewidth}}
\newcolumntype{P}\[1\]{>{\centering\arraybackslash}p{#1}}
\begin{document}
\begin{table*}[ht]
\caption{Utterance distribution over emotional classes of the databases used in the experiments}
\label{summary}
{\small
\begin{tabularx}{1.04\textwidth}{ABCDEFGHIJK}
\toprule
Dataset &Angry&Neutral&Happy&Sad&Calm&Disgust &Fear&Surprised&Boredom& Total utterances\\
\midrule
RAVDESS &192&96&192&192&192&192&192&192&&1440\\
Berlin Emotional Speech Database (EmoDB) &127&79&71&62&-&46&68&-&82&535\\
\bottomrule
\end{tabularx}
}
\end{table*}
\end{document}
答案1
首先,caption
与不兼容svjour3
,你确实得到了
Package caption Warning: Unknown document class (or package),
(caption) standard defaults will be used.
See the caption package documentation for explanation.
我会避免使用两个长条目,而是在表格下方添加图例。您可以使用tabular*
并让 TeX 计算列间距。
\documentclass[onecolumn]{svjour3}
\usepackage{booktabs}
\begin{document}
\begin{table}[htp]
\caption{Utterance distribution over emotional classes of the databases used in the experiments}
\label{summary}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lcccccccccc}
\toprule
Dataset & Angry & Neutral & Happy & Sad & Calm & Disgust & Fear & Surprised & Boredom & TU \\
\midrule
RAVDESS & 192 & 96 & 192 & 192 & 192 & 192 & 192 & 192 & & 1440 \\
EmoDB & 127 & 79 & 71 & 62 & -- & 46 & 68 & -- & 82 & 535 \\
\midrule[\heavyrulewidth]
\multicolumn{11}{l}{EmoDB: Berlin Emotional Speech Database; TU: Total utterances}
\end{tabular*}
\end{table}
\end{document}
答案2
\documentclass[onecolumn]{svjour3}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage[font=small, labelfont=bf]{caption}
\usepackage{subcaption}
\usepackage{booktabs,siunitx}
\begin{document}
\begin{table*}[ht]
\caption{Utterance distribution over emotional classes of the databases used in the experiments}
\label{summary}
\resizebox{\linewidth}{!}{%
\tabcolsep=4pt
\begin{tabular}{@{}*{11}{c} @{}}\toprule
Dataset &Angry&Neutral&Happy&Sad&Calm&Disgust &Fear&Surprised&Boredom&
\tabular{l}Total\\utterances\endtabular\\\midrule
RAVDESS &192&96&192&192&192&192&192&192&&1440\\
\tabular{l}Berlin\\Emotional\\ Speech\\ Database \\(EmoDB)\endtabular
&127&79&71&62&-&46&68&-&82&535\\
\bottomrule
\end{tabular}}
\end{table*}
\end{document}