在表格中引用对齐的 siunitx 条目

在表格中引用对齐的 siunitx 条目

在以下 MWE 中,当使用诸如这样的规范对齐条目时,如何引用siunitx表格中的条目S[table-format=-2.3,table-number-alignment=right]

\documentclass[oneside,11pt]{book}

\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[
  expansion = false ,
  tracking = smallcaps ,
  letterspace = 40 ,
]{microtype}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[style=chem-acs,articletitle=true,chaptertitle=true,refsection=chapter,maxbibnames=99,maxcitenames=99,doi=true]{biblatex}

\begin{filecontents*}[overwrite]{general.bib}
@ARTICLE{SaenzMendez2017,
  author = {Saenz-M{\'e}ndez, Patricia and Katz, Aline and P{\'e}rez-Kempner, Mar{\'\i}a Luc{\'\i}a and Ventura, Oscar N and V{\'a}zquez, Marta},
  title = {Structural insights into human microsomal epoxide hydrolase by combined homology modeling, molecular dynamics simulations, and molecular docking calculations},
  journal = {Proteins},
  year = {2017},
  volume = {85},
  pages = {720--730}
}
\end{filecontents*}

\addbibresource{general.bib}

\begin{document}

Here is a citation.\autocite{SaenzMendez2017}

\begin{table}[!h]
  \centering
  \begin{tabular}{
l
S[table-format=-2.3,table-number-alignment=right]
S[table-format=2.4,table-number-alignment=right]
}
    \toprule
    & {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})}\\
    \midrule
    A & 14(1) & 38(1)\\
    B & -85(2) & 104(4)\\
    \addlinespace
    C & -1.71(7) & 32.2(6)\\
    D & -2.93(4) & 50.09(90)\\
    \bottomrule
  \end{tabular}
  \caption{Table 1 caption.}
\end{table}

\begin{table}[!h]
  \centering
  \begin{tabular}{
l
S[table-format=-2.3,table-number-alignment=right]
S[table-format=2.4,table-number-alignment=right]
}
    \toprule
    & {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})}\\
    \midrule
    A & 14(1) & 38(1)\\
    B & -85(2)\autocite{SaenzMendez2017} & 104(4)\\
    \addlinespace
    C & -1.71(7) & 32.2(6)\\
    D & -2.93(4)\autocite{SaenzMendez2017} & 50.09(90)\\
    \bottomrule
  \end{tabular}
  \caption{Table 2 caption.}
\end{table}

\printbibliography

\end{document}

姆韦

答案1

在下面的 MWE 中,我根据原始代码做了以下更改:

  • 我纠正了错误的table-format选项。对于第一列,您应该使用-2.2(1)来解释不确定性,对于第二列,使用3.2(1)来解释不确定性,并使用第二行中的三位数。(另请参阅我对你上一个问题的回答
  • 要为上标数字添加一些空间(否则您会留下一堆过满的框警告),您可以使用table-space-text-post={\textsuperscript{1}}
  • 只需进行这两项更改/添加,上标数字现在将相互对齐,如第一个表格所示。如果您希望数字显示在各自条目的旁边,您可以table-align-text-post=false像我在第二个表格中所做的那样添加。

在此处输入图片描述

\documentclass[oneside,11pt]{book}

\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[
  expansion = false ,
  tracking = smallcaps ,
  letterspace = 40 ,
]{microtype}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage[style=chem-acs,articletitle=true,chaptertitle=true,refsection=chapter,maxbibnames=99,maxcitenames=99,doi=true]{biblatex}

\begin{filecontents*}[overwrite]{general.bib}
@ARTICLE{SaenzMendez2017,
  author = {Saenz-M{\'e}ndez, Patricia and Katz, Aline and P{\'e}rez-Kempner, Mar{\'\i}a Luc{\'\i}a and Ventura, Oscar N and V{\'a}zquez, Marta},
  title = {Structural insights into human microsomal epoxide hydrolase by combined homology modeling, molecular dynamics simulations, and molecular docking calculations},
  journal = {Proteins},
  year = {2017},
  volume = {85},
  pages = {720--730}
}
\end{filecontents*}

\addbibresource{general.bib}

\begin{document}

Here is a citation.\autocite{SaenzMendez2017}

\begin{table}[!h]
  \centering
  \begin{tabular}{
l
S[table-format=-2.2(1),table-number-alignment=right, table-space-text-post={\textsuperscript{1}}]
S[table-format=3.2(2),table-number-alignment=right]
}
    \toprule
    & {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})}\\
    \midrule
    A & 14(1) & 38(1)\\
    B & -85(2)\autocite{SaenzMendez2017} & 104(4)\\
    \addlinespace
    C & -1.71(7) & 32.2(6)\\
    D & -2.93(4)\autocite{SaenzMendez2017} & 50.09(90)\\
    \bottomrule
  \end{tabular}
  \caption{Table 2 caption.}
\end{table}


\begin{table}[!h]
  \centering
  \begin{tabular}{
l
S[table-format=-2.2(1),table-number-alignment=right,table-space-text-post={\textsuperscript{1}}, table-align-text-post=false]
S[table-format=3.2(2),table-number-alignment=right]
}
    \toprule
    & {$T_m$ (\si{\celsius})} & {$\eta$ (\si{\milli\pascal})}\\
    \midrule
    A & 14(1) & 38(1)\\
    B & -85(2)\autocite{SaenzMendez2017} & 104(4)\\
    \addlinespace
    C & -1.71(7) & 32.2(6)\\
    D & -2.93(4)\autocite{SaenzMendez2017} & 50.09(90)\\
    \bottomrule
  \end{tabular}
  \caption{Table 2 caption.}
\end{table}

\printbibliography

\end{document}

相关内容