[Tex/LaTex] Font size of table much bigger than rest of text

resizetables

I have created a table (two rows, four columns) in a seperate .tex file. The table is smaller than the text width, so I stretch it to the text width. Unfortunately, the font size is much bigger than the font size of the rest of my text. This also appears when I don't stretch the table.

How can I get the same font size of my table as with the rest of my text or is this not usual?

Here is my table (table.tex):

\renewcommand{\arraystretch}{1.5}
\begin{tabular}{cccc}\toprule
~ & \textbf{Col1} & \textbf{Col2} & \textbf{Col3} \\ \midrule
$\beta = 1$ & 1234 (0.01234) & 4.524 (0.2345) & -0.54 (0.0423) \\ \midrule
$\beta = 2$ & 0.0345 (0.023) & 0.0012(0.0125) & -0.0161 (0.0174) \\
\bottomrule 
\end{tabular} 

And I include the table in the following way:

\begin{table}[!htbp]
\caption[Caption]{This is my caption.}
\centering
\resizebox{\textwidth}{!}{\input{table}}
\end{table}

Best Answer

The following example will fix the problem:

\documentclass{article}

\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{lipsum}
\newcolumntype{C}{>{\small\centering\arraybackslash}X}


\begin{document}
\parindent=0pt
\renewcommand{\arraystretch}{1.5}
\lipsum[1-2]

\begin{table}[!htbp]
\caption[Caption]{This is my caption.}
\begin{tabularx}{\textwidth}{CCCC}\toprule
~ & \textbf{Col1} & \textbf{Col2} & \textbf{Col3} \\ \midrule
$\beta = 1$ & 1234 (0.01234) & 4.524 (0.2345) & -0.54 (0.0423) \\ \midrule
$\beta = 2$ & 0.0345 (0.023) & 0.0012(0.0125) & -0.0161 (0.0174) \\
\bottomrule 
\end{tabularx}
\end{table} 
\end{document}

The \resizebox will resize and will make the fonts bigger. Hence, use tabularx package with C column specifier. The C column specifier is defined using \newcolumntype command, which sets the content in center.

Related Question