If you get an error message like
! Undefined control sequence.
<recently read> \nmid
l.5 $\nmid
$
it usually means that you've either misspelled the control sequence, or that is spelled correctly but defined elsewhere (in some package, for example).
In your case, \nmid is defined within amssymb. You can also identify this symbol within the Comprehensive LaTeX Symbol List.
Solution: Add \usepackage{amssymb} to your preamble.
Videos
Please tell me how to get rid of it?
The mistake is, as TeX also informs. It cannot find your \text command. The error lies probably in package iopams and should be noticed there. It seems that it does not load the ams math package (only its fonts) and thus you need to explicitly include that package as well.
On a side note you should also include $ in your \text command.
Solution:
\usepackage{amsmath}
The macro \text is undefined. You need to load the amsmath package or at least amstext.
\usepackage{amsmath}
\text is defined in amstext, which is loaded by amsmath. Load the latter, because it offers many math functionality, such as aligned multi-line formulas and much more.
Hi all,
I was trying to write my math homework on Latex and I used 'Homework' template from Overleaf. However, when I compile it offline on my sublime text3. It shows
Undefined control sequence. [\end{document}]
Underfull \hbox (badness 10000) in paragraph at lines 75--76
[]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 79.
! Undefined control sequence.
\f@nch@olh ->\hwclass {} \hwlecture
\hwsection \strut
l.79 \end{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\f@nch@olh ->\hwclass {} \hwlecture \hwsection
\strut
l.79 \end{document}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.This is what shows up in the code log of my latex, and I was wondering how I can fix it and compile a pdf offline without Overleaf.
Below is the "homework" template cls file that I am using.
Thanks in advance.
\NeedsTeXFormat{LaTeX2e}
\LoadClassWithOptions{article}
\ProvidesClass{homework}[2014/12/16 Class file for homework assignments]
% ----- Options ---------------------------------------------------------------
\newcommand\@opanon{0}
\DeclareOption{anonymous}{\renewcommand\@opanon{1}}
\newcommand\@opnewpage{0}
\DeclareOption{newpage}{\renewcommand\@opnewpage{1}}
\newcommand\@oplargemargins{0}
\DeclareOption{largemargins}{\renewcommand\@oplargemargins{1}}
\ProcessOptions
% ----- Packages --------------------------------------------------------------
% Better fonts with accents
\RequirePackage[T1]{fontenc}
% Required for starred commands
\RequirePackage{suffix}
% Math symbols
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amsthm}
\RequirePackage{amssymb}
\RequirePackage{centernot}
% Nice lists
\RequirePackage{enumerate}
\RequirePackage{enumitem}
% Nice images, figures, and listings
\RequirePackage{graphicx}
\RequirePackage{grffile}
\RequirePackage[all]{xy}
\RequirePackage{wrapfig}
\RequirePackage{fancyvrb}
\RequirePackage{listings}
% Conditionals
\RequirePackage{ifthen}
% Header & Page Setup
\RequirePackage{fancyhdr}
\ifthenelse{\equal{\@oplargemargins}{1}}{}{\RequirePackage{fullpage}}
% Links
\RequirePackage{hyperref}
% ----- Questions -------------------------------------------------------------
\newcounter{questionCounter}
\newcounter{partCounter}[questionCounter]
% Prefix for questions
\newcommand{\questiontype}[0]{Question}
% Use this if your "written" questions are all under one section
% For example, if the homework handout has Section 5: Written Questions
% and all questions are 5.1, 5.2, 5.3, etc. set this to 5
% Use for 0 no prefix. Redefine as needed per-question.
\newcommand{\writtensection}[0]{0}
% Numbered question
\providecommand{\question}{}
\renewcommand{\question}[0]{%
% Emit \newpage if option `newpage` is present
\ifthenelse{\equal{\@opnewpage}{1}}{%
\newpage
}{}
% Wrap in minipage so that we don't get a line break enywhere in between
\begin{minipage}{\linewidth}%
\stepcounter{questionCounter}%
\vspace{.2in}%
\ifx\writtensection\undefined{}
\noindent{\bf \questiontype\ \arabic{questionCounter}.}%
\else
\ifnum\writtensection=0
\noindent{\bf \questiontype\ \arabic{questionCounter}.}%
\else
\noindent{\bf \questiontype\ \writtensection.\arabic{questionCounter}}%
\fi
\vspace{0.3em} \hrule \vspace{.1in}%
\end{minipage}
}
% Named question, takes one argument
\WithSuffix\providecommand\question*{}
\WithSuffix\renewcommand\question*[1]{%
% Emit \newpage if option `newpage` is present
\ifthenelse{\equal{\@opnewpage}{1}}{%
\newpage%
}{}%
% Wrap in minipage so that we don't get a line break enywhere in between
\begin{minipage}{\linewidth}%
\addtocounter{questionCounter}{1}%
\setcounter{partCounter}{0}%
\vspace{.2in}%
\noindent{\bf \arabic{questionCounter}. #1}%
\vspace{0.3em} \hrule \vspace{.1in}%
\end{minipage}
}
% Override normal section defintions
\renewcommand{\section}[0]{\question}
\WithSuffix\newcommand\section*[1]{\question*{#1}}
% ----- Question Parts --------------------------------------------------------
\newenvironment{alphaparts}[0]{%
\begin{enumerate}[label=\textbf{(\alph{partCounter})}]%
}{\end{enumerate}}
\newenvironment{arabicparts}[0]{%
\begin{enumerate}[label=\textbf{\arabic{questionCounter}.\arabic{partCounter}})]%
}{\end{enumerate}}
\newcommand{\questionpart}[0]{\stepcounter{partCounter}\item}
% ----- Induction Environment -------------------------------------------------
\newenvironment{induction}[0]{%
\begin{description}
}{\end{description}}
\newcommand{\basecase}{\item[Base Case]\mbox{}\\}
\newcommand{\indhyp}{\item[Induction Hypothesis]\mbox{}\\}
\newcommand{\indstep}{\item[Induction Step]\mbox{}\\}
% ----- Answer Box ------------------------------------------------------------
\newcommand{\answerbox}[1]{%
\begin{framed}
\vspace{#1}
\end{framed}}
% ----- Page Setup ------------------------------------------------------------
% Use block style paragraphs
\setlength{\parindent}{0pt}
\setlength{\parskip}{5pt plus 1pt}
\def\indented#1{\list{}{}\item[]}
\let\indented=\endlist
% ----- Title & Header --------------------------------------------------------
\pagestyle{empty}
\pagestyle{fancy}
%\if\@opanon%
\ifthenelse{\equal{\@opanon}{0}}{%
\renewcommand{\maketitle}[0]{%
% Setup header
\setlength{\headheight}{15.2pt}
\setlength{\headsep}{0.2in}
\lhead{\hwclass{} \hwlecture\hwsection}%
\chead{\hwname{} (\hwemail)}%
\rhead{\hwtype{} \hwnum}%
% Setup hrule in header
\renewcommand{\headrulewidth}{0pt}
\headrule{}
% Don't put header on first page
\thispagestyle{plain}
\begin{center}
{\Large \hwclass{} \hwtype{} \hwnum}
\hwname{} (\hwemail)
\today
\end{center}
\renewcommand{\headrulewidth}{0.4pt}
}
}%
{%
\renewcommand{\maketitle}[0]{%
% Make all pages plain
\pagestyle{plain}
% Put header on it's own page
\begin{center}
{\Large \hwclass{} \hwtype{} \hwnum}
\hwname{} (\hwemail)
\today
\end{center}
\renewcommand{\headrulewidth}{0.4pt}
\newpage
}
}
% ----- For usage with pandoc converted documents -----------------------------
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
% ----------------------------------------------------Yes, as u/Frogs_in_space wrote, please create a minimal working example for your problem. Chances are you'll find the error yourself and if not, we wont have to dig through this huge wall of code.
I'll take a look at the template on overleaf but I assume it works on their compiler. My first guess would be that there's a package missing.
Can you share your actual file as well? Or a MWE?
Can we see the relevant part of mscthesis.sty? My (otherwise uninformed) guess is that's where the error is -- I suspect that when it defines \makeformaltitlepages, it uses that command.
What we need is a complete example showing the problem (i.e. starting with \documentclass{...} and going through to \end{document}). Quite possibly one of your "gibberish lines" are important. (This is probably better answered somewhere like The LaTeX Community forums.)
I am working on updating my resume using a template from a colleague. When I try to build the file I get an error saying Undefined control sequence, so I have commented or removed where the errors were occurring. Even when stripping out everything of importance, the error I get is `Undefined control sequence [\end{document}]. Is there a reason this is occurring?
After removing almost all of my information, and leaving just the giving packages and formatting information, I found the problem to be the line:
\cfoot{\addressfont\itshape{Page \thepage}}
What must be changed to make this paper compile?