How to get a different formatting for the label and text of a subsection using titlesec?
Reason: Italic numbers in the subsection heading hurts my eyes and should be avoided at all cost, Label of the subsection should be a normal roman while the text should be in italic
First I define the fonts for the section and subsection headings of my document using fontspec:
\usepackage{fontspec}
\usepackage{titlesec}
\newfontfamily\sectionfont[LetterSpace=16.0,Path=C:/fonts/]{LTe50383.pfb} %sectionfont in Sabon Roman
\newfontfamily\subsectionfont[Path=C:/fonts/]{LTe50384.pfb} %subsection font is Sabon Italic
After this I define the titleformats:
\titleformat{\section}{\sectionfont}{\thesection.}{1em}{\MakeUppercase}{}
\titleformat{\subsection}{\subsectionfont}{\thesubsection.}{1em}{}{}
Is it even possible to differ the formatting? As written in the titlesec manual:
format is the format to be applied
to the whole title—label and text.
This part can contain vertical
material (and horizontal with some
shapes) which is typeset just after
the space above the title.
Best Answer
should do the trick.