# \rm control sequence undefined in custom class but works for report, how to find the problem

I am using custom class and when I use ${\rm test}$ I get complaint that it is Undefined control sequence. It does not in text mode either. I tried searching through the cls file and other relevant linked files for \rm but I can never find where it would be removed, actaully, it is used in the class as:

\newcommand\@makecopyrightpage{
\ColumnSave
\pagenumbering{roman}
\setcounter{page}{2}
%\thispagestyle{empty}
\thispagestyle{plain}
\null
\vfill
\begin{center}
%\ by \@author \\
\@author \\
\end{center}
\fi
\vfill
\ColumnRestore
}


the only other places that \rm can be found in the class:

\def\ps@headings{\def\@oddfoot{}\def\@evenfoot{}%     No feet.
\def\chaptermark##1{\markright {\uppercase{\ifnum \c@secnumdepth >\m@ne
\@chapapp\ \thechapter. \ \fi ##1}}}}

% Definition of 'myheadings' page style.
%
\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}


When i switch to \documentclass{report} everything works. How can i investigate where it got lost?

• \rm has been deprecated and not defined by default in latex since latex2e was released in 1993. report class defines it for compatibility with documents written in the 1980s but other classes may not. Mar 3 '20 at 20:35
• The \rm command has been deprecated for 25 years. Some document classes define it for back compatibility. There are classes and packages around that use \rm and siblings: it's a sure sign that they should be avoided. Mar 3 '20 at 20:36
• yes that would work but not using \rm would be better. Mar 3 '20 at 20:37
• \mathrm{zzz} in math mode but none of the uses you show in your question are in math. Mar 3 '20 at 20:40
• @Mico er no, not unless you have a very old 1980s copy of Lamport. Lamport's book is still the official documentation for 2e. Mar 3 '20 at 20:42

The syntax for roman in math in LaTeX is $\mathrm{test}$ not ${\rm test}$.
\rm has not been defined in LaTeX since LaTeX2e was released in 1993.
As described in clsguide the guide to writing latex classes that comes with latex, you could define \rm via
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}

and the report class does this, however that was over compatibility concerns with documents written in the 1980s. No documents written this century should be using \rm so for a class being written now it is better not to define \rm and assume that the document has correct markup. That way bad markup in the document is easily found and corrected.