0

I have a very long tables in rows and another in columns, i use adjustbox package to resize these tables.

However, the other tables which are perfect fine get effect, some of them became in big font which different that in the thesis. I need help, as I can not find why the table font size get bigger.

This is what I write for long table:

\begin{table}[h]
\caption{}
\label{}
\vspace{0.3cm}\centering\begin{adjustbox}{width=\textwidth}
\begin{tabular}

\end{tabular} \end{adjustbox}

And this for the regular table:

\begin{table}[h]
\caption{}
\label{}
\vspace{0.3cm}\centering
\begin{tabular}

\end{tabular} \end{table} \end{table}

Martin Scharrer
  • 262,582
  • One should only scale a table as a last resort, not the default. That being said, you can check the size of a tabular using a savebox, so as to never increase the font size. – John Kormylo Aug 26 '20 at 01:32
  • i did not understand, – user223206 Aug 26 '20 at 02:30
  • See also https://www.ctan.org/topic/table – Fran Aug 26 '20 at 03:25
  • {width=\textwidth} scales smaller tables to the text width, which is probably not what you want. Use {max width=\textwidth} instead to only scale down if the width is larger than the text width. Also instead of \centering you might want to try to add the center key after the max width key. – Martin Scharrer Oct 01 '20 at 06:37

1 Answers1

1

To illustrate my comment:

\documentclass{article}
\usepackage{adjustbox}

\begin{document}

\begin{table}[h] \caption{test caption} \vspace{0.3cm} \sbox0{\begin{tabular}{c} a very small tabular \end{tabular}}% \ifdim\wd0>\textwidth \adjustbox{width=\textwidth}{\usebox0} \else \centering \usebox0 \fi \end{table}

\end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120