From bf850db142ebb083c08a96fe5cf214cc2c1d5ec7 Mon Sep 17 00:00:00 2001 From: Jeffrey Alan Scudder Date: Fri, 27 Mar 2026 08:55:00 -0700 Subject: [PATCH] fix: cards template auto-scales tabularx tables to fit page width Added BeforeBeginEnvironment/AfterEndEnvironment hooks (etoolbox) to wrap tabularx in adjustbox{max width=\linewidth} and set footnotesize. This catches table overflow at the template level instead of requiring per-paper fixes. Reverted UCLA arts paper tables back to standard tabularx. Co-Authored-By: Claude Opus 4.6 (1M context) --- papers/ac-paper-cards.sty | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/papers/ac-paper-cards.sty b/papers/ac-paper-cards.sty index 02fc64d114..8e91b1bceb 100644 --- a/papers/ac-paper-cards.sty +++ b/papers/ac-paper-cards.sty @@ -228,9 +228,23 @@ \oriendtabular% \end{adjustbox}% } -% Note: tabularx is NOT wrapped in adjustbox because tabularx does -% internal trial typesetting that breaks inside adjustbox. -% tabularx already constrains to its specified width argument. +% tabularx can't be wrapped directly in adjustbox (breaks trial typesetting). +% Instead, wrap the table float so any overflow is caught after typesetting. +\let\origtablefloat\table +\let\origendtablefloat\endtable +\renewenvironment{table}[1][h]{% + \origtablefloat[#1]% +}{% + \origendtablefloat% +} +\RequirePackage{etoolbox} +\AfterEndEnvironment{tabularx}{% + \end{adjustbox}% +} +\BeforeBeginEnvironment{tabularx}{% + \footnotesize% + \begin{adjustbox}{max width=\linewidth,center}% +} % === HYPERREF === \RequirePackage{hyperref} -- 2.51.2