长桌

长桌

有人能告诉我如何调整表格内容,以便最后一列正确显示吗?这是针对文档类论文的。您可以找到这里

此 cls 的 MWE 如下所示。

\documentclass[12pt,a4paper, oneside, openright]{Thesis}
\usepackage{lmodern,babel,adjustbox,booktabs,multirow}
\usepackage{makecell}
\usepackage{tabularx}




\begin{document}

\section{Summary of literature}
\begin{table}

    \footnotesize
    \begin{tabularx}{\columnwidth}{llll}
        \toprule
         References & Databases & Deep Learning Approach & Recognition Accuracy  \\
        \midrule
        T.Tuncer \cite{tuncer2021automated} &RAVDESS,EmoDB,SAVEE&Q-Wavelet Transform&87.43\%.90.09\%,79.08\%\\
        M.Mastaqeem \cite{sajjad2020clustering}&IEMOCAP,RAVDESS,EmoDB&Deep BiLSTM&72.25\%,85.57\%,77.02\%\\
        T.Anvarjon \cite{anvarjon2020deep}&IEMOCAP,EmoDB&Spectrogram based CNN&77.01\%,92.02\%\\
        S.Zhong \cite{zhong2020exploration}&IEMOCAP,EmoDB,CASIA&Fused feature&74.88\%,83.33\%,98.12\%\\
        
        S.Latif \cite{latif2020multi}&IEMOCAP&Multi-tasking with gender and speaker recognition&68.5\%\\        
        
        
        \bottomrule 
    \end{tabularx}

\end{table}


\end{document}

上述代码对应的pdf是在此处输入图片描述

有没有办法自动调整 col 文本?我试过了p{\width},但在这里不起作用。使用 X 代替 l 后编辑的结果是这 问候

答案1

您的表中至少有两个问题:

  • tabularx表必须至少有一个列属于X其派生类型
  • 文本中用逗号分隔的单词在逗号后应有空格。
\documentclass[12pt,a4paper, oneside, openright]{Thesis}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{siunitx}
\usepackage{adjustbox}
\usepackage{booktabs,makecell, multirow, tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}

\begin{document}

\section{Summary of literature}
\begin{table}[ht] % 
\caption{Summary of Literature}
    \footnotesize
    \setlength\tabcolsep{4pt}
    \begin{tabularx}{\columnwidth}{@{} lLLL @{}}
        \toprule
References  
    & Databases 
        & \makecell{Deep Learning\\ Approach} 
            & \makecell{Recognition\\ Accuracy}                     \\

        \midrule
T.Tuncer \cite{tuncer2021automated} 
    & RAVDESS, EmoDB, SAVEE
        & Q-Wavelet Transform   
            & \qty{87.43}{\%}. \qty{90.09}{\%}, \qty{79.08}{\%}     \\
        \addlinespace
M.Mastaqeem \cite{sajjad2020clustering}
    & IEMOCAP, RAVDESS, EmoDB
        & Deep BiLSTM
            & \qty{72.25}{\%}, \qty{85.57}{\%}, \qty{77.02}{\%}     \\
        \addlinespace
T.Anvarjon \cite{anvarjon2020deep}
    & IEMOCAP, EmoDB
        & Spectrogram based CNN
            & \qty{77.01}{\%}, \qty{92.02}{\%}                      \\
        \addlinespace
S.Zhong \cite{zhong2020exploration}
    & IEMOCAP, EmoDB, CASIA
        & Fused feature
            & \qty{74.88}{\%}, \qty{83.33}{\%}, \qty{98.12}{\%}     \\
        \addlinespace
S.Latif \cite{latif2020multi}
    & IEMOCAP   
        & Multi-tasking with gender and speaker recognition
            & \qty{68.5}{\%}                                        \\
        \bottomrule
    \end{tabularx}
\end{table}

\end{document}

在此处输入图片描述

无关

  • 表中的数量(百分比)是使用siunitx包装。
  • 添加了表格放置选项[ht],因此表格不会被推到章节标题之前。

附录: 如果您更喜欢使用tabularray包,这里有一个替代解决方案,使用tblrtabularray和表格字体大小˙\small`。

\documentclass[12pt,a4paper,oneside,openright]{Thesis}
\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}

\begin{document}
\section{Summary of literature}
    \begin{table}[ht]
    \centering
    \caption{Summary of Literature}
\begin{tblr}{colspec = {@{} l X[l] X[1.1, l] X[l] @{}},
             row{1}  = {c, m},
             rows    = {font=\small\linespread{0.9}\selectfont}
            }
    \toprule
References 
    & Databases                 
        & Deep Learning Approach
            & {Recognition Accuracy}       \\
    \midrule
T.Tuncer \cite{tuncer2021automated}
    & RAVDESS, EmoDB, SAVEE
        & Q-Wavelet Transform
            & \qty{87.43}{\%}. \qty{90.09}{\%}, \qty{79.08}{\%}     \\
M.Mastaqeem \cite{sajjad2020clustering}
    & IEMOCAP, RAVDESS, EmoDB
        & Deep BiLSTM
            & \qty{72.25}{\%}, \qty{85.57}{\%}, \qty{77.02}{\%}     \\
T.Anvarjon \cite{anvarjon2020deep}
    & IEMOCAP, EmoDB
        & Spectrogram based CNN
            & \qty{77.01}{\%}, \qty{92.02}{\%}                      \\
S.Zhong \cite{zhong2020exploration}
    & IEMOCAP, EmoDB, CASIA
        & Fused feature
            & \qty{74.88}{\%}, \qty{83.33}{\%}, \qty{98.12}{\%}     \\
S.Latif \cite{latif2020multi}
    & IEMOCAP
        & Multi-tasking with gender and speaker recognition
            & \qty{68.5}{\%}                                        \\
    \bottomrule
\end{tblr}
\end{table}
\bibliographystyle{plain}
\bibliography{reference}
\end{document}

在此处输入图片描述

答案2

长桌

\documentclass[12pt,a4paper,oneside,openright]{Thesis}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\section{Summary of literature}
\begin{tblr}
[
long,
caption        = {Summary of Literature},
label          = {tblr:test},
]
{
rowhead        = 1,
colspec        = {Q[c,m]Q[c,m]Q[c,m]Q[c,m]},
hline{1,Z}     = {.08em},
hline{2}       = {.05em},
rows           = {font=\footnotesize},
row{even[2-Z]} = {gray9!40}
}
References                              & Databases                 & Deep Learning Approach                               & {Recognition\\Accuracy}     \\
T.Tuncer \cite{tuncer2021automated}     & {RAVDESS\\EmoDB\\SAVEE}   & Q-Wavelet Transform                                  & {87.43\%\\90.09\%\\79.08\%} \\
M.Mastaqeem \cite{sajjad2020clustering} & {IEMOCAP\\RAVDESS\\EmoDB} & Deep BiLSTM                                          & {72.25\%\\85.57\%\\77.02\%} \\
T.Anvarjon \cite{anvarjon2020deep}      & {IEMOCAP\\EmoDB}          & Spectrogram based CNN                                & {77.01\%\\92.02\%}          \\
S.Zhong \cite{zhong2020exploration}     & {IEMOCAP\\EmoDB\\CASIA}   & Fused feature                                        & {74.88\%\\83.33\%\\98.12\%} \\
S.Latif \cite{latif2020multi}           & IEMOCAP                   & {Multi-tasking with gender\\and speaker recognition} & 68.50\%                     \\
T.Tuncer \cite{tuncer2021automated}     & {RAVDESS\\EmoDB\\SAVEE}   & Q-Wavelet Transform                                  & {87.43\%\\90.09\%\\79.08\%} \\
M.Mastaqeem \cite{sajjad2020clustering} & {IEMOCAP\\RAVDESS\\EmoDB} & Deep BiLSTM                                          & {72.25\%\\85.57\%\\77.02\%} \\
T.Anvarjon \cite{anvarjon2020deep}      & {IEMOCAP\\EmoDB}          & Spectrogram based CNN                                & {77.01\%\\92.02\%}          \\
S.Zhong \cite{zhong2020exploration}     & {IEMOCAP\\EmoDB\\CASIA}   & Fused feature                                        & {74.88\%\\83.33\%\\98.12\%} \\
S.Latif \cite{latif2020multi}           & IEMOCAP                   & {Multi-tasking with gender\\and speaker recognition} & 68.50\%                     \\
T.Tuncer \cite{tuncer2021automated}     & {RAVDESS\\EmoDB\\SAVEE}   & Q-Wavelet Transform                                  & {87.43\%\\90.09\%\\79.08\%} \\
M.Mastaqeem \cite{sajjad2020clustering} & {IEMOCAP\\RAVDESS\\EmoDB} & Deep BiLSTM                                          & {72.25\%\\85.57\%\\77.02\%} \\
T.Anvarjon \cite{anvarjon2020deep}      & {IEMOCAP\\EmoDB}          & Spectrogram based CNN                                & {77.01\%\\92.02\%}          \\
S.Zhong \cite{zhong2020exploration}     & {IEMOCAP\\EmoDB\\CASIA}   & Fused feature                                        & {74.88\%\\83.33\%\\98.12\%} \\
S.Latif \cite{latif2020multi}           & IEMOCAP                   & {Multi-tasking with gender\\and speaker recognition} & 68.50\%                     \\
T.Tuncer \cite{tuncer2021automated}     & {RAVDESS\\EmoDB\\SAVEE}   & Q-Wavelet Transform                                  & {87.43\%\\90.09\%\\79.08\%} \\
M.Mastaqeem \cite{sajjad2020clustering} & {IEMOCAP\\RAVDESS\\EmoDB} & Deep BiLSTM                                          & {72.25\%\\85.57\%\\77.02\%} \\
T.Anvarjon \cite{anvarjon2020deep}      & {IEMOCAP\\EmoDB}          & Spectrogram based CNN                                & {77.01\%\\92.02\%}          \\
S.Zhong \cite{zhong2020exploration}     & {IEMOCAP\\EmoDB\\CASIA}   & Fused feature                                        & {74.88\%\\83.33\%\\98.12\%} \\
S.Latif \cite{latif2020multi}           & IEMOCAP                   & {Multi-tasking with gender\\and speaker recognition} & 68.50\%                     \\
\end{tblr}
\bibliographystyle{plain}
\bibliography{reference}
\end{document}

在此处输入图片描述

桌上浮标

\documentclass[12pt,a4paper,oneside,openright]{Thesis}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\section{Summary of literature}
\begin{table}
\centering
\caption{Summary of Literature}
\begin{tblr}
{
colspec        = {Q[c,m]Q[c,m]Q[c,m]Q[c,m]},
hline{1,Z}     = {.08em},
hline{2}       = {.05em},
rows           = {font=\footnotesize},
row{even[2-Z]} = {gray9!40}
}
References                              & Databases                 & Deep Learning Approach                               & {Recognition\\Accuracy}     \\
T.Tuncer \cite{tuncer2021automated}     & {RAVDESS\\EmoDB\\SAVEE}   & Q-Wavelet Transform                                  & {87.43\%\\90.09\%\\79.08\%} \\
M.Mastaqeem \cite{sajjad2020clustering} & {IEMOCAP\\RAVDESS\\EmoDB} & Deep BiLSTM                                          & {72.25\%\\85.57\%\\77.02\%} \\
T.Anvarjon \cite{anvarjon2020deep}      & {IEMOCAP\\EmoDB}          & Spectrogram based CNN                                & {77.01\%\\92.02\%}          \\
S.Zhong \cite{zhong2020exploration}     & {IEMOCAP\\EmoDB\\CASIA}   & Fused feature                                        & {74.88\%\\83.33\%\\98.12\%} \\
S.Latif \cite{latif2020multi}           & IEMOCAP                   & {Multi-tasking with gender\\and speaker recognition} & 68.50\%                     \\
\end{tblr}
\end{table}
\bibliographystyle{plain}
\bibliography{reference}
\end{document}

在此处输入图片描述

相关内容