63

I'm writing a paper that requires the section titles to be in 12pt font, I can get the title to be in 12pt using:

\section{\fontsize{12}{15}\selectfont Introduction}

but the section number does not change size, is there a way to do this?

I've also tried looking at titlesec but have not been able to find any suitable examples.

Werner
  • 603,163
andy mcevoy
  • 1,729

1 Answers1

94

Here's one possibility using the sectsty package:

\documentclass{article}
\usepackage{sectsty}

\sectionfont{\fontsize{12}{15}\selectfont}

\begin{document}

\section{Test Section}
test

\end{document}

The titlesec package could also be used:

\documentclass{article}
\usepackage{titlesec}

\titleformat{\section}
  {\normalfont\fontsize{12}{15}\bfseries}{\thesection}{1em}{}

\begin{document}

\section{Test Section}
test

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • 2
    This is helpful to see how to set the font size to a specified pt size. – Steven C. Howell Jun 02 '15 at 13:38
  • 4
    Note, if you do the same thing (with the titlesec package) for a subsection, then replace \thesection with \thesubsection. – stack-delay Nov 19 '18 at 17:36
  • 1
    The titlesec solution seems to work for sections and subsections, but not for parts and chapters in the book class. And my editor wants 13pt for the part title. Is there a solution for this with titlesec? – Simon Aug 11 '19 at 20:22
  • 4
    Would it be possilbe to edit this answer to clarify what the arguments {12}{15} mean for the \fontsize command? Why are there two sizes? What do each mean? Under what scenarios would changing the first/second number be expected to change the actual font size? – MRule Sep 09 '21 at 15:10
  • 1
    @Mrule 12 is the text size and 15 the title font size – Samuel Saari Sep 14 '21 at 13:41
  • 4
    Smauel Saari, that is not right. @MRule, the sintax is \fontsize{<size>}{<line space>}. See LatexFonts at wikibooks. – Fabricio Oct 13 '21 at 22:07