# Troubleshooting some mildly convoluted code, inserting 'missing $' without good reason I'm making a template for my university for Master's/Doctorate theses, and I'm building off of what I've learned from the Thesis template in sharelatex. I'm encountering an error, though, which prevents me from compiling. I had made some changes which caused it to stop compiling, removed the errors, but it still won't do...so, can anyone tell me what I'm doing wrong? I'm pasting what I feel is relevant from the .cls and the .tex documents. The target format is page 16 and 17 of the UML style guide PDF at the link referred to here In the UMLThesis.cls (below) there's an issue using \committeemembers. Commenting out the lines allows it to compile, but I still get the error with a 'missing$' somewhere, and another error saying 'there's no line to end'. An extra pair of files (blank) are required to compile, called "lstpatch.sty" and "vector.sty". I have no idea why they're required.

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{UMLThesis}
[2007/22/02 v1.0
LaTeX document class]
\def\baseclass{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\def\@checkoptions#1#2{
\edef\@curroptions{\@ptionlist{\@currname.\@currext}}
\@tempswafalse
\@tfor\@this:=#2\do{
\@expandtwoargs\in@{,\@this,}{,\@curroptions,}
\ifin@ \@tempswatrue \@break@tfor \fi}
\let\@this\@empty
\if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
\@checkoptions{11pt}{{10pt}{11pt}{12pt}}
%\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax

\newcommand{\supervisorSig}[1]{%
\justifying
Signature of Thesis Supervisor: \xleaders\hbox{\underline{ }}\hfill\kern0pt \\
\newlength{\remaining}
\vspace{\baselineskip}
Signatures of Other Thesis Committee Members: \\}

\newcommand{\committeeMember}[1]{%
\justifying
Committee Member Signature: \xleaders\hbox{\underline{ }}\hfill\kern0pt \\
%\newlength{\remaining}
#1}

\newcommand{\prevDegree}[3]{%
#1 \uppercase{#2} \left( #3 \right)}

\newcommand\SignaturePage[6]{%
\thispagestyle{empty}
\singlespacing
\vspace*{1 in}
\uppercase{%
\centering
% Title of thesis
\large{#1} \\
\vspace{2\baselineskip} \\
%Author section, and previous degrees
\normalsize{BY \vspace{2\baselineskip} \\ \MakeUppercase{\authornames} \\ #2 \vspace{3\baselineskip} \\
submitted in partial fulfillment of the requirements \\
% degree title
for the degree of \MakeUppercase{\degreeName} \\
% department name
\MakeUppercase{\deptName} \\
\MakeUppercase{\univName}}}
\vfill
\small{%
\newlength{\authline}
\setlength{\authline}{3.75 in-\widthof{\small{Author: }}}
\newlength{\autharea}
\setlength{\autharea}{\widthof{\small{Author: }}+\authline}
\newlength{\dateline}
\setlength{\dateline}{5.75 in-\autharea-\widthof{\small{Date: }}}
%\underline{#1\hspace*{\remaining}}\par
\justifying
Signature of \\
Author: \underline{\hspace{\authline}}Date: \underline{\hspace{\dateline}}
\\
#3
\committeeMember{#4}
\committeeMember{#5}
\committeeMember{#6}}
\cleardoublepage}


\usepackage{setspace}
\usepackage{vmargin}
\doublespacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\setmarginsrb           { 1.5in}  % left margin
{ 0.6in}  % top margin
{ 1.0in}  % right margin
{ 1.0in}  % bottom margin
{   9pt}  % foot height
{ 0.3in}  % foot sep
\raggedbottom

\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace,bm}
\usepackage[centerlast,small,sc]{caption}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[scriptsize]{subfigure}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{listings}
\usepackage{lstpatch}
\usepackage{longtable}
\usepackage{tikz}
\usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib" style for the references in the Bibliography
\usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
\hypersetup{urlcolor=blue, colorlinks=true}  % Colours hyperlinks in blue, but this can be distracting if there are many links.
\usepackage{titlesec}
\usepackage{lipsum,calc,xcolor}
\usepackage{array, makecell}  % <--- changed
\setcellgapes{5pt}
\usepackage{tikz}
\usepackage{xfrac}
\newcolumntype{M}{>{$}c<{$}}
\usepackage{algorithm2e}
\renewcommand*{\algorithmautorefname}{Algorithm}
\usepackage{ragged2e}


Below is the UMLThesis.tex, error is attributed to the 4th input option to \SignaturePage

\documentclass[letterpaper, 12pt, oneside]{UMLThesis}
\begin{document}
\frontmatter      % Begin Roman style (i, ii, iii, iv...) page numbering

% Set up the Title Page
\title      {This is a formattable \\ thesis title, and seems to \\ work without error}
\authors    {My name} %call with \authorNames
\faculty    {My PI}{King professor guy} %call with \facName and \facTitle
\department {Department within College} %call with \depName
\degree     {M.S.}{Masters of Science} %call with \degreeNameShort and \degreeName
\university {University of Massachusetts Lowell} %call with \univName

\setstretch{1.3}  % It is better to have smaller font and larger line spacing than the other way round

% Define the page headers using the FancyHdr package and set up for one-sided printing
\rhead{\thepage}  % Sets the right side header to show the page number

\pagestyle{fancy}  % Finally, use the "fancy" page style to implement the FancyHdr headers

\SignaturePage{
% Input the name of the title, using '\\' as a manual linebreak
Manually labeling the \\ manually spaced \\ title page
}{
% Input your previous degrees from least to most prestigious using the \prevdegree{abbreviation}{university}{year} function as show, and '\\' as manual line breaks between each degree
\prevDegree{B.S.}{University of Massachusetts Lowell}{2014}
}{
% Create the signatures
\supervisorSig{\facName, Ph.D.} % Use this for a master's thesis
%\dissertationSig{\facName, Ph.D.} % Use this for a doctorate thesis
}{
% First committee member
\facName, Ph.D.
}{
% Second committee member
Committee member 2, Ph.D.
}{
% Third committee member
Committee member 3, Ph.D.
}
\clearpage  % Declaration ended, now start a new page
\end{document}


Ancillary questions:

1. Do I need to do that whole "\def\baseclass{book}" through "\LoadClass{\baseclass}" deal?

2. How do I make this first page not listed as "i" in the front-matter? This page is like a cover, rather than an actual first page.

3. Why does changing the '\' to '\newline' inside of the \newcommand{\SignaturePage} mess up the centering? The document has a left margin of 1.5" if that matters

• If I run your example I get ! Undefined control sequence. l.13 \setstretch – David Carlisle May 7 '18 at 19:37
• The class shows multiple errors, notably using size changes as if they have an argument, \small{Author: } for example I assume that \vspace{2\baselineskip} \\  generates a no line her to end error as you can't end a line in vertical mode – David Carlisle May 7 '18 at 19:42
• I was under the impression that size changes could be set with arguments, such that once the argument closes, the text returns to whatever size it was previously. Thus, if Author:  has a larger length than \small{Author: } this will be captured to make the line extend to the margin correctly? As for the the \vspace{2\baselineskip} \ I was just trying to make it create more than one space. I don't understand all of the technical bits of the language, but it worked and looked accurate once I typed it out. – Ronen May 7 '18 at 20:05
• I'm including all of the \usepackage{} commands to make sure we're on the same page, just in case – Ronen May 7 '18 at 20:08
• I get the feeling that I should just restart this .cls from scratch, rather than frankenstein another document into it? I think I'll give that a shot tonight. – Ronen May 7 '18 at 20:19

The errors about lstpatch and vector are due to

\usepackage{lstpatch}
\usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths


they were presumably locally available classes, but if you are not using them you should just delete those line. (In general you should delete all the packages that you are not using, which would get the class a lot closer to the base book class. Hopefully you don't use lipsum in your actual document for example.

never use \\ at the end of a paragraph (where it produces bad output and a warning about underfull hbox) or in vertical mode (where it is an error) the class has

}\par \\


where the \\ will always be in vertical mode because of \par so will give an error. Just delete the \\ there.

size commands do not take an argument so a use such as \small{Author: } the braces do not do anything and the \small will extend to the end of the document unless (as here) there is some outer environment or group that limits the scope.

\usepackage{algorithm2e}
\renewcommand*{\algorithmautorefname}{Algorithm}
\usepackage{ragged2e}

• In the segment of \uppercase{}, is there a way to prevent the \par from resetting \singlespacing? – Ronen May 8 '18 at 14:53
• \par doesn't have any effect on double or single spacing, so I do not understand the comment, sorry. – David Carlisle May 8 '18 at 15:23
• So, I'm implementing your changes one by one. I've updated \supervisorSig, I've uncommented the latter lines of my version of \committeeMember without updating to your version of it, and now visually it closely matches the official PDF version of the sample template. However, when I switched \ to \par in \SignaturePage, the lines of the title are no longer single spaced – Ronen May 8 '18 at 18:15
• @Ronen possibly set \setlength{\parskip}{0pt} in that local group? – David Carlisle May 8 '18 at 18:21
• I managed to do it using the \begin{singlespacing}...\end{singlespacing method. I inserted it into every \newcommand so that I don't have to mess with \parskip lengths anywhere. Thanks for all your help – Ronen May 8 '18 at 21:05