I'm attempting to venture into some more advanced LaTeX by creating a custom thesis class for my university studies, as the existing examples are somewhat outdated and not to spec with the current style guides. As an additional aspect, I added some options that allow me to somewhat change the wording of the titlepage based on whether or not I'm using the class for a personal project or a formal dissertation.

I'm running into an issue with the redefinition of \maketitle where the \end statement of the center environment is cut off and bleeds into the document at large.



\title{Construction of a Difficult, Error-Prone LaTeX Thesis Class}
\author{Not Another Author}
\degreeName{Bachelor of Science}
\majorName{Unknown Studies}
\date{August 2022}


    blah blah blah


% --------------------------------------------------------------------------- %
% Configure basic class information and options.                              %
% --------------------------------------------------------------------------- %


% --------------------------------------------------------------------------- %
% Configure basic page geometry and XeLaTeX font options.                     %
% --------------------------------------------------------------------------- %
    top    = 1.00in,
    left   = 1.25in,
    right  = 1.25in,
    bottom = 1.00in
\setmainfont{Times New Roman}
\setmonofont{Courier New}
\newcommand{\doublespace} {
\newcommand{\oneandhalfspace} {
\newcommand{\singlespace} {

% --------------------------------------------------------------------------- %
% Redefine the titlepage per the graduate school formatting manual.           %
% Add additional options and commands to allow the configuration of the       %
% titlepage as a self-study project rather than a required dissertation.      %
% --------------------------------------------------------------------------- %
\newlength{\fiveblanklines}\setlength{\fiveblanklines}{0.7 in}
\newlength{\tenblanklines}\setlength{\tenblanklines}{1.5 in}


\newcommand{\@defensemonth}{\tt$\backslash$\string defensemonth}
\newcommand{\@gradmonth}{\tt$\backslash$\string gradmonth}
\newcommand{\@gradyear}{\tt$\backslash$\string gradyear}
\newcommand{\@chair}{\tt$\backslash$\string chair}
\newcommand{\@memberOne}{\tt$\backslash$\string memberOne}
\newcommand{\@memberTwo}{\tt$\backslash$\string memberTwo}
\newcommand{\@memberThree}{\tt$\backslash$\string memberThree}
\newcommand{\@memberFour}{\tt$\backslash$\string memberFour}
\newcommand{\@degreeName}{\tt$\backslash$\string degreeName}
\newcommand{\@majorName}{\tt$\backslash$\string majorName}
\newcommand{\@paperType}{\tt$\backslash$\string paperType}

        {\MakeUppercase\@title} \\ by \\ \@author \\
            A \@paperType Presented in Partial Fulfillment \\
            of the Requirement for the Degree \\
            \@degreeName \\
            An Investigatory Project Supplementing the Studies\\
            of the \@degreeName Degree in \\
            \@majorName \\


The error occurs between lines 75-92 where \maketitle is redefined. The particular error reported by XeLaTeX is, in typical, cryptic LaTeX fashion, "\begin{center} on input line 10 ended by \end{document}". I'm not sure quite how to proceed given that the \end{center} statement can clearly be seen on line 90.

  • you are mis-using \iftoggle it is \iftoggle{name}{yes}{no} so \end is being taken as the no argument. So the latex message is pretty clear and accurate Aug 16, 2022 at 21:47
  • unrelated but don't use \makeat... in a class file, also \newcommand{\@degreeName}{\tt$\backslash$\string degreeName} all look very odd, \tt should not be used in any documnent written after 1993, but you are not scoping it so this would make the rest of the document tt. You are applying \string to d whch does nothing useful. perhaps \newcommand{\@degreeName}{\texttt{\string\degreeName}} Aug 16, 2022 at 21:53
  • @DavidCarlisle correcting the \iftoggle fixed the issue - with respect to the \newcommand declarations, I'm in the process of adapting an older class file, so those declarations are as found in the original.
    – ecfedele
    Aug 16, 2022 at 22:00

1 Answer 1


You are mis-using \iftoggle it is


so \end is being taken as the no argument. So the latex message is pretty clear and accurate in this case.

You must log in to answer this question.

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