LaTeX forum ⇒ General ⇒ Changing section heading font size

LaTeX specific issues not fitting into one of the other forums of this category.
BobQQ
Posts: 1
Joined: Sun Nov 30, 2008 12:16 am

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.

Juanjo
Posts: 656
Joined: Sat Jan 27, 2007 12:46 am
You have several ways to do so:
1.- A direct redefinition of \section:
`\makeatletter\renewcommand\section{\@startsection{section}{1}{\z@}%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%                                   {2.3ex \@plus.2ex}%                                   {\normalfont\large\bfseries}}\makeatother`

2.- By means of the titlesec package:
`\usepackage{titlesec}\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}`

3.- By means of the sectsty package:
`\usepackage{sectsty}\sectionfont{\large}`

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
`text before {\large text inside} text after`
\large only affects to "text inside".
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
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
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

fayez
Posts: 13
Joined: Mon Dec 21, 2009 12:00 am
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

nkal
Posts: 17
Joined: Fri Jul 10, 2009 8:57 pm
Thank you, Juanjo. I was looking for a solution to the same problem and your option 1 worked great.

Cheers,
Nkal