Hi,
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.
General ⇒ Changing section heading font size
Changing section heading font size
You have several ways to do so:
1.- A direct redefinition of \section:
2.- By means of the titlesec package:
3.- By means of the sectsty package:
If you want to change more sectioning commands or give them a more sophisticated appearance, it is worthy to load titlesec, or even sectsty. If you only want to reduce the size of section titles, any approach is valid.
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 \large only affects to "text inside".
1.- A direct redefinition of \section:
Code: Select all
Code, edit and compile here:
\makeatletter\renewcommand\section{\@startsection{section}{1}{\z@}%{-3.5ex \@plus -1ex \@minus -.2ex}%{2.3ex \@plus.2ex}%{\normalfont\large\bfseries}}\makeatother
Code: Select all
Code, edit and compile here:
\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
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing section heading font size
From all the possible solutions listed by Juanjo the version by the titlesec package is the preferable one, because the package offers the simplest interface for such modifications.
Thorsten
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Changing section heading font size
How would you change the numerical section size as well? and maybe add a dot or a dash to the normal latex output
i.e.
\section{introduction}
output
1. introduction
i.e.
\section{introduction}
output
1. introduction
Re: Changing section heading font size
Thank you, Juanjo. I was looking for a solution to the same problem and your option 1 worked great.
Cheers,
Nkal
Cheers,
Nkal