I have a couple tables in my paper. I would like them both to be scaled down a bit, to approx. 85% of regular size.
There are many posts on how to do this using \resizebox
, but they all use \textwidth
as the basis, something like:
\begin{table}[htbp]
\centering
\resizebox{0.85\textwidth}{!}{
\caption{Table caption}
\begin{tabular}{|c|c|c|c|}
\hline
$t_0~(MeV\cdot fm^3 ) $ & $t_3~(MeV\cdot fm^6)$ & $v_0/\mu~(MeV\cdot fm)$ & $1/\mu~(fm)$\\
\hline
$$ -497.726 & $17270$ & $-166.924$ & $0.45979$\\
\hline
\end{tabular}
}
\end{table}
But with this code, it scales the table to be 85% of the text width. This is great, except that I have multiple tables of different widths and I need them all to have the same font size so it doesn't look ridiculous. If I used the above code for each table, all the tables would become the same width, meaning that tables that are naturally wide would have a small font size, and tables that are naturally narrow would have a huge font size.
Is there any way to use \resizebox
with a size relative to the table's natural size, instead of the \textwidth
?
Best Answer
You could use
because in this context
\width
refers to the width of<contents>
.Anyway this shouldn't contain the caption, because captions should have the same size across the document. Moreover, you have no real control on the outcome.
It's better using a font size command. Possibly act on
\tabcolsep
, there are several examples on the site.I used
siunitx
, rather than math mode (which is wrong), for the units and also for correctly formatting data.