3

I am trying to make the font size for all tables the same. I have different tables with different headers and number of columns and rows, which causes the font size to vary from case to case. I tried different approaches, I found on the internet, but no success yet.

Here is an example:

\documentclass[12pt,twoside]{ociamthesis}

\usepackage{float}
\usepackage{geometry}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection~- ~#1}}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername~\thechapter~-~ #1}{}}
\fancypagestyle{main}{
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LO]{\nouppercase{\rightmark}}
}


\pagestyle{main}

\begin{document}

\begin{table}[htbp]
\centering
\begin{tabular}{|l|l|l|l|}
\hline
Layer     & T(°C) & $\mathrm{B(S^{-1}MPa^{-1})}$ & n    \\ \hline
TBC      & 1000  & 1.8e-7              & 1    \\ \hline
TGO       & 1000  & 7.3e-4              & 1    \\ \hline
BC        & 600   & 6.54e-19            & 4.57 \\ \hline
          & 700   & 2.2e-12             & 2.99 \\ \hline
          & 800   & 1.84e-7             & 1.55 \\ \hline
          & 850   & 2.15e-8             & 2.45 \\ \hline
Substrate & 10    & 4.85e-36            & 1    \\ \hline
          & 1200  & 2.25e-9             & 3    \\ \hline
\end{tabular}
\caption{Creep properties of TBC system}
\label{tab:matcreep}
\end{table}

\begin{table}[htbp]
    \centering
    \renewcommand{\arraystretch}{1.25}
    \resizebox{0.75\linewidth}{!}{
    \begin{tabular}{|*{5}{c|}}  % repeats {c|} 18 times
    \hline
    \multirow{3}*{Specimen type} & \multicolumn{4}{c|}{Bond coat type} \\ \cline{2-5}
    & \multicolumn{2}{c|}{LCO22} & \multicolumn{2}{c|}{PWA 286} \\ \cline{2-5}
    & hole diameter (mm) & Angle & hole diameter (mm) & Angle\\ \hline
    \multirow{2}*{Flash lamp, percussion} & 0.5 & 90 & 0.5 & 90 \\ \cline{2-5}
    & 0.5 & 30 & 0.5 & 30 \\    
    \hline
    Fiber, trepanation & 0.5 & 30 & 0.5 & 30  \\
    \hline  
    Fiber, percussion & 0.5 & 30 & 0.5 & 30 \\ \hline
    \end{tabular}}
    \caption{Test matrix for cyclic oxidation tests.}
    \label{tab:cycoxidplan}
\end{table} 

\begin{table}[ht]
    \centering
    \renewcommand{\arraystretch}{3}
    \resizebox{1\linewidth}{!}{
\begin{tabular}{|*{8}{c|}}
\hline
Crack length &  Test coloumn1 & Test coloumn2 & Test coloumn3 & Test coloumn4 & Test coloumn5  & Test coloumn6 & Test coloumn7 \\ \hline
TBC          & 37 $\pm$ 31                  & 103 $\pm$ 94                 & 142 $\pm$ 70                 & 337 $\pm$ 436                 &94 $\pm$ 74  & 100 $\pm$ 107& 41 $\pm$ 33  \\ \hline
BC-Sub int.   & 71 $\pm$ 15                  & 138 $\pm$ 42                 & 156 $\pm$ 7                 & 400 $\pm$ 50                 &47 $\pm$ 22  &136 $\pm$ 35 & 20 $\pm$ 10  \\ \hline
Substrate    & 42 $\pm$ 9                  & 52 $\pm$ 5                  & 58 $\pm$ 22                  & 91                  & 78 $\pm$ 12 &50 $\pm$ 26& 0 \\ \hline
\end{tabular}}
\caption{Measurement of averaged crack length in TBC layer, at BC/substrate interface (shown as BC-Sub int.), and in substrate.}
\label{tab:fibertrepperccracklength}
\end{table}


\begin{table}[ht]
    \centering
    \renewcommand{\arraystretch}{3}
    \resizebox{1\linewidth}{!}{
\begin{tabular}{|*{8}{c|}}
\hline
Recast thickness & Test coloumn1 & Test coloumn2 & Test coloumn3 & Test coloumn4 & Test coloumn5  & Test coloumn6 & Test coloumn7 \\ \hline
TBC recast          & 19 $\pm$ 8                  & 83 $\pm$ 46                 & 56 $\pm$ 17                 & 77 $\pm$ 24                 & 35 $\pm$ 12  & 33 $\pm$ 12 & 33 $\pm$ 19  \\ \hline
BC-Sub recast   & 23 $\pm$ 8                  & 27 $\pm$ 10                 & 46 $\pm$ 20                 & 60 $\pm$ 21                 &29 $\pm$ 20  & 20 $\pm$ 13 & 0  \\ \hline
\end{tabular}}
\caption{Measured averaged thickness of TBC and BC/substrate recast layers}
\label{tab:fibertreppercrecastt}
\end{table}



\end{document}

and the output for the first two tables is:

enter image description here

2
  • 5
    never do \resizebox{0.75\linewidth}{!}{ for exactly the reason that you show. The inconsistent fonts are unrelated to tables. It is simply that you are scaling text by inconsistent amounts, Commented May 2, 2018 at 9:59
  • I don't understand your question, Vahid. Didn't you use \resizeboxto make broader tables fit on the page? Are you asking for a solution to make tables fit on the page without using \resizebox?
    – Keks Dose
    Commented May 2, 2018 at 11:12

1 Answer 1

6

1) If needed, do not scale the table, but simply reduce the font from \normalsize to standard smaller sizes: \small or \footnotesize but please do not go beyond that. Note that not only this produce consistent sizes, but also the appropriate glyphs in good fonts (for instance, a {\huge Q} will be quite different of a {\tiny Q} when scaled to the same size). BTW in tables 1 and 2 this is not needed, assuming default margins for an article (sorry, I do not have the ociamthesis class)

2) If that is not enough (tables 3 and 4) , or (may be better) alternatively try to gain horizontal space with a redesign of the table and/or adjust column widths and allow line breaks in cells. Use of p columns, m columns (array package) and tabularx and tabulary packages are very useful to adjust tables.

3) Finally not related with the problem, but avoid vertical lines and superfluous horizontal lines, use better horizontal lines (package booktabs) and try to align/format numeric with siunitx package. The MWE show also other minor tricks to have a better spacing in \pm with/without an explicit math environment (new column M). I move the captions before as most journal use this style, but obviously is optional. (The four tables are in the same float only for convenience of maintain the MWE in a single page.)

mwe

\documentclass[12pt]{article}
\usepackage{graphicx,multirow,booktabs,tabulary,tabularx,array,makecell,siunitx}
\newcolumntype{M}{>{$}X<{$}} 
\usepackage[tmargin=1cm,bmargin=1cm]{geometry}
\def\ch#1{\multicolumn{1}{X}{\centering #1}}
\pagestyle{empty}

\begin{document}

\begin{table}
\abovecaptionskip2em % some space between tables for the MWE only
\centering
\caption{Creep properties of TBC system}
\begin{tabular}{lrS[table-format=+1.2e+2]S}\toprule
Layer       & T(°C) & \hfil$\mathrm{B(S^{-1}MPa^{-1})}$ & n \\\midrule 
TBC         & 1000  & 1.8e-7    & 1 \\ 
TGO         & 1000  & 7.3e-4    & 1 \\ 
BC          & 600   & 6.54e-19  & 4.57 \\ 
            & 700   & 2.2e-12   & 2.99 \\ 
            & 800   & 1.84e-7   & 1.55 \\ 
            & 850   & 2.15e-8   & 2.45 \\ 
Substrate   & 10    & 4.85e-36  & 1 \\ 
            & 1200  & 2.25e-9   & 3 \\\bottomrule 
\end{tabular}

 \caption{Test matrix for cyclic oxidation tests.}
\begin{tabulary}{\linewidth}{LCcCc}\toprule
 \multirowcell{3}{Specimen\\type}   & \multicolumn{4}{c}{Bond coat type} \\ \cmidrule{2-5}
    & \multicolumn{2}{c}{LCO22} & \multicolumn{2}{c}{PWA 286} \\
    \cmidrule(rl){2-3}\cmidrule(rl){4-5}
    & hole diameter (mm)    & Angle & hole diameter (mm)    & Angle\\ 
 \multirowcell{2}{Flash lamp,\\percussion}  & 0.5   & 90    & 0.5   & 90 \\ \cmidrule{2-5} % ??????
    & 0.5   & 30    & 0.5   & 30 \\ 

 Fiber, trepanation & 0.5   & 30    & 0.5   & 30 \\

 Fiber, percussion  & 0.5   & 30    & 0.5   & 30 \\\bottomrule 
 \end{tabulary}

\footnotesize
\caption{Measurement of averaged crack length in TBC layer, at BC/substrate interface (shown as BC-Sub int.), and in substrate.}
\begin{tabulary}{\linewidth}{l*{7}{C}}\toprule
Crack length    & Test column1  & Test column2  & Test column3  & Test column4  & Test column5  & Test column6  & Test column7 \\\midrule 
TBC         & $37\pm31$     & $103\pm94$    & $142\pm70$    & $337\pm436$   & $94\pm74$ & $100\pm107$   & $41\pm33$ \\ 
BC-Sub int. & $71\pm15$     & $138\pm42$    & $156\pm7$     & $400\pm50$    & $47\pm22$ & $136\pm35$    & $20\pm10$ \\ 
Substrate   & $42\pm9$      & $5\pm5$       & $58\pm22$     & 91            & $78\pm12$ & $50\pm26$     & 0 \\\bottomrule 
\end{tabulary}

\caption{Measured averaged thickness of TBC and BC/substrate recast layers}

\begin{tabularx}{\linewidth}{l*{7}{M}}\toprule
Recast thickness    & \ch{Test column1} & \ch{Test column2} & \ch{Test column3} & \ch{Test column4} & \ch{Test column5} & \ch{Test column6} & \ch{Test column7} \\\midrule 
TBC recast      & 19\pm8    & 83\pm46   & 56\pm17   & 77\pm24   & 35\pm12   & 33\pm12   & 33\pm19 \\ 
BC-Sub recast   & 23\pm8    & 27\pm10   & 46\pm20   & 60\pm21   & 29\pm20   & 20\pm13   & 0 \\\bottomrule 
\end{tabularx}
\end{table}

\end{document}

You must log in to answer this question.

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