0

I have several tables in my article. Unfortunately, the text size in the tables differ quite substantially. I would like to have all the tables with exactly the same text size but also with the same column with. How can I do this? enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{makecell, booktabs}
\usepackage{float}
\usepackage{amsfonts}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{adjustbox}

\begin{document}

\begin{table}[h!] \centering
\resizebox{8cm}{!}{
\begin{tabular}{|l{5cm}|c{3cm}|}
\hline
variable (in log) & ablablablablablablabablablablablablablab\\
\hline
blablablablablablablabla & 0.03\\
ablablab & 0.29\\
blablablablablablablablablablablabla & -0.47\\
\hline
\end{tabular}}
\end{table}

\begin{table}[h!] \centering
\resizebox{8cm}{!}{
\begin{tabular}{|l{5cm}|c{3cm}|}
\hline
variable (in log) & ablablab\\
\hline
ablablab & 0.03\\
ablablab & 0.29\\
ablablab & -0.47\\
\hline
\end{tabular}}
\end{table}

\end{document}
1
  • latex would never do that, you are forcing inconsistent font sizes by using \resizebox Commented May 27, 2022 at 10:24

1 Answer 1

2
  • don't use \resizebox!
  • prescribe the same column width in all tables and by this allow that cells contents can be broken into many lines.

For example, by use of the tabularray package with libraries booktabs and siunitx (which loads packages of the same name), your tables are:

\documentclass{article}
\usepackage{float}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}

\begin{document}

\begin{table}[ht] 
\centering
\begin{tblr}{vlines,
             colspec={Q[l,wd=5cm] Q[c,wd=3cm, si={table-format=-1.2}]}
             }
    \toprule
variable (in log)   & {{{abla blablabl ablabl ab ablabla blablab lablab}}}  \\
    \midrule
bla bla bla blabla blabl abla 
                    & 0.03      \\
ablablab            & 0.29      \\
blabla blabla blablabla bla blablablabla 
                    & -0.47     \\
    \bottomrule
\end{tblr}
\end{table}

\begin{table}[ht] 
\centering
\begin{tblr}{vlines,
             colspec={Q[l,wd=5cm] Q[c,wd=3cm, si={table-format=-1.2}]}
             }
    \toprule
variable (in log)   & {{{ablablab}}} \\
    \midrule
ablablab            & 0.03\\
ablablab            & 0.29\\
ablablab            & -0.47\\
    \bottomrule
\end{tblr}
\end{table}

\end{document}

enter image description here

You must log in to answer this question.

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