General ⇒ Changing section heading font size
Changing section heading font size
I would like to change the size of font used for section headings (make them smaller to save space). Is there an easy way to do this? I tried \section{\large{Section Title}}, but this doesn't change the size of the section number. \large{\section{Section Title}} completely messes up the formatting. I'm using the standard standard article document class. I suspect I could do something via defining a new command, but this is rather beyond my level of experience. Any help would be much appreciated.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Changing section heading font size
1.- A direct redefinition of \section:
Code: Select all
\makeatletter
\renewcommand\section{\@startsection{section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\large\bfseries}}
\makeatother
Code: Select all
\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
Code: Select all
\usepackage{sectsty}
\sectionfont{\large}
By the way, never use formatting commands in the argument of \section and friends. For changing their aspect, redefine those commands as suggested above. Likewise, \large and similar commands does not have an argument. Hence the pair of braces after them are superfluous, that is, \large{text} gives the same result as \large text (with no braces). Braces, however, are frequently used to limit the scope of such a command. If you have a line of code like
Code: Select all
text before {\large text inside} text after
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing section heading font size
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Changing section heading font size
i.e.
\section{introduction}
output
1. introduction
Re: Changing section heading font size
Cheers,
Nkal