1

I want to change some fontsizes of headings and subheadings and tried this:

\documentclass[12pt]{report}

\usepackage{titlesec} \titleformat{\title}{\LARGE\bfseries} \titleformat{\section}{\Large\bfseries} \titleformat*{\subsection}{\large\bfseries}

Now I always get the message titlesec not allowed in easy mode. Is there an alternative solution/how I can fix this?

Marijn
  • 37,699
  • 2
    Possibly a duplicate. See this answer: https://tex.stackexchange.com/questions/134031/how-to-adjust-the-size-and-placement-of-chapter-heading-in-report-class – SebGlav Feb 24 '21 at 11:27

1 Answers1

1

\title is no sectioning command, so titlesec does nothing but to throw an error. (Admittedly the error and help messages are not particularly clear.) If you want to change the appearance of the title you should write the title page yourself or possibly patch \maketitle like this:

\documentclass[12pt]{report}

\usepackage{xpatch} \makeatletter \xpatchcmd{\maketitle}{@title}{\bfseries@title}{}{} \makeatother

\usepackage{titlesec} \titleformat{\section}{\Large\bfseries} \titleformat{\subsection}{\large\bfseries}

\title{My Great Masterpiece} \author{Me Myself}

\begin{document}

\maketitle

\chapter{Foo} \section{Bar} \subsection{Baz}

\end{document}

enter image description here

By default the title is already \LARGE so there is no need to add it extra. Note also that your current use of \titleformat* corresponds to the standard definitions, so those lines aren't really doing anything useful.

campa
  • 31,130
  • There's also the titlingpackage, which defines useful commands to customise \maketitle. – Bernard Feb 24 '21 at 12:48
  • @Bernard Thanks. I must admit that I am not familiar with these packages: if I have to do something in a specific way I just hack the code myself :-) – campa Feb 24 '21 at 12:52