I am trying to write a class file (.cls) for my degree report following a university standard. However, when I try to edit the headings (for section, subsection or subsubsection) I get a nesting error.
This is my test program:

% !TeX program = lualatex

% Title Page
\title{A testing Typographithing}
\author{Tesla Testing}

Well this is just for testing

text text

section text


And this is my .cls file:

\ProvidesClass{exjobb}[2017/03/18 A class based on format requirements for degree project report at the Xbio program att Uppsala University]

%% Set bread text options
\setmainfont{Times New Roman}


%%%Set Header 1 options

Through the process of elimination I understand that the problem occurs when \titleformat is introduced, but I don't understand why.

  • 2
    Welcome to TeX.SX! You need \thesection.quad. – egreg Mar 20 '17 at 10:51
  • 'll add that I don't see the point for a \quad after the section number in display style. – Bernard Mar 20 '17 at 10:54
  • @egreg Do you want to add an answer? – Johannes_B Mar 18 '18 at 8:06
  • @Johannes_B done – egreg Mar 18 '18 at 9:25

The section number is obtained with \thesection.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.