1

I would like to set it to 8pt for tables globally. How would one go about doing that?

I did see this article.

The solution provided by Marco Daniel works very well if you want to set the font size to small/large, without a specific number.

Any help will be nice to have.

@Darko please find here the MWE

\documentclass[a4paper,11pt]{article}
\usepackage{booktabs}
\fontsize{8 pt}{10 pt}{\selectfont}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\noindent\begin{table}[htb!]
    \centering
          \def\arraystretch{0.8}%  1 is the default, change whatever you need
    \caption{sum.}
    \label{tab: sum}
    \begin{tabular}{@{}lllc@{}}
        \toprule
        \textbf{\#} & \textbf{Scope}  &  \textbf{Activity}   & \textbf{Month} \\
        \midrule
        1 & foo                        & bar                  & M1-M24\vspace{1mm}\\ 
        \bottomrule
    \end{tabular}
\end{table}
\end{document}
tandem
  • 407
  • 1
    You can check which font command you need based on the default document font size (see, e.g., https://tex.stackexchange.com/questions/24599/what-point-pt-font-size-are-large-etc). So, for standard document classes, if the document font size is 11pt or 12pt then you should set the table font size to \scriptsize to get 8pt in tables, and if the document font size is 10pt then you should use \footnotesize. – Marijn Jul 10 '18 at 09:27
  • for example with \fontsize{8 pt}{10 pt}\selectfont}? – Zarko Jul 10 '18 at 09:28
  • 1
    You could try this, which relies on the etoolbox package: \AtBeginEnvironment{table}{\fontsize{8pt}{10pt}\selectfont} and probably similarly for longtable if you use it. – Bernard Jul 10 '18 at 09:30
  • Bernard and Zarko: I did not see any difference in font after using either of them – tandem Jul 10 '18 at 09:39
  • @Marijn, that's not a bad idea, but that would never be standardised.. as one would always have to look at the cls file. – tandem Jul 10 '18 at 09:40
  • @tandem you're right that the settings may need to be changed for different documents - however I assumed that you (and/or other people reading your question) want this for a particular use case (a single document, or a set of documents with the same class and main font size), instead of wanting 8pt in tables always for every document you make. – Marijn Jul 10 '18 at 09:49
  • @Marijn, that's fair enough. if you can write your comment as an answer, I can tick it. – tandem Jul 10 '18 at 09:51
  • @tandem, i doubt that your observation is correct. can you show (in question) how you tested mine and Bernard suggestion? – Zarko Jul 10 '18 at 11:04
  • @Zarko I can do that later today and add that to the question. – tandem Jul 13 '18 at 08:05
  • @Zarko: added the comment – tandem Jul 17 '18 at 08:30

0 Answers0