显示表格标题时出现问题

显示表格标题时出现问题

我正面临与表格标题有关的问题。

代码如下:

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{gensymb}
\usepackage[version=3]{mhchem}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{dirtytalk}
\usepackage{amsmath}
\usepackage{float}
\usepackage[bottom]{footmisc}

\renewcommand{\thefootnote}{\alph{footnote}}

\usepackage{graphicx}
\graphicspath{ {images/} }

\begin{document}   


 \begin{table}[htbp]
      \centering
      \caption{Comparison between \ce{H2o} activity coefficients for the following starting conditions: n_{\ce{NH3}}=3 mole, n_{\ce{H2O}}=34.4 mole; T=57\celsius}
        \begin{tabular}{cccc}
        \toprule
        Something & Something & Something & Something \\
        \midrule
        number & number & number & number \\
        number  & number & number & number \\
        number   & number & number & number \\
        number  & number & number &  number \\
        \bottomrule
        \end{tabular}%
      \label{tab:addlabel}%
    \end{table}%
\end{document}

我不明白为什么表格标题没有出现...非常感谢!

答案1

诸如n_{\ce{NH3}}需要数学模式($...$)。另外,我建议您使用siunitx工具来排版带单位的数字。

梅威瑟:

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[version=3]{mhchem}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{float}
\usepackage[bottom]{footmisc}
\usepackage{siunitx}

\begin{document}
\begin{table}[htbp]
  \centering
  \caption{Comparison between \ce{H2O} activity coefficients for the following starting conditions: $n_{\ce{NH3}}=\SI{3}{\mole}$, $n_{\ce{H2O}}=\SI{34.4}{\mole}$; $T=\SI{57}{\celsius}$}
    \begin{tabular}{cccc}
    \toprule
    Something & Something & Something & Something \\
    \midrule
    number & number & number & number \\
    number  & number & number & number \\
    number   & number & number & number \\
    number  & number & number &  number \\
    \bottomrule
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
\end{document} 

输出:

在此处输入图片描述

相关内容