Written and maintained by CASRAI Editorial Board
Published
On this page
Who this is for: researchers writing a thesis, article or report in LaTeX who need to add, number, hide or format a subsection heading, and to know what it does to the table of contents.
subsection{Title} starts a second-level heading below section. LaTeX numbers it automatically (for example 2.1 under section 2) and adds it to the table of contents. Add an asterisk, subsection*{Title}, for an unnumbered heading that stays out of the table of contents. This also answers the common search “subsection in LaTeX”.
What subsection is used for in research writing
Manuscripts, theses and reports are organised in nested headings. LaTeX defines them as numbered levels, and the Overleaf documentation on sections and chapters lists them as: -1 part, 0 chapter, 1 section, 2 subsection, 3 subsubsection, 4 paragraph and 5 subparagraph. So subsection is level 2. Which of these commands exist depends on the document class: chapter is available in books and reports, and the sectioning commands are not available in letters (Overleaf; LaTeX Wikibook, Document Structure).
Install or access
subsection is a core sectioning command, so it needs no extra package in the standard document classes that provide it. You only need a working LaTeX editor or distribution, or an online editor such as Overleaf. A package is needed only if you want to restyle headings (see titlesec below).
Step by step: add a subsection
- Put a
section{...}heading first, then add the subsection after it in the document body:section{Methods} subsection{Participants} Text of the subsection. subsection{Procedure} More text. - Compile. LaTeX numbers the headings itself, so these appear as 1.1 and 1.2 under section 1. Do not type the numbers by hand.
- For an unnumbered heading, add an asterisk:
subsection*{Introduction}. The LaTeX reference manual says the starred form does not show the number, does not increment the counter, produces no table of contents entry and does not affect the running header. - For a shorter title in the table of contents and running heads, put it in square brackets before the braces:
subsection[Short title]{A much longer descriptive title}. The LaTeX Wikibook gives the same pattern forsection, for examplesection[Effect on staff turnover]{...}. - To print the table of contents, add
tableofcontentswhere you want it and compile again.
Subsection numbering and table of contents depth
Two counters control how deep headings are numbered and listed. According to the LaTeX Wikibook, secnumdepth is set to 3 by default, and the default table of contents lists headings of level 3 and above; subsection is level 2, so it falls inside that range. Overleaf shows that you can change numbering depth with setcounter{secnumdepth}{3} in the preamble, in an example where sub-subsections were unnumbered by default in a book. The matching table of contents counter is tocdepth.
Choosing between the heading variants
| You write | Numbered | In table of contents | Source |
|---|---|---|---|
subsection{Title} |
Yes | Yes | LaTeX2e reference manual (latexref.xyz) |
subsection*{Title} |
No; the counter is not incremented | No | LaTeX2e reference manual; Overleaf |
subsection[Short]{Long title} |
Yes | Yes, using the short title | LaTeX Wikibook; LaTeX2e reference manual |
addcontentsline{toc}{subsection}{Title} before subsection*{Title} |
No | Yes, added manually | Overleaf, table of contents article (shown there for section) |
The last row adapts a pattern Overleaf demonstrates with addcontentsline{toc}{section}{Unnumbered Section} placed before section*{Unnumbered Section}. Replace the level name with subsection for a subsection-level entry, and check the result in your own compiled table of contents.
Change how subsections look
Overleaf documents the titlesec package for heading appearance. Its commands are titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>] for the format and titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>} for spacing. Use subsection as the command argument to target subsections. If a journal or university supplies its own class file, follow that class rather than overriding headings.
Output and how to read it
In the compiled PDF, a numbered subsection shows as a number with the section number as prefix (1.1, 1.2) followed by the title. In the table of contents it appears indented below its parent section, with a page number. A starred subsection shows only its title and is absent from the table of contents. If a number looks wrong, compile twice: LaTeX writes numbers and contents entries to auxiliary files and reads them on the next run. To refer to a subsection by number in text, see how to use LaTeX ref and label.
Troubleshooting
Undefined control sequence or no heading in a letter
The LaTeX Wikibook states that part, section and the other sectioning commands are not available in letters. Use an article, report or book class for structured documents.
chapter fails in an article
Both Overleaf and the Wikibook state that chapter exists only in books and reports. In an article, section is the top level and subsection sits directly under it.
A starred heading is missing from the table of contents
That is the defined behaviour of the star form. Use the addcontentsline pattern in the table above if you need the entry listed.
Deeper headings are not numbered
Raise secnumdepth in the preamble, as in the Overleaf example above. See also the LaTeX document structure guide for the wider document skeleton.
Subsections in an appendix or notes document
Appendix headings follow the same sectioning commands; see adding an appendix in LaTeX and the LaTeX notes template for layouts that use them.
FAQ
How do I make a subsection in LaTeX?
Write subsection{Your title} after a section command. LaTeX numbers it and lists it in the table of contents automatically.
How do I make an unnumbered subsection?
Use subsection*{Your title}. It has no number, does not increment the counter and has no table of contents entry.
What is the difference between section, subsection and subsubsection?
They are levels 1, 2 and 3 of the same heading hierarchy; subsection nests inside section, and subsubsection inside subsection.
Sources
- Overleaf Learn, Sections and chapters: https://www.overleaf.com/learn/latex/Sections_and_chapters (read 2026-11-07)
- Overleaf Learn, Table of contents: https://www.overleaf.com/learn/latex/Table_of_contents (read 2026-11-07)
- Wikibooks, LaTeX/Document Structure: https://en.wikibooks.org/wiki/LaTeX/Document_Structure (read 2026-11-07)
- LaTeX2e unofficial reference manual, section: https://latexref.xyz/_005csection.html (read 2026-11-07)







