![為什麼我的三部分桌子的音符厚顏無恥地突出?這裡如何(自動)調整寬度?](https://rvso.com/image/266436/%E7%82%BA%E4%BB%80%E9%BA%BC%E6%88%91%E7%9A%84%E4%B8%89%E9%83%A8%E5%88%86%E6%A1%8C%E5%AD%90%E7%9A%84%E9%9F%B3%E7%AC%A6%E5%8E%9A%E9%A1%8F%E7%84%A1%E6%81%A5%E5%9C%B0%E7%AA%81%E5%87%BA%EF%BC%9F%E9%80%99%E8%A3%A1%E5%A6%82%E4%BD%95%EF%BC%88%E8%87%AA%E5%8B%95%EF%BC%89%E8%AA%BF%E6%95%B4%E5%AF%AC%E5%BA%A6%EF%BC%9F.png)
為什麼我的三部分桌子的音符厚顏無恥地突出?這裡如何(自動)調整寬度?
\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
在標題中使用而不出現在表格列表中:更改\stnote
with的定義
\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