0

I am trying to configure how my chapter headings look. So far, they looks as I want. However, there are some errors.

All my \chapter are having these errors:

Illegal unit of measure (pt inserted). \chapter{Remediation experiment}
Illegal unit of measure (pt inserted). \chapter{Remediation experiment}
Illegal unit of measure (pt inserted). \chapter{Remediation experiment}
Missing number, treated as zero. \chapter{Remediation experiment}
Missing number, treated as zero. \chapter{Remediation experiment}
Missing number, treated as zero. \chapter{Remediation experiment}

This is my code

\documentclass[a4paper,12pt]{report}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\raggedleft\bfseries}
{\chaptertitlename\ \thechapter}
{   \vspace{1ex}
    \titlerule[2pt]%
    \vspace{2ex}%
    }{}
\titlespacing*{\chapter} {}{-60pt}{20pt}   %% adjust these numbers

\usepackage{natbib}
\bibliographystyle{apalike}
\usepackage{glossaries}

\setacronymstyle{long-short}

\begin{document}

\title{Proposal for PhD project}
\author{XXX}
\maketitle
\newpage

\pagenumbering{roman}
\tableofcontents
\newpage
\pagenumbering{arabic}

\chapter{Introduction}

1 Answer 1

3
  1. The fifth argument of the titleformat command must be a distance not some latex commands
  2. The second argument of the \titlespacing command must not be empty

!

\documentclass[a4paper,12pt]{report}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\raggedleft\bfseries}
{\chaptertitlename\ \thechapter}
{1ex}
{ \titlerule[2pt]%
    \vspace{2ex}%
    }
\titlespacing*{\chapter} {0pt}{-60pt}{20pt}   %% adjust these numbers

\usepackage{natbib}
\bibliographystyle{apalike}
\usepackage{glossaries}

\setacronymstyle{long-short}

\begin{document}

\title{Proposal for PhD project}
\author{XXX}
\maketitle
\newpage

\pagenumbering{roman}
\tableofcontents
\newpage
\pagenumbering{arabic}

\chapter{Introduction}

\end{document}
1
  • @Ana, pleased to know that your problem has been fixed. Feb 22, 2019 at 10:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .