使用 threeparttable 和 chemstyle 实现左对齐表格标题

使用 threeparttable 和 chemstyle 实现左对齐表格标题

第一次在这里发帖,请多多包涵。我有一个问题,我已经花了无数个小时来解决它。我是 Latex 新手,所以这花了我比预期更长的时间。

我想将表格左侧的标题对齐,但表格要居中。这应该很容易用 threeparttable 完成。但是它不起作用。在为你们创建 MWE 时,我发现它工作正常,直到我加载 chemstyle 包。如果我将其注释掉,它就可以正常工作。可能是因为这反过来会加载 float 包?有人能告诉我如何轻松解决这个问题吗?非常感谢!

\documentclass[version, 12pt, USenglish, a4paper, parskip=full]{scrbook}

\usepackage[varioref=false]{chemstyle} %also loads chemscheme, psfrags, xspace, amstext, caption, float, kvoptions, siunitx or SIunits 

% TABLES: 
\usepackage{booktabs}   
\usepackage{multirow}   
\usepackage{makecell}   
\usepackage{caption} 
\captionsetup[table]{singlelinecheck=false, justification=justified}
\usepackage[flushleft]{threeparttable}

\begin{document}

\begin{table}[h]
    \centering
    \label{tab:binding-energies}
    \begin{threeparttable}
        \caption{Exemplary table text: Very very long caption, so very very very long. Oh long John. Long looooooong maaaaaaaaaan.}
        \begin{tabular}{@{}l|l@{}}
            \toprule
            Column one              & Column two\tnote{1}         \\ \midrule
            bbbbb bbbb              & 200--300   bli bla          \\
            cccccccccccc ccccccc    & 50--200 yadda yadda yadda   \\ \bottomrule
        \end{tabular}
        \begin{tablenotes}
            \item[1] Lorem ipsum dolor sit amet who am I kidding I dont know how to continue this fake text and I am too lazy to copy it from the web.
        \end{tablenotes}
    \end{threeparttable}
\end{table}

\end{document}

答案1

由于您使用了chemstylebundle 来访问scheme可用于反应方案的浮点,因此我建议改用chemmacros及其模块。如果已加载,scheme则 a 中的标题threeparttable仍然与表格一样宽:chemmacros

在此处输入图片描述

\documentclass[version, 12pt, USenglish, a4paper, parskip=full]{scrbook}

\usepackage{chemmacros}
\usechemmodule{scheme}

% TABLES: 
\usepackage{booktabs}   
\usepackage{multirow}   
\usepackage{makecell}   
\usepackage{caption} 
\captionsetup[table]{singlelinecheck=false, justification=justified}
\usepackage[flushleft]{threeparttable}

\begin{document}

\begin{table}[h]
    \centering
    \label{tab:binding-energies}
    \begin{threeparttable}
        \caption{Exemplary table text: Very very long caption, so very very very long. Oh long John. Long looooooong maaaaaaaaaan.}
        \begin{tabular}{@{}l|l@{}}
            \toprule
            Column one              & Column two\tnote{1}         \\ \midrule
            bbbbb bbbb              & 200--300   bli bla          \\
            cccccccccccc ccccccc    & 50--200 yadda yadda yadda   \\ \bottomrule
        \end{tabular}
        \begin{tablenotes}
            \item[1] Lorem ipsum dolor sit amet who am I kidding I dont know how to continue this fake text and I am too lazy to copy it from the web.
        \end{tablenotes}
    \end{threeparttable}
\end{table}


\begin{scheme}
\caption{reaction scheme}
\end{scheme}
\end{document}

相关内容