2
votes

I would like to display the classic \LaTeX symbol in my documentation generated by Doxygen. According to the Doxygen documentation the default mode when using the tags \f$ [LaTeX code here] \f$ is "math mode". But in math mode I get the following error when using \f$\LaTeX\f$:

! You can't use `\spacefactor' in math mode.
\@->\spacefactor 
             \@m {}
l.5 $\LaTeX
           $
? 
! Emergency stop.
\@->\spacefactor 
                \@m {}
l.5 $\LaTeX
           $

If I try this code:

\f{tabular}{{|l|l|l|}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & \LaTeX \\
\f}

I get a nice table with the correct \LaTeX symbol. This way I guess I "broke out" of math mode?

1

1 Answers

0
votes

Yes, \LaTeX cannot be set as-is inside math mode. Instead, if you need to escape to math mode or are already in math mode due to some other reason, use

\mbox{\LaTeX}

\mbox - the shorthand version of \makebox - sets its contents in text mode.