1

I would like to reduce the font size into of all my tables.

The ideal would be to put new macro at the top of my Latex source.

I show you for the moment the current formatting :

we have 4 bins and not 5. Below in \ref{density1} the official IST table of density of galaxies, redshift bins and redshift bin widths :
\begin{table}[h!]
\begin{center}
\begingroup
\setlength{\tabcolsep}{3pt} % Default value: 6pt
\renewcommand{\arraystretch}{1} % Default value: 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & 
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c|}{} \\ \hline
\end{tabular}
\endgroup
\end{center}
\caption{Spectroscopic specifications from \citetalias{IST:paper1} with 4 bins}
\label{density1}
\end{table}
We have adapted the binning and the width of each IST bin table in order to get the same $n(z)$ photometric population.

and the rendering :

rendering : font size too big compared to text

I have attempted with '\small' and other commands without success.

If someone could tell me how to reduce this size font in table, this would be fine.

2
  • How about your own special environment, \newenvironment{mytable}[1][tbp]{\begin{table}[#1]\centering\small}{\end{table}} Apr 2, 2022 at 15:55
  • @StevenB.Segletes . Thanks a lot, it works ! Regards
    – user94782
    Apr 2, 2022 at 16:19

2 Answers 2

0

I propose using a custom environment that starts up table in a smaller fontsize. Here, I call it mytable. Caption fontsize can also be defaulted with the caption package using a \captionsetup.

\documentclass{book}
\usepackage{stackengine,caption}

\newenvironment{mytable}[1][tbp]
               {\begin{table}[#1]\captionsetup{font=footnotesize}
                  \centering\footnotesize}
               {\end{table}}
\begin{document}
\begin{mytable}[h!]
\setlength{\tabcolsep}{3pt} % Default value: 6pt
\renewcommand{\arraystretch}{1} % Default value: 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & 
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c|}{} \\ \hline
\end{tabular}
\caption{Spectroscopic specifications from a reference with 4 bins}
\label{density2}
\end{mytable}

The original settings...
\begin{table}[h!]
\begin{center}
\begingroup
\setlength{\tabcolsep}{3pt} % Default value: 6pt
\renewcommand{\arraystretch}{1} % Default value: 1
\begin{tabular}{|c|c|c|c|c|}
\hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & 
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{} &
\multicolumn{1}{c|}{} \\ \hline
\end{tabular}
\endgroup
\end{center}
\caption{Spectroscopic specifications from a reference with 4 bins}
\label{density1}
\end{table}
\end{document}

enter image description here

1

If all your table contain tables in tabular environment, than you can use etoolbox and set for them \small font size:

\documentclass{book}
\usepackage{stackengine,caption}

\usepackage{etoolbox}                % <---
\AtBeginEnvironment{tabular}{\small} % <---

\usepackage{lipsum}

\begin{document}
\lipsum[66]
    \begin{table}[ht!]
    \centering
    \setlength{\tabcolsep}{3pt}
    \renewcommand{\arraystretch}{1.2}
\begin{tabular}{|c|c|c|c|c|}
    \hline
\addstackgap{Redshift central bin} & 1.0 & 1.2 & 1.4 & 1.65 \\ \hline
\addstackgap{$\mathrm{d}N / \mathrm{d}\Omega\mathrm{d}z\left[\mathrm{deg}^{-2}\right]$} & 1815.0 & 1701.5 & 1410.0 & 940.97 \\ \hline
\addstackgap{$\Delta z$ : width of bin} & 0.2 & 0.2 & 0.2 & 0.3 \\ \hline
\addstackgap{$\rho_{gal}$\,(gal.arcmin$^{-2}$}) & 0.1008 & 0.0945 & 0.0783 & 0.0784 \\ \hline
\addstackgap{$\rho_{gal,tot}$\,(gal.arcmin$^{-2}$)} & 0.3521 & \multicolumn{3}{c|}{}            \\  \hline
\end{tabular}   
    \caption{Spectroscopic specifications from a reference with 4 bins}
    \label{density2}
    \end{table}
\lipsum[66]
\end{document}

enter image description here

You must log in to answer this question.