0

I am trying to make multiple tables for my glossary, hence the tables need to be the width of the margins while maintaining the same font size (11 pt). I tried to do this with \resizebox{\textwidth}{!} which gives me the right width for my tables, but also rescales the size of the font used in my tables depending on the length of the text used in the column. This change in font size causes a difference between the size in my tables, as they do not both hold the exact same amount of text for each column. See code below.

\begin{document}
The following tables defines the various abbreviations and symbols used throughout the thesis. The page where the acronym is first used or defined is given in the last column.

%Start of table 1
\begin{table}[H]
\centering

\begin{center}
    \textbf{\large Table of Abbreviations}
\end{center}

\label{tab:list-of-acronyms}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lll}
\hline
\textbf{Abbreviaton} & \textbf{Meaning}                                            & \textbf{Page} \\ \hline
PIC         & Ethylene Glycol-functionalized Polyisocyanopeptide & 69   \\
PNIPAM      & Poly(\textit{N}-isopropylacrylamide)               & 33   \\
            &                                                    &     
\end{tabular}%
}
\end{table}

%Start of table 2
\begin{table}[]
\centering

\begin{center}
    \textbf{\large Table of Symbols}
\end{center}
\label{tab:list-of-symbols}
\resizebox{\textwidth}{!}{%
\begin{tabular}{lll}
\hline
\textbf{Symbol} & \textbf{Meaning}                                            & \textbf{Page} \\ \hline
4_1         & Four-over-one helix                                & ??   \\
\gamma      &                                                    &      \\
DP          & Degrees of Polymerization                          & ??   \\
\Delta G    &                                                    &      \\
\Delta H    &                                                    &      \\
\Delta S    &                                                    &      \\
E           &                                                    &      \\
G           &                                                    &      \\
G'          &                                                    &      \\
G''         &                                                    &      \\
G*          &                                                    &      \\
G_0         &                                                    &      \\
K'          &                                                    &      \\
K_a         &                                                    &      \\
K_n         &                                                    &      \\
K_p         &                                                    &      \\
\textit{m}  &                                                    &      \\
\sigma      &                                                    &      \\
\sigma_0    &                                                    &      \\
\sigma_c    &                                                    &      \\
T*          &                                                    &      \\
\tau        &                                                    &      \\                     &                                                    &      \\

            
\end{tabular}%
}
\end{table}
\end{document}

And the compiled result as shown below: Screenshot of the compiled code above

As you can see, the font size in both tables are not the same. Does someone have an alternative for me that might work? It should be noted that I am working in a multi-file project and I just copied the file with code for my tables. I do refer to the graphicx package in the preamble of my main document & use documentclass 'report'. Furthermore, I am using a format I found online for my text with a fair amount of code I do not understand, so maybe something there might cause this.

Thanks in advance!

6
  • 2
    Do not ever use \resizebox to fit a table.
    – campa
    Commented Mar 3, 2021 at 11:40
  • Please, provide a minimal working example. tex.meta.stackexchange.com/q/228/231952
    – Ivan
    Commented Mar 3, 2021 at 12:25
  • As it currently is, your code is unfortunately not compilable. If I add the documentclass you mention, as well as all the relevant packages, I end up with error messages such as "! Missing $ inserted.". This is due to the contents of the first column of the second table, such as \Delta or 4_1. ...
    – leandriis
    Commented Mar 3, 2021 at 12:32
  • ... Either use $\Delta$ and $4_1$ instead or make sure, the whole column is automatically typeset in math mode, for example by using the following code, that at the same time also makes sure, the table fits into the textwidth while keeping a consistent font size: \begin{tabularx}{\textwidth}{>{\(}l<{\)}Xl}(Needs the tabularx package.)
    – leandriis
    Commented Mar 3, 2021 at 12:32
  • 1
    using \resizebox on tables is an explicit request to destroy any attempt at consistent font sizes. There are essentially no cases when it can make a reasonable output. Commented Mar 3, 2021 at 12:32

2 Answers 2

1

This shows how to use tabularx to wrap long text entries to fit the page.

\documentclass{article}
\usepackage{tabularx}
\usepackage{caption}% for \caption*

\begin{document}
The following tables defines the various abbreviations and symbols used throughout the thesis. The page where the acronym is first used or defined is given in the last column.

\begin{table}[ht]
\caption*{\textbf{\large Table of Abbreviations}}
%\label{tab:list-of-acronyms}% no number to \ref
\centering% not needed
\begin{tabularx}{\textwidth}{lXl}
\hline
\textbf{Abbreviaton} & \textbf{Meaning}                                            & \textbf{Page} \\ \hline
PIC         & Ethylene Glycol-functionalized Polyisocyanopeptide & 69   \\
PNIPAM      & Poly(\textit{N}-isopropylacrylamide)               & 33   \\
            &                                                    &     
\end{tabularx}
\end{table}
\end{document}
0

You can use "p{width}" instead of "l" when declaring the table. This column-type is fixed width and will have line-breaks if the text is longer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .