Forgive the stupid simplicity of this question, and please feel free to refer me to an older answer. I'm not quite familiar enough with LaTeX terminology to have found it.

All I want to do is set a different default format for my section titles. Instead of just being bolded and slightly larger than the main text, I'd like them to be of normal weight, the same size as the main text, and all caps.

I'm using the article class.

  • 5
    do any of your section titles contain math? if so, then small caps isn't a good choice, since much of the math may then be taller than the text. (this is why the ams document classes use all real uppercase for running heads, even though it would be more traditional, and proper, to use small caps; the inter-letter spacing in small caps is better, and if designed properly, the shapes are also subtly different from regular caps. but in some situations, math rules.) Commented Nov 30, 2011 at 14:07

3 Answers 3


You can use the titlesec package:




\section{Test Section}


to use small caps for the section titles:

enter image description here





\section{Test Section}


to use upper case for the section titles:

enter image description here

If you don't want to use the titlesec package, you can redefine the \section command, as implemented in article.cls; here's an example of such a redefinition to obtain section titles using small caps:


\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%


\section{Test Section}

  • 1
    That is a perfect explanation but I am curious about what do the commands inside the fourth, fifth and sixth braces do exactly. I referred to the manual but got confused more.
    – Vesnog
    Commented Mar 24, 2014 at 0:29
  • I'm trying the titlesec package with \MakeUppercase. Assigning <explicit> option to <titlesec> and "#1" obliterates all other section titles (subsection, subsubsection).
    – Pwdr
    Commented Oct 16, 2015 at 11:55
  • @Pwdr If you are redefining those sectional units, you need to use #1 in the last argument, since explicit is being used. Commented Oct 16, 2015 at 13:31
  • @Gonzalo - I was adding {#1} to the last argument of the section which utilised {\MakeUppercase} but I didn't realise I had to add {#1} to the last argument on ALL sectional units, even if they don't use {\MakeUppercase}. All sorted now!
    – Pwdr
    Commented Oct 16, 2015 at 16:30
  • About the second way, can I somehow add a new section style and define it using titlesec? Commented Feb 21, 2023 at 12:38

I'd like to take a crack at this question, because 5 years ago I landed here and thought titlesec was the best way to do this. That may or may not be true.

The class settings are perhaps obvious to experts, but rather obscure to new users of LaTeX.

$(kpsewhich -var-value TEXMFDIST)/tex/latex/base/article.cls

For the 2016 version, this would result in /usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls on a Unix-based system.

The relevant parts of the article class extracted from the file.

% Do you want numbering?
% Setup Counters using TeX or LaTeX
\newcounter {part}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

% Format Output of Counters

% Define Sectioning Commands (\part is the oddball)
   \if@noskipsec \leavevmode \fi

    \ifnum \c@secnumdepth >\m@ne
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \ifnum \c@secnumdepth >\m@ne
       \Large\bfseries \partname\nobreakspace\thepart
     \huge \bfseries #2%
    \vskip 3ex
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \huge \bfseries #1\par}%
     \vskip 3ex
\newcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                       {3.25ex \@plus1ex \@minus .2ex}%

% For something like Appendix where sections should appear as letters,
% reset counters to 0 and use \@Alph to make \c@section appear as A.

% How should it appear in the table of contents?
% Usually the ToC title is formatted like the sections.
  • \z@ = 0, see What does \z@ do?
  • \c@countername = the TeX register that actually holds the integer which is created by the LaTeX macro \newcounter (normally only for backend, hence the @) and which is made globally accessible, see What are the differences between TeX counts and LaTeX counters?
  • \m@ne = register with counter equal to -1, see What do \m@ne‎ and \@M do in the definition of \@makechapterhead?
  • \@M = \mathchardef = \mathchar"2710 = 10000, see above.
  • \leavevmode = leave vertical mode [and implicitly enter horizontal mode], see Function and usage of \leavevmode

    Use \leavevmode for all macros which could be used at the begin of the paragraph and add horizontal boxes by themselves (e.g. in form of text).

  • \@afterindentfalse opposed to \@afterindenttrue LaTeX kernel macro that is part of \if@afterindent. It is setting the @afterindent to false after a sectioning command such that paragraphs directly following headings are not intended. Subsequent paragraphs will be indented when the expansion of this becomes \@afterindenttrue, see http://mirror.easyname.at/ctan/macros/latex/required/tools/indentfirst.pdf
  • \secdef in e.g. \secdef\@part\@spart is effectively a switcher between the starred version \@spart (s for starred part) and the non-starred version \@part. This enables * to influence which macro is expanded, see What does \secdef do?
  • \@plus LaTeX macro = TeX macro \plus, \show\@plus = =macro: ->plus., see What is glue stretching?
  • \@minus LaTeX macro = TeX macro \minus, see above.
  • \ifnum \c@secnumdepth >\m@ne just says if the depth of the section counter is anything greater than -1, then add this heading to the table of contents else...
  • \parindent = amount of space indented
  • \raggedright = A LaTeX kernel macro. It tells TeX to left-align something with disregard to the TeX typographical point system that makes the proper inter-word space adjustments for a pretty, squared paragraph shape (full justification). = \let\\\@centercr\@rightskip\@flushglue \rightskip \@rightskip\leftskip\z@skip\parindent\z@, see Combining leftskip, rightskip and raggedright
  • \@afterheading LaTeX macro that deals with post-heading stuff e.g. preventing a page break between the heading and next line (usually a club line of a paragraph), or that line (club) with its next line. The first is done using \if@nobreak logic, the latter with \clubpenalty=10000=maximum penalty.

    \@nobreaktrue \everypar{\if@nobreak \@nobreakfalse \clubpenalty\@M \if@afterindent \else {\setbox\z@\lastbox} \fi \else \clubpenalty\@clubpenalty \everypar{} \fi} }\@fb@afterHHook

Editing Sections

Just looking around at the article.cls can be very helpful, but there are many commands using the @ sign, which helps ensure that user-level commands will not overlap with "kernel" commands i.e. you will unlikely put \newcommand\@Alph{} in your preamble (if you did, you would get an error, because TeX expects all characters in macro names/command sequence names to have category code 11), see What do \makeatletter and \makeatother do? and What are category codes? for details.

You could redefine the sections to your specifications by using \renewcommand. Note that you need to temporarily change the category code of @ to access the kernel commands. Either surround your definition with

% insert macro with @ here


% insert macro with @ here

Grandfather \@startsection

Note that the grandfather of all sectioning commands/headings, except part, is \@startsection. Understanding it can be tricky, but \show\@startsection reveals its definition:

\if@noskipsec \leavevmode \fi \par \@tempskipa #4\relax \@afterindenttrue \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse \fi \if@nobreak \everypar {}\else \addpenalty \@secpenalty \addvspace \@tempskipa \fi \@ifstar {\@ssect {#3}{#4}{#5}{#6}}{\@dblarg {\@sect {#1}{#2}{#3}{#4}{#5}{#6}}}.


To use it to create new headings, you need define the following:

  • A counter with the same name
  • Format the counter output
  • ToC entry line format
  • The \@startsection command itself
  • The header/footer "mark"

Note that when using etoc, it is important to also provide a level for the new command separately from setting it in \@startsection.

For details on \@startsection, see see Where can I find help files or documentation for commands like \@startsection for LaTeX?.

Full Example


% Change existing
% Article Class already defined a counter for this heading
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\MakeUppercase}}% look at \contentsname

% Add new
\newcounter{mysection}% add counter
\renewcommand\themysection{\@arabic\c@mysection}% set typesetting format of counter to arabic numerals
\newcommand*\l@mysection{\@dottedtocline{1}{0em}{1.5em}} % define table of contents line format
% Article Class \l@section
%  \ifnum \c@tocdepth >\z@
%    \addpenalty\@secpenalty
%    \addvspace{1.0em \@plus\p@}%
%    \setlength\@tempdima{1.5em}%
%    \begingroup
%      \parindent \z@ \rightskip \@pnumwidth
%      \parfillskip -\@pnumwidth
%      \leavevmode \bfseries
%      \advance\leftskip\@tempdima
%      \hskip -\leftskip
%      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
%    \endgroup
%  \fi}
\newcommand\mysectionmark[1]{} % define header/footer                            
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\bfseries\Large\normalfont\noindent\textcolor{orange}}} % use \textcolor{color}{arg consumed later automatically} instead of \color{color} to avoid a whatsit and disrupt the page breaking mechanism. Add \noindent when using \textcolor here. Indentation can still be achieved by replacing arg 3 of \@startsection.       


Lions, tigers, and bears, oh my!

Carrots, parsnips, and broccoli, oh my!


enter image description here

  • 8
    Very thorough indeed!
    – Mico
    Commented Oct 30, 2016 at 9:35
  • Excellent work was always wanting this explanation
    – js bibra
    Commented Sep 5, 2023 at 15:35

If you want to customize the section titles with titlesec, this includes the font size, font type, color, underline, and more:




You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .