dan-weiss / apa7-latex-cls-source

Source code for apa7 class
LaTeX Project Public License v1.3c
49 stars 13 forks source link

line spacing inside tables #36

Open johannes-titz opened 2 years ago

johannes-titz commented 2 years ago

Could you add an option for line spacing inside tables? For long tables, double spacing often leads to the table not fitting on one page.

As far as I understand, inside tables the spacing does not have to be double: https://apastyle.apa.org/style-grammar-guidelines/paper-format/line-spacing

Or is there a quick workaround?

jpcirrus commented 2 months ago

Until an option is added, the following preamble code works to make all tables single spaced, whilst preserving the document spacing of captions and table notes:

% single line spacing of all table "floats"
\usepackage{setspace}
% Revert single line spacing of floats (setspace)
\makeatletter
\let\@xfloat=\latex@xfloat
\makeatother
\AddToHook{begindocument/end}{\NewCommandCopy{\bls}{\baselinestretch}}
\AddToHook{env/table/begin}{\singlespacing}
\AddToHook{env/longtable/begin}{\singlespacing}
\AddToHook{env/sidewaystable/begin}{\singlespacing}
\AddToHook{env/threeparttable/begin}{\singlespacing}
\captionsetup{font={stretch=\bls}}
\AddToHook{env/tablenotes/begin}{\setstretch{\bls}}