![¿Por qué sobresale descaradamente la nota de la mesa de mi mesa de tres partes? ¿Cómo se puede ajustar (automáticamente) el ancho aquí?](https://rvso.com/image/266436/%C2%BFPor%20qu%C3%A9%20sobresale%20descaradamente%20la%20nota%20de%20la%20mesa%20de%20mi%20mesa%20de%20tres%20partes%3F%20%C2%BFC%C3%B3mo%20se%20puede%20ajustar%20(autom%C3%A1ticamente)%20el%20ancho%20aqu%C3%AD%3F.png)
¿Por qué sobresale descaradamente la nota de la mesa de mi mesa de tres partes? ¿Cómo se puede ajustar (automáticamente) el ancho aquí?
\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}
Respuesta1
\tnote
escribe su argumento en un cuadro de ancho cero, por lo que no influirá en la composición tipográfica de los datos. Estepodríano ser deseado en encabezados o descripciones; puede agregar un comando que imite el trabajo de \tnote
pero use todo el ancho.
\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}
Tenga en cuenta que para hacer algo sensato tabulary
debe agregar al menos una "columna de ancho indeterminado", especificada con un carácter de LCRJ
cada una que denota la alineación deseada en las celdas de la columna: alineación izquierda (derecha irregular), centrado, alineación derecha ( izquierda harapienta), justificado.
Una definición ligeramente diferente que permite usar \stnote
en el título sin que aparezca en la lista de tablas: cambiar la definición de \stnote
con
\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