為什麼我的三部分桌子的音符厚顏無恥地突出?這裡如何(自動)調整寬度?

為什麼我的三部分桌子的音符厚顏無恥地突出?這裡如何(自動)調整寬度?

為什麼我的三部分桌子的音符厚顏無恥地突出?這裡如何(自動)調整寬度?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabulary}
\usepackage{threeparttable}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{lipsum}
\renewcommand{\arraystretch}{1.2}
\sisetup{round-mode=places,round-precision=1, add-decimal-zero=true, add-integer-zero=true, round-integer-to-decimal}

\begin{document}



\lipsum[1]



\begin{table}
\centering
\begin{threeparttable}
\caption{Some long boring caption don't fall asleep 2013}

\begin{tabulary}{\textwidth}{@{}*{1}{l}*{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\tnote{1a}} & {excl.\ Ingredients A\tnote{1b}} \\
\midrule
DDDDDDDDDDD & 36.1 & 22.0\\
GGGGGGGGGGGG & 30.9 & 20.0\\
GGGG\tnote{2} & 33.0 & 22.8\\
OOOO\tnote{2} & 33.766 & 24.643
\\ \bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{table}



\lipsum[2]



\end{document}

答案1

\tnote將其參數排版在零寬度框中,因此不會影響資料的排版。這可能不需要出現在標題或描述中;您可以新增一個模仿 的工作\tnote但使用全寬度的指令。

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tabulary}
\usepackage{threeparttable}
\usepackage{array}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{lipsum}
\renewcommand{\arraystretch}{1.2}
\sisetup{round-mode=places,
 round-precision=1,
 add-decimal-zero=true,
 add-integer-zero=true,
 round-integer-to-decimal}

% This is like `\tnote`, but uses the space of the argument    
\newcommand\stnote[1]{\textsuperscript{\TPTtagStyle{#1}}}

\begin{document}

\lipsum[1]

\begin{table}[ht]
\centering
\begin{threeparttable}
\caption{Some long boring caption don't fall asleep 2013}

\begin{tabulary}{\textwidth}{@{} L *{2}{S[table-format=3.2]}@{}}
\toprule
& {incl.\ Ingredients A\stnote{1a}} & {excl.\ Ingredients A\stnote{1b}} \\
\midrule
DDDDDDDDDDD   & 36.1   & 22.0   \\
GGGGGGGGGGGG  & 30.9   & 20.0   \\
GGGG\tnote{2} & 33.0   & 22.8   \\
OOOO\tnote{2} & 33.766 & 24.643 \\
\bottomrule
\end{tabulary}

\begin{tablenotes}
\item [2] Unweighted Average
\item [] Source: radiowaves from outer space 1999
\end{tablenotes}

\end{threeparttable}
\end{table}

\lipsum[2]

\end{document}

在此輸入影像描述

請注意,為了做一些明智的事情,tabulary您必須至少添加一個“未確定寬度的列”,指定LCRJ每個列中的一個字符,表示列單元格中所需的對齊方式:左對齊(右對齊)、居中、右對齊(衣衫襤褸),合理。


稍微不同的定義,允許\stnote在標題中使用而不出現在表格列表中:更改\stnotewith的定義

\usepackage{etoolbox}
\makeatletter
\apptocmd{\TPT@begintabbox}{\let\mTPTprint\@firstofone}{}{}
\apptocmd{\threeparttable}{\let\mTPTprint\relax}{}{}
\newcommand\stnote[1]{\protect\mTPTprint{\textsuperscript{\TPTtagStyle{#1}}}}
\newcommand\mTPTprint[1]{}
\makeatother

相關內容