0

I am implementing a custom document class for my PhD dissertation. In it, I have clearly defined certain commands, e.g. \maketitle (renewed command) and \makeapproval. When I try to compile my main thesis document, I receive errors saying "Undefined control sequence. \maketitle" or "Undefined... \makeapproval". However when I check the generated PDF file, everything seems to be okay, which is weird.

What's going on? How can I correct these innocuous error messages?

I'm running on Ubuntu 20.04.4 LTS. The output of pdftex --version is:

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)

Here is a minimal working example of my thesis tex file test.tex:

    \documentclass[phd,bottom,sig]{usbthesis2}
    \author{arturodonjuan}
    \title{A Dissertation Title}
    
    \begin{document}
        \maketitle %
        \makeapproval % 
    \end{document}

with the accompanying class file usbthesis2.cls:

    \NeedsTeXFormat{LaTeX2e}
    \ProvidesClass{usbthesis2}[Bing Bong thesis class]
    
    \newif\if@top
    \newif\if@sig
    
    \DeclareOption{master}{%
        \newcommand{\@work}{Thesis}%
        \newcommand{\@degree}{Master of Science}}
    \DeclareOption{phd}{%
        \newcommand{\@work}{Dissertation}%
        \newcommand{\@degree}{Doctor of Philosophy}}
    \DeclareOption{top}{\@toptrue}
    \DeclareOption{bottom}{\@topfalse}
    \DeclareOption{sig}{\@sigtrue}
    \DeclareOption{nosig}{\@sigfalse}
    \DeclareOption*{\PackageWarning{usbthesis2}{This package does not 
            recognize option: \CurrentOption}}
    %\ExecuteOptions{phd,bottom}
    \ProcessOptions\relax
    
    \LoadClass[letterpaper,12pt,oneside]{report}
    
    \RequirePackage{setspace}
    \doublespacing
    \RequirePackage{vmargin}
    \setpapersize{USletter}
    
    %\setmargins{1.5in}{1.25in}{5.5in}{8.125in}{0.125in}{0.75in}{0.125in}{0.325in}
    %\setmargins{1.5in}{1.25in}{5.5in}{8.125in}{0.125in}{0.2in}{0.125in}{0.5in}
    
    \if@top
    \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.75in}{0.125in}{0.325in}
    \else
    \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
    \fi
    
    %\renewcommand{\LARGE}{\Large}
    %\renewcommand{\huge}{\Large}
    %\renewcommand{\Huge}{\LARGE}
    %\renewcommand{\Huge}{\Large}
    
    \newcommand{\ps@prelim}{%
        \pagenumbering{roman}%
        \renewcommand{\@oddhead}{}%
        \renewcommand{\@evenhead}{}%
        \renewcommand{\@evenfoot}{\hfil\textrm{\thepage}\hfil}%
        \renewcommand{\@oddfoot}{\@evenfoot}}
    \newcommand{\ps@thesis}{%
        \pagenumbering{arabic}%
        \if@top
        \renewcommand{\@oddfoot}{}%
        \renewcommand{\@evenfoot}{}%
        \renewcommand{\@evenhead}{\hskip-0.25in \textrm{\thepage}\hfil}%
        \renewcommand{\@oddhead}{\hfil \textrm{\thepage} \hskip-0.25in}%
        \renewcommand{\ps@plain}{%
            \renewcommand{\@oddfoot}{}%
            \renewcommand{\@evenfoot}{}%
            \renewcommand{\@evenhead}{\hskip-0.25in \textrm{\thepage}\hfil}%
            \renewcommand{\@oddhead}{\hfil\textrm{\thepage} \hskip-0.25in}}
        \fi
    }
    
    \renewcommand{\month}[1]{\newcommand{\@month}{#1}}
    \renewcommand{\year}[1]{\newcommand{\@year}{#1}}
    
    \newcommand{\program}[1]{%
        \newcommand{\@program}{#1}}
    \newcommand{\director}[2]{%
        \newcommand{\@directorname}{#1}%
        \newcommand{\@directorposition}{#2}}
    \newcommand{\chairman}[2]{%
        \newcommand{\@chairmanname}{#1}%
        \newcommand{\@chairmanposition}{#2}}
    \newcommand{\fstmember}[2]{%
        \newcommand{\@fstmembername}{#1}%
        \newcommand{\@fstmemberposition}{#2}}
    \newcommand{\sndmember}[2]{%
        \newcommand{\@sndmembername}{#1}%
        \newcommand{\@sndmemberposition}{#2}}
    \newcommand{\trdmember}[2]{%
        \newcommand{\@trdmembername}{#1}%
        \newcommand{\@trdmemberposition}{#2}}
    \newcommand{\outmember}[3]{%
        \newcommand{\@outmembername}{#1}%
        \newcommand{\@outmemberposition}{#2}%
        \newcommand{\@outmemberschool}{#3}}
    \newcommand{\dean}[1]{%
        \newcommand{\@dean}{#1}}
    
    \renewcommand{\maketitle}{\begin{titlepage}%
            \if@top
            \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
            \fi
            \renewcommand{\footnotesize}{\small} %\let\footnoterule\relax
            \setcounter{page}{0}%
            \begin{center}%
                \setlength{\baselineskip}{29pt}%
                %     \vspace*{0.2in}%
                {\LARGE\textbf{\@title}}\\%
                
                \vfill 
                \setlength{\baselineskip}{14.5pt}
                %     \large
                %     [0.2in] 
                A \@work\ Presented\\%
                %     [0.2in] \vfill A \@work, Presented\\%
                [0.2in] by\\%
                [0.25in] \textbf{\large \@author} \\%
                [0.25in] to\\%
                [0.2in] The Graduate School\\%
                [0.2in] in Partial Fulfillment of the Requirements\\
                %     [0.2in] Requirements\\%
                [0.2in] for the Degree of\\%
                [0.5in] \textbf{\large \@degree}\\%
                [0.2in] in\\%
                [0.2in] \textbf{\large \@program}\\%
                [0.5in] Bing Bong University\\%
                [0.2in] \@month\ \@year%
            \end{center}%
            \par\null%
            \setcounter{footnote}{0}%
            \let\thanks\relax%
            \let\maketitle\relax%
    \end{titlepage}}
    
    \newcommand{\makeapproval}{%
        \if@top
        \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
        \fi
        \pagestyle{prelim}
        \setcounter{page}{2}%
        \begin{center}%
            \setlength{\baselineskip}{14.5pt}%
            \textbf{Bing Bong University}\\%
            [0.1in]{The Graduate School} \\%
            [0.35in] \textbf{\large \@author}%
        \end{center}%
        \vspace{0.25in}%
        {\setlength{\baselineskip}{14.5pt}%
            We, the \MakeLowercase{\@work}\ committee for the above candidate for the
            \@degree\ degree, hereby recommend acceptance of this \MakeLowercase{\@work}.\par}
        \begin{center}%
            \setlength{\baselineskip}{14.5pt}%
            
            \rule[-0.55in]{3in}{\if@sig 0.01in \else 0.00in \fi}\\
            [0.03in]\textbf{\@directorname{} -- \@work{} Advisor\\
                \@directorposition}\\%
            
            \rule[-0.55in]{3in}{\if@sig 0.01in \else 0.00in \fi}\\
            [0.03in]\textbf{\@chairmanname{} -- Chairperson of Defense\\
                \@chairmanposition}\\%
            
            \rule[-0.55in]{3in}{\if@sig 0.01in \else 0.00in \fi}\\
            [0.03in]\textbf{\@fstmembername\\
                \@fstmemberposition}\\%
            
            \rule[-0.55in]{3in}{\if@sig 0.01in \else 0.00in \fi}\\
            [0.03in]\textbf{\@outmembername\\
                \@outmemberposition\\
                \@outmemberschool}
        \end{center}%
        
        \vspace{0.2in}%
        \begin{center}%
            This \MakeLowercase{\@work}\ is accepted by the Graduate School.
            \parbox{\if@sig 3in \else 2.5in \fi}%
            {\centering%\raggedright%
                \baselineskip 14.5pt%
                \rule[-0.55in]{3in}{\if@sig 0.01in \else 0.00in \fi}\\[0.03in]
                \if@sig \else \@dean\\ \fi
                Dean of the Graduate School\\}%
        \end{center}\clearpage}
    
    \renewenvironment{abstract}{%
        \if@top
        \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
        \fi
        \begin{center}%
            \setlength{\baselineskip}{14.5pt}%
            \vspace*{0.1in}%
            {\large Abstract of the \@work}\\%
            [0.2in]{\textbf{\Large{\@title}}}\\%
            %    [0.2in]{\Huge{\@title}}\\%
            %    {\bf \sc \Huge {\@title\\}}%
            \vspace{0.2in} by \\%
            %    [0.2in]by\\%
            [0.2in]\textbf{\large \@author}\\%
            [0.3in]\textbf{\large \@degree}\\%
            [0.2in]in\\%
            [0.2in]\textbf{\large \@program}\\%
            [0.2in]{\large Bing Bong University} \\
            [0.2in]{\large \@year}\\%
            [0.2in]\if@sig {\large \@directorname} \fi %for extra abstract copy
        \end{center}%
        \par%
        \vspace{0.4in}%
        \begin{quote}}%
        {\end{quote}%
        %\par\vfil\null
        \clearpage}
    
    
    \newenvironment{dedication}{%
        \if@top
        \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
        \fi
        \thispagestyle{empty}%
        \pagestyle{empty}
        \vspace*{\fill}%
        \begin{center}}%
        {\end{center}\vspace*{\fill}\clearpage}
    
    \newenvironment{acknowledgements}{%
        \if@top
        \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
        \fi
        \clearpage%
        \phantomsection
        \addcontentsline{toc}{chapter}{\protect\numberline{}{Acknowledgements}}
        \chapter*{Acknowledgements}%
        \thispagestyle{empty}%
        \pagestyle{empty}}%
    {\clearpage}
    
    \renewenvironment{thebibliography}[1]
    {\chapter*{\bibname
            \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
        \list{\@biblabel{\@arabic\c@enumiv}}%
        {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
        \sloppy
        \clubpenalty4000
        \@clubpenalty \clubpenalty
        \widowpenalty4000%
        \sfcode`\.\@m}
    {\def\@noitemerr
        {\@latex@warning{Empty `thebibliography' environment}}%
        \endlist
        \addcontentsline{toc}{chapter}{\protect\numberline{}{\bibname
                \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}}}
    
    \renewcommand\listoffigures{%
        \if@top
        \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
        \fi
        \if@twocolumn
        \@restonecoltrue\onecolumn
        \else
        \@restonecolfalse
        \fi
        \clearpage
        \phantomsection
        \addcontentsline{toc}{chapter}{\protect\numberline{}{\listfigurename
                \@mkboth{\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}}%
        \chapter*{\listfigurename
            \@mkboth{\MakeUppercase\listfigurename}%
            {\MakeUppercase\listfigurename}}%
        \@starttoc{lof}%
        \if@restonecol\twocolumn\fi
    }
    
    \renewcommand\listoftables{%
        \if@top
        \setmarginsrb{1.5in}{1in}{1.5in}{1in}{0.125in}{0.2in}{0.125in}{0.5in}
        \fi
        \if@twocolumn
        \@restonecoltrue\onecolumn
        \else
        \@restonecolfalse
        \fi
        \clearpage
        \phantomsection
        \addcontentsline{toc}{chapter}{\protect\numberline{}{\listtablename
                \@mkboth{\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}}%
        \chapter*{\listtablename
            \@mkboth{%
                \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}%
        \@starttoc{lot}%
        \if@restonecol\twocolumn\fi
    }
5
  • @barbarabeeton What are you suggesting is the solution? First off, only \maketitle had 'renewcommand' rather than 'newcommand' because without it, I get an error message saying "Command \makefile already defined.". Second off, if I change both of them to \newcommand or both to \renewcommand, I get similar errors. Jun 30, 2022 at 23:36
  • 1
    It compiles without error for me once I add all the fields it expects/needs in addition to the author and title to typeset the title and approval pages: \program{Some program}\month{June}\year{2022}\director{Someone}{Position1}\chairman{Somebody}{Position2}\fstmember{Someone else}{Position3}\outmember{Member1}{Member2}{Member3}
    – frabjous
    Jun 30, 2022 at 23:58
  • @frabjous Thank you! That was it! In my actual situation, I had left out the \outmember. Woops. If you want to form your comment into a general answer I can accept it. Jul 1, 2022 at 0:30
  • 1
    @ArturodonJuan -- Apologies for not reading more carefully, Since what I wrote is obvious nonsense, I've deleted the comment, Jul 1, 2022 at 1:33
  • Don’t use vmargin, which is really buggy and doesn’t cooperate with TikZ, for instance. Prefer geometry.
    – egreg
    Jul 1, 2022 at 8:09

1 Answer 1

1

In the case of this particular document class, there are several commands you need to use in order to provide the information it needs in order to typeset the title page and approval page. Make sure you've added the following to your preamble:

\author{Author's Name}
\title{A Dissertation Title}
\program{Some program}
\month{June}
\year{2022}
\director{Someone}{Position1}
\chairman{Somebody}{Position2}
\fstmember{Someone else}{Position3}
\outmember{Member1}{Member2}{Member3}

There are some other fields not needed for those commands but might be needed elsewhere:

\sndmember{Someone}{Position4}
\trdmember{Someone}{Position5}
\dean{Dean's Name}

You must log in to answer this question.

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