Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in latex command \def ... "Undefined control sequence"

Tags:

latex

I have the following Latex code, which defines the \fmiso command with the command \def, but it seems that this definition does not work. What is wrong?

...

\usepackage{epsfig}
\usepackage{subfigure}
\usepackage{calc}
\usepackage{amssymb}
\usepackage{amstext}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{multicol}
\usepackage{pslatex}
\usepackage{apalike}
\usepackage{SCITEPRESS}    
\graphicspath{ {images/} }

\subfigtopskip=0pt
\subfigcapskip=0pt
\subfigbottomskip=0pt

\def\fmiso{\mbox{FMI-S$_O$}\xspace}
\def\fmis{\mbox{FMI-S}\xspace}


\begin{document}

...

which is the model implemented in \fmiso

...

Then I am getting the error:

Undefined control sequence... which is the model implemented in \fmiso

What am I doing wrong?

like image 465
Siqueira Avatar asked Nov 07 '25 10:11

Siqueira


1 Answers

Another case of TeX's error messages being cryptic. I'm getting this full error:

! Undefined control sequence.
\fmiso ->\mbox {FMI-S$_O$}\xspace 

l.28 wich is the model impletented in \fmiso

So (at least for me, in this minimal example), \fmiso gets expanded just fine. The "undefined control sequence" is always the last one on the line printed, in this case \xspace.

This is a bit clearer if we add another command inside the \fmiso definition, which is then shifted to the next line:

! Undefined control sequence.
\fmiso ->\mbox {FMI-S$_O$}\xspace 
                                 \TeX

I could resolve it simply by adding:

\usepackage{xspace}

Aside: in LaTeX, it's better to use LaTeX to define new commands:

\newcommand{\fmiso}{\mbox{FMI-S$_O$}\xspace}
like image 82
Thomas Avatar answered Nov 10 '25 01:11

Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!