# Specifying section font size in points

I'm writing a paper for a conference that requires section headings to have a certain format, with the font size specified in points. There seem to be two packages for changing the fonts of section headings, titlesec and sectsty. However, with sectsty I can't work out how to make subsubsection headings non-bold (which I also need), and with titlesec I can't see how to specify the font size in points, rather than just as "big", "medium", etc.

For completeness, what I need to do is this:

• typeset \section headings in 11pt bold

• typeset \subsection headings in 10pt bold

• typeset \subsubsection headings in 10pt roman

• remove the whitespace following \subsection and \subsubsection headings.

What is the best way to achieve these effects, using either package?

-

With sectsty it's difficult to change the spacings; with titlesec one has to rebuild all headings. Probably copying the definitions from article.cls and modifying them is the easiest way:

\documentclass{article}

\makeatletter
\renewcommand\section{%
\@startsection{section}{1}
{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\fontsize{10.95}{13.6}\bfseries}% 11pt
}
\renewcommand\subsection{%
\@startsection{subsection}{2}
{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1sp}% No space after subsections
{\normalfont\normalsize\bfseries}% normal size, boldface
}
\renewcommand\subsubsection{%
\@startsection{subsubsection}{3}
{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1sp}% No space after subsubsections
{\normalfont\normalsize}% normal size, medium
}
\makeatother

\usepackage{lipsum} % to provide mock text

\begin{document}
\section{This is large boldface}
\lipsum[2]
\subsection{This is normal size boldface}
\lipsum[2]
\subsubsection{This is normal size medium}
\lipsum[2]
\end{document}


The 1sp for getting zero space is just a trick: if we put 0pt, the heading would be in line (an optimization trick used by LaTeX not to increase the number of arguments). But 1sp is just indistinguishable from zero.

-
 Thanks, this looks great. I'll leave the question open for a bit in case someone has a better answer (this one feels like a little bit of a hack, but that's nitpicking), and if not I'll accept this. By the way, where do the numbers come from in the \fontsize{10.95}{13.6} command? – Nathaniel Nov 8 '12 at 13:01 @Nathaniel They come from the setting used from LaTeX for 11pt type size (see the file size11.clo). The interline skip (13.6pt) is relevant only if the section title needs to be split across lines. – egreg Nov 8 '12 at 13:13