Foggalong / edinburgh-math-latex

LaTeX templates for the University of Edinburgh's School of Mathematics
LaTeX Project Public License v1.3c
8 stars 3 forks source link

"Missing number, treated as zero" with edmaths.sty #5

Closed rdmw12 closed 3 years ago

rdmw12 commented 3 years ago

"Missing number, treated as zero." is returned as an error to the below thesis skeleton, when run with the present version of edmaths.sty

This error is not returned when I use the edmaths.sty style file available through a private link at https://teaching.maths.ed.ac.uk/main/undergraduate/studies/honours/year-5/projects/reports

I suggest the inclusion of another minimal working example, of the report class, in the bundled documents. Presently, I can only see a beamer example (which does work).

%thesis.tex 
%Model LaTeX file for Ph.D. thesis at the 
%School of Mathematics, University of Edinburgh

\documentclass[10pt,twoside,openright]{report} 

\title{Thesis title}
\author{Postgraduate Student}
\date{2009}

\usepackage[phd]{edmaths}

\begin{document}

\maketitle

\declaration

\dedication{To my ...}

\begin{abstract}
My abstract.
\end{abstract}

\tableofcontents

\chapter{First Chapter}

\section{First section}

\section{Second section}

\chapter{Second Chapter}

\appendix

\chapter{First Appendix}

\end{document}
Foggalong commented 3 years ago

@rdmw12 Huh, that's weird - I've been using this without problems. I'll have a look and see what the problem is, thanks for flagging.

Foggalong commented 3 years ago

And prize for weirdest bug of 2021 goes to.... this one!

Turns out the bug was caused by me removing the date from the \ProvidesPackage string. Even though it looks like it's just part of the description string, it's actually a required component treated as a separate argument and if it's not there nondescript errors about missing numbers and \ifnum start getting thrown elsewhere. Its full required format is

\ProvidesPackage{<name>}[YYYY/MM/DD package <name>]

so I've added the date back. Much thanks @rdmw12 for flagging this, I'd probably never have caught this on my own.