
Я хочу изменить размер шрифта на tnotes
основеthreeparttables
этот подход пользователя egreg.
Минимальный рабочий пример (МРП) функционального подхода:
\documentclass{article}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{etoolbox}
\appto\TPTnoteSettings{\footnotesize}% <-- decreases font size of tnote
\begin{document}
\begin{table}
\begin{threeparttable}[b]
\caption{A caption}
\begin{tabular}{llll}
\toprule
Test\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [1] the first tnote
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
Это решение работает совершенно нормально, пока я НЕ добавляю flushleft
в преамбулу конфигурацию threeparttable
. Как только я добавляю эту дополнительную конфигурацию, верхнее решение больше не работает.
Минимальный рабочий пример (МРП) нефункционального подхода:
\documentclass{article}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}% <-- added `para` and `flushleft`
\usepackage{etoolbox}
\appto\TPTnoteSettings{\footnotesize}% <-- decreases font size of tnote
\begin{document}
\begin{table}
\begin{threeparttable}[b]
\caption{A caption}
\begin{tabular}{llll}
\toprule
Test\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [1] the first tnote
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
Есть идеи, как решить эту проблему?
решение1
Вы можете добавить \footnotesize
в другой макрос:
\documentclass{article}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\usepackage{etoolbox}
\appto\TPTdoTablenotes{\footnotesize}
\begin{document}
\begin{table}
\begin{threeparttable}[b]
\caption{A caption}
\begin{tabular}{llll}
\toprule
Test\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [1] the first tnote long enough to see at least a line break
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
решение2
Ваша цель форматирования может быть надежно достигнута путем запуска
\usepackage{etoolbox}
\AtBeginEnvironment{tablenotes}{\footnotesize}
в преамбуле.
Полная версия MWE — обратите внимание, что она запускается как \smallskip
и \footnotesize
в начале каждой tablenotes
среды:
\documentclass{article}
\usepackage{booktabs}
\usepackage[flushleft,para]{threeparttable}
\usepackage{etoolbox}
\AtBeginEnvironment{tablenotes}{\smallskip\footnotesize}
\begin{document}
\begin{table}
\centering
\begin{threeparttable}
\caption{A caption}
\begin{tabular}{llll}
\toprule
Test\tnote{1} & some & text & to have room\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item[1] The first tnote
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}