I am writing a LaTeX 2e class with two options msc and phd for my department theses/dissertations. In this class, I need to define a titlepage for the first page of the theses/dissertations which contains the university name, the department name, the title, the author name and so on. The code is something like the following:
\documentclass[phd]{book}
\makeatletter
\newif\if@phdthesis
\@phdthesisfalse
\DeclareOption{phd}{\@phdthesistrue}
\newif\if@mscthesis
\@mscthesisfalse
\DeclareOption{msc}{\@mscthesistrue}
\def\author#1{\gdef\@author{#1}}
\if@mscthesis
\def\mytitle{\begin{titlepage}
\begin{center}
A thesis for the degree of master of science by\\
\@author
\end{center}
\end{titlepage}
}
\fi
\if@phdthesis
\def\mytitle{\begin{titlepage}
\begin{center}
A Dissertation for the Degree of Doctor of Philosophy by\\
\@author
\end{center}
\end{titlepage}
}
\fi
\makeatother
\begin{document}
\author{Vahid}
\mytitle
\chapter{Chapter Name}
bla bla bla
\newpage
bla bla bla
\end{document}
But I get an error: Undefined control sequence.l.32 \mytitle. I am wondering if anybody help me solve this problem.
<200e>in Vim and make it uncompilable for me. – Martin Scharrer♦ Feb 15 '11 at 9:46memoirclass if your university (like mine) has very odd formatting requirements. Chapter 21 of the memoir documentation is an example of doing a thesis design. You can piece enough together with thetitlesec,tocloft, and other related packages, but memoir provides most/all of their functionality in one class. – Mike Renfro Feb 15 '11 at 12:40