9

I have inherited a .tex document from a colleague with supporting .cls file to use in preparing a course outline. The person who supplied it told me they run it with no problems. However, when I downloaded all the necessary files and pressed compile, I saw the "Undefined control sequence. \maketitle" error. I reviewed the .cls file to see if anything obvious jumped out, but I could not find the source of the error. Here is a minimal working example of the source code:

% This is an example temple for the courseoutline.cls by Norm Gall
%
% I have used every new macro and environment.
%
% If you have tutorials, add ta to the options field in \documentclass
%
% Please read the .cls for any further explanations.
%
\documentclass[11pt]{courseoutline}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{color}
%
\university{No Name University}
\department{blah blah}
%
\coursename{Water and Landscapes}
\coursenumber{blah blah}
\coursesection{(sec. 101)}
\coursesession{Fall 2017-18}
\coursetime{Mo--We--Fr 10.00--11.00hrs}
\courselocation{blah blah}
\coursewebpage{blah blah}
%
\instructor{blah blah}
\instructoroffice{rm. 127, Geography}
\instructorofficehours{We--Fr 11.00--12.00hrs}
\instructorphone{(604) 822--9105}
\instructoremail{blah blah}
%
\ta{blah blah}
\taoffice{blah blah}
\taofficehours{available during scheduled labs}
%
\tutorialtime{
    \begin{tabular}[t]{l}
        (D) Tu 10.00--11.00hrs\\
        (E) Tu 13.00--14.00hrs\\
        (F) Tu 14.00--15.00hrs\\
        (G) We 12.00--13.00hrs\\
        (H) We 13.00--14.00hrs\\
        (I) Th 11.00--12.00hrs\\
        (J) Th 12.00--13.00hrs
    \end{tabular}
}
\tutoriallocation{
    \begin{tabular}[t]{r}
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
    \end{tabular}
}
\pagestyle{myheadings}
\markright{Water and Landscapes}
\begin{document}
\maketitle
\begin{textbooks}
    \begin{itemize}

    \item Bierman and Montgomery, 2013. \textit{Key Concepts in Geomorphology} (ISBN-10: 1-4292-3860-7). MacMillan.
    %\newline 
    \texttt{PLEASE NOTE: this textbook is MANDATORY, and is not equivalent to any previously used textbooks for this course}.

    \end{itemize}
\end{textbooks}
\end{document}

The .cls file defines \university, \department, etc.

Here is the definitions block from the .cls file:

% - Main Code ------------------------------------------
%
%     some definitions 
%
\def\university#1{\gdef\@university{#1}}
\def\department#1{\gdef\@department{#1}}
\def\coursename#1{\gdef\@coursename{#1}}
\def\coursenumber#1{\gdef\@coursenumber{#1}}
\def\coursesection#1{\gdef\@coursesection{#1}}
\def\coursesession#1{\gdef\@coursesession{Session: #1}}
\def\coursetime#1{\gdef\@coursetime{Lecture Times: #1}}
\def\courselocation#1{\gdef\@courselocation{Room: #1}}
\def\coursewebpage#1{\gdef\@coursewebpage{website: #1}}
\def\texts#1{\gdef\@texts{#1}}
\def\instructor#1{\gdef\@instructor{Instructor: #1}}
\def\instructoroffice#1{\gdef\@instructoroffice{#1}}
\def\instructorofficehours#1{\gdef\@instructorofficehours{#1}}
\def\instructorphone#1{\gdef\@instructorphone{Office Phone: #1}}
\def\instructoremail#1{\gdef\@instructoremail{E-mail: #1}}
\def\ta#1{\gdef\@ta{Teaching Assistant: #1}}
\def\taoffice#1{\gdef\@taoffice{Office: #1}}
\def\taofficehours#1{\gdef\@taofficehours{Office Hours: #1}}
\def\taphone#1{\gdef\@taphone{Office Phone: #1}}
\def\taemail#1{\gdef\@taemail{E-mail: #1}}
\def\tutorialtime#1{\gdef\@tutorialtime{#1}}
\def\tutoriallocation#1{\gdef\@tutoriallocation{#1}}
%
\def\@ifdefined#1#2{\@ifundefined{#1}{}{#2}}

My question is that I cannot seem to figure out why the compiler is throwing the "Undefined control sequence. \maketitle" error. I have reviewed many postings with similar topic headings, but trying several suggested fixes did not help. Thanks. Update: The .tex file and the .cls file can be downloaded from here if that helps troubleshooting the problem:

https://www.dropbox.com/sh/n86yao7ejpbz800/AABdQXHRNqC0WfxuOER2tozqa?dl=0.

The code does create a .pdf, which appears good, but it would be nice if the source of the problem were known.

SurfProc
  • 139

1 Answers1

14

\maketitle is redefined from usual \maketitle given by the loaded class article, in the very end the \@maketitle macro redefined by courseoutline.cls -- \@maketitle requires much information to be set with various commands.

Here the compilation fails because \@taemail and \@taphone are not defined yet, the same a standard class would fail because \title has not been used.

% This is an example temple for the courseoutline.cls by Norm Gall
%
% I have used every new macro and environment.
%
% If you have tutorials, add ta to the options field in \documentclass
%
% Please read the .cls for any further explanations.
%
\documentclass[11pt]{courseoutline}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{color}
%
\university{No Name University}
\department{blah blah}
%
\coursename{Water and Landscapes}
\coursenumber{blah blah}
\coursesection{(sec. 101)}
\coursesession{Fall 2017-18}
\coursetime{Mo--We--Fr 10.00--11.00hrs}
\courselocation{blah blah}
\coursewebpage{blah blah}
%
\instructor{blah blah}
\instructoroffice{rm. 127, Geography}
\instructorofficehours{We--Fr 11.00--12.00hrs}
\instructorphone{(604) 822--9105}
\instructoremail{blah blah}
%
\ta{blah blah}
\taoffice{blah blah}
\taofficehours{available during scheduled labs}
\taemail{dontusestrangetemplate@classes.com}
\taphone{Foo}
%
\tutorialtime{
    \begin{tabular}[t]{l}
        (D) Tu 10.00--11.00hrs\\
        (E) Tu 13.00--14.00hrs\\
        (F) Tu 14.00--15.00hrs\\
        (G) We 12.00--13.00hrs\\
        (H) We 13.00--14.00hrs\\
        (I) Th 11.00--12.00hrs\\
        (J) Th 12.00--13.00hrs
    \end{tabular}
}
\tutoriallocation{
    \begin{tabular}[t]{r}
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
        rm 130\\
    \end{tabular}
}
\pagestyle{myheadings}
\markright{Water and Landscapes}
\begin{document}
\maketitle
\begin{textbooks}
    \begin{itemize}

        \item Bierman and Montgomery, 2013. \textit{Key Concepts in Geomorphology} (ISBN-10: 1-4292-3860-7). MacMillan.
        %\newline 
        \texttt{PLEASE NOTE: this textbook is MANDATORY, and is not equivalent to any previously used textbooks for this course}.

    \end{itemize}
\end{textbooks}
\end{document}

enter image description here

  • 1
    Thanks Christian Hupfer. That solved the problem. I cannot up vote your answer, but I consider this question answered. – SurfProc Oct 22 '17 at 20:45