# ! Undefined control sequences

I am sorry that my question title is not clear. I am a beginner using of latex. I copied this template from internet. After modification, I receive this error, which I can't figure out.

! Undefined control sequence.
\f@ncyoch ...hmwkClassInstructor \ \hmwkClassTime
): \hmwkTitle \strut
l.211 \]


This is my text:

\documentclass{article}

\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{tikz}
\usepackage[plain]{algorithm}
\usepackage{algpseudocode}

\usetikzlibrary{automata,positioning}

\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in

\pagestyle{fancy}
\lfoot{\lastxmark}
\cfoot{\thepage}

\renewcommand\footrulewidth{0.4pt}

\setlength\parindent{0pt}

\nobreak\extramarks{}{Problem \arabic{#1} continued on next page\ldots}\nobreak{}
\nobreak\extramarks{Problem \arabic{#1} (continued)}{Problem \arabic{#1} continued on next page\ldots}\nobreak{}
}

\nobreak\extramarks{Problem \arabic{#1} (continued)}{Problem \arabic{#1} continued on next page\ldots}\nobreak{}
\stepcounter{#1}
\nobreak\extramarks{Problem \arabic{#1}}{}\nobreak{}
}

\setcounter{secnumdepth}{0}
\newcounter{partCounter}
\newcounter{homeworkProblemCounter}
\setcounter{homeworkProblemCounter}{1}
\nobreak\extramarks{Problem \arabic{homeworkProblemCounter}}{}\nobreak{}

\newenvironment{homeworkProblem}[1][-1]{
\ifnum#1>0
\setcounter{homeworkProblemCounter}{#1}
\fi
\section{Problem \arabic{homeworkProblemCounter}}
\setcounter{partCounter}{1}
}{
}

\newcommand{\hmwkTitle}{Homework\ \#4}
\newcommand{\hmwkDueDate}{May 07, 2015}
\newcommand{\hmwkClass}{Laser Physics I}
\newcommand{\hmwkClassInstructor}{Professor Kyuman Cho}
\newcommand{\hmwkAuthorName}{Seng Sopheak}

\title{
\vspace{2in}
\textmd{\textbf{\hmwkClass:\ \hmwkTitle}}\\
\normalsize\vspace{0.1in}\small{Due\ on\ \hmwkDueDate\ at 23:59}\\
\vspace{0.1in}\large{\textit{\hmwkClassInstructor}}
\vspace{3in}
}

\author{\textbf{\hmwkAuthorName}}
\date{}

\renewcommand{\part}[1]{\textbf{\large Part \Alph{partCounter}}\stepcounter{partCounter}\\}

\newcommand{\alg}[1]{\textsc{\bfseries \footnotesize #1}}

% For derivatives
\newcommand{\deriv}[1]{\frac{\mathrm{d}}{\mathrm{d}x} (#1)}

% For partial derivatives
\newcommand{\pderiv}[2]{\frac{\partial}{\partial #1} (#2)}

% Integral dx
\newcommand{\dx}{\mathrm{d}x}

% Alias for the Solution section header
\newcommand{\solution}{\textbf{\large Solution}}

% Probability commands: Expectation, Variance, Covariance, Bias
\newcommand{\E}{\mathrm{E}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\Cov}{\mathrm{Cov}}
\newcommand{\Bias}{\mathrm{Bias}}

\begin{document}

\maketitle

\pagebreak

\begin{homeworkProblem}
\textbf{A Plano-Concave Resonator.} When mirror $1$ is planar $\left(R_1=\infty\right)$, determine the confinement condition and the depth of focus, as well as the beam width at the waist and at each of the mirrors, as a function of $\frac{d}{\left|R_2\right|}$.\\

\textbf{Solution}

\textbf{Confinement Condition}
\\
Note that:

$\begin{split} R_1&=z_1\left[z_1+\left(\frac{z_0}{z_1}\right)^2\right] \\ &=\infty \\ \Rightarrow z_1&=0 \\ z_2&=z_1+d \\&=0+d \\ &=d\\ \end{split}$
Confinement Condition:\\
$\begin{array}{r c l}\quad 0\leq&\left(1+\frac{d}{R_1}\right)\left(1+\frac{d}{R_2}\right)&\leq1\\ 0\leq&\left(1+\frac{d}{\infty}\right)\left(1+\frac{d}{\left|R_2\right|}\right)&\leq1\\ 0\leq&\left(1+\frac{d}{\left|R_2\right|}\right)&\leq1\\ \Rightarrow1\geq&\frac{d}{\left|R_2\right|}&\geq0 \end{array}$
\textbf{Depth of Focus}
\\
From\\
$\begin{split} |R_2|&=z_2\left[z_2+\left(\frac{z_0}{z_2}\right)^2\right] \\ \Rightarrow z_0^2&=z_2R_2-z_2^2 \\ &=dR_2-d^2 \\ \Rightarrow z_0&=\sqrt{dR_2-d^2} \\ \textrm{Or }2z_0&=2d\sqrt{\frac{\left|R_2\right|}{d}-1}\\ \end{split}$
\textbf{Beam Width}
\\
At the plane mirror\\
$\begin{split} W\left(z_1\right)&=W_0\sqrt{1+\left(\frac{z_1}{z_0}\right)^2} \\ &=W_0\sqrt{1+\left(\frac{\infty}{z_0}\right)^2} \\ &=W_0 \end{split}$\\
At the concave mirror\\
$\begin{split} W\left(z_2\right)&=W_0\sqrt{1+\left(\frac{z_2}{z_0}\right)^2} \\ &=W_0\sqrt{1+\left(\frac{d}{d\sqrt{\frac{R_2}{d}-1}}\right)^2} \\ &=W_0\sqrt{1+\frac{d}{R_2-d}} \end{split}$

\end{homeworkProblem}

\end{document}


I am sorry to copy too long. I don't know where the mistake if or what it is for that matter. Thank

The error message is pretty clear, \hmwkClassTime is not defined. Therefore define it or remove it.

• Thank! I couldn't have found it without you. Sorry I am a really beginner.
– TBBT
May 7 '15 at 9:30

The original template is called Structured General Purpose in the assignments section of the template site.

We can find

\newcommand{\hmwkClassTime}{10:30am} % Class/lecture time


Since this is used multiple times, empty the argument to prevent the error.

\newcommand{\hmwkClassTime}{} % Class/lecture time


It should be noted, that templates seem to be a good idea to start LaTeX, but they aren't. The LaTeX coding is mostly horrible and a very bad example and should not be used as a starting point.