[Tex/LaTex] Problem with defining a titlepage


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:

    ‎A‎  thesis ‎for the degree ‎of master of science by‎\\‎
‎   \begin{center}‎
    A ‎Dissertation‎ for the ‎Degree‎‎ of Doctor of ‎Philosophy ‎by\\‎
‎   \end{center}‎‎‎‎
‎‎\chapter{Chapter Name}‎
‎bla ‎bla ‎bla‎
‎bla ‎bla ‎bla‎‎

But I get an error: Undefined control sequence.l.32 \mytitle. I am wondering if anybody help me solve this problem.

Best Answer

You get this error, because you define the two versions of \mytitle inside conditionals. Both of them are false in you example, so the macro never gets defined.

You missing an \ProcessOptions which actually handles the given [phd] option, before the first use of the if's:



I assume here the code is in a class file. Please also see the clsguide for more information on how to define options.