# Single spacing within tables in a custom Class

What is the simplest way to get single spacing in tables (both content and captions) and in figure caption, when the class is not using setspace? The class can be obtained here. When I use it as is with figure or tables, all table content and captions are double spaced. I tried loading setspace and using the tricks here and here but in those cases, I get multitude of other errors.

I looked at setspace code but I don't really understand it that much. Is there any reasonable way to correct for this with this class or I should rather use report and try to change it according to the requirements (which i don't even know if I can do) because setspace and report work together. Also note, most of the tables that i use are threeparttables from threepartablex package, since I am using longtable inside.

Your document class, ucfthes.cls, modifies the low-level parameter \baselinestretch directly. (The setspace package is much more subtle in its ways.)

I suggest you issue the following directives in the preamble:

\usepackage{etoolbox}
\AtBeginEnvironment{table}{\renewcommand{\baselinestretch}{1}}
\AtEndEnvironment{table}{\renewcommand{\baselinestretch}{2}}
\AtBeginEnvironment{figure}{\renewcommand{\baselinestretch}{1}}
\AtEndEnvironment{figure}{\renewcommand{\baselinestretch}{2}}


This will automate switching back and forth between values of \baselinestretch.

• Is the way the class does double spacing a good (or proper) one or is that an ugly way? Also, if I need a table to have a little spacing between rows, will \def\arraystretch{1.1} before tabular still work in the case of this class and your solution? – leosenko Mar 4 '20 at 16:31
• @leosenko - The method employed by the class -- direct manipulation of the low-level parameter \baselinestretch -- is indeed not felicitous. An immediate consequence of their poor choice is that double-spacing is applied everywhere, including in footnotes, tables, and figures. (The class code actually contains quite a few instructions to undo the effect for footnotes.) The setspace package uses a different method; an immediate benefit is that it does not affect footnotes, tables, and figures. Increasing the value of \arraystretch is a separate matter from \baselinestretch. – Mico Mar 4 '20 at 16:41