[Tex/LaTex] Resize a table proportional to regular size (not textwidth)

resizetables

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

\resizebox{0.85\width}{<contents>}

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.

\documentclass{article}
\usepackage{graphicx}
\usepackage{siunitx,booktabs,caption}

\sisetup{inter-unit-product=\ensuremath{\cdot}}

\begin{document}

\begin{table}[htbp]
\centering\footnotesize
\caption{Table caption}

\begin{tabular}{
  S[table-format=-3.3]
  S[table-format=5.0]
  S[table-format=-3.3]
  S[table-format=1.5]
}
\toprule
{$t_0$ (\si{\mega\eV\femto\meter\cubed})} & 
{$t_3$ (\si{\mega\eV\femto\meter\tothe{6}})} &
{$v_0/\mu$ (\si{\mega\eV\femto\meter})} &
{$1/\mu$ (\si{\femto\meter})} \\
\midrule
-497.726 & 17270 & -166.924 & 0.45979\\
-497.726 & 17270 & -166.924 & 0.45979\\
-497.726 & 17270 & -166.924 & 0.45979\\
\bottomrule
\end{tabular}

\end{table}

\end{document}

enter image description here

I used siunitx, rather than math mode (which is wrong), for the units and also for correctly formatting data.