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
\documentclass[]{exjobb}
\usepackage[english]{babel}
% Title Page
\title{A testing Typographithing}
\author{Tesla Testing}
\begin{document}
\maketitle
Well this is just for testing
\begin{abstract}
text text
\end{abstract}
\section{SectionTitle}
section text
\end{document}
And this is my .cls file:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{exjobb}[2017/03/18 A class based on format requirements for degree project report at the Xbio program att Uppsala University]
\LoadClass{article}
\RequirePackage{titlesec}
\RequirePackage{fontspec}
\RequirePackage{parskip}
\RequirePackage{setspace}
%% Set bread text options
\setmainfont{Times New Roman}
\setstretch{1.5}
\setlength{\parindent}{0pt}
\setlength{\parskip}{12pt}
%%%Set Header 1 options
\newfontface\headingfont{Arial}
%\titlelabel{\section.\quad}
\titleformat{name=\section}[display]{\Large\headingfont}{\section.\quad}{0em}{}{}
Through the process of elimination I understand that the problem occurs when \titleformat is introduced, but I don't understand why.
Best Answer
The section number is obtained with
\thesection
.