1

I need 11pt titles and don't know what to do, 'medium' seems quite vague. This is my code:

\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Medium\upfamily\centering}
{\chaptertitlename\ \thechapter}{0pt}{\Medium}
LaRiFaRi
  • 43,807
Guillaume Coatalen
  • 491
  • 1
  • 4
  • 11
  • Where did you find this \Medium command? Sma question for the \upfamily. I suppose you mean \upshape – Bernard Aug 10 '15 at 21:23
  • in the titlesec package pdf. – Guillaume Coatalen Aug 10 '15 at 21:24
  • Oh! I see. They aren't commands, They're keywords used as options for the simple use of the package. The titleformatis one of the advanced commands. Are you sure you want a11pt` size for chapter tiles? It's a size for normal text. – Bernard Aug 10 '15 at 21:30

1 Answers1

2

The medium in titlesec is a package option, not a command. So it is accessed by \usepackage[medium]{titlesec}. If you need all section titles to be 11pt, and your document text is also 11pt, the use \usepackage[tiny]{titlesec} which makes all headings (except chapters) to be the text font size.

To make chapter headings the same size as the main document font size, you can use \normalfont in the chapter title definition.

Here's a small document that shows both patterns. I've added the \fontsize macro from What point (pt) font size are \Large etc.? to show the actual size.

The tiny option sets all section and lower headings to the same size as the font size. It doesn't change chapter headings and you say you want them centred so I have given an example of how to do that.

To adjust the chapter spacing you need to supply values for the \titlespacing command. To set the titles immediately above the following text you can set the spacing to 0pt. using \titlespacing*{\chapter}{0pt}{0pt}{0pt}.

\documentclass[11pt]{report}
\usepackage[tiny]{titlesec}
\titleformat{\chapter}[display]%
     {\normalfont\bfseries\fillast}
     {\chaptertitlename\ \thechapter}
     {0pt}{}
\titlespacing*{\chapter}{0pt}{0pt}{0pt}
\makeatletter
\newcommand\thefontsize[1]{{#1 \f@size pt\par}}
\makeatother
\begin{document}
\chapter{\thefontsize{This is a chapter }}
Some text.
\section{\thefontsize{This is a section}}
\subsection{\thefontsize{This is a subsection}}
\end{document}

output of code

Alan Munn
  • 218,180