[OS X TeX] tabular newbie question

Samuel Lelievre samuel.lelievre at univ-rennes1.fr
Sun Nov 28 19:34:24 CET 2004


Google Kreme wrote:
>I was trying to create a nice table of the Half Life 2 cheat codes
>(the actaul document will be much longer, but I've reduced it here to
>the minimum that doesn't work:
<snip>
>TeX Shop gives me:
>
>! Missing $ inserted.
><inserted text>
>                 $
>l.9   Set Gravity & sv_
>                        gravity  \\
>?
>! Extra }, or forgotten $.
><template> \unskip \hfil }
>                           \hskip \tabcolsep \hskip 
>-.5\arrayrulewidth \vrule...
>l.10  S
>        hows FPS Rate & cl_showfps 1 \\
>?

The error you see has nothing to do with the tabular environment.
The character _ is special in TeX, it is used for subscript, and
only in math mode. So whenever TeX sees it in non-math mode, it
assumes a $ has been forgotten.

You can tell TeX to treat a special character as normal by using
the command \string. The character immediately following \string
will be considered normal.

For instance, typing
   sv\string_gravity
should get you rid of the error you had.

Hope that helps.
Samuel Lelievre
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list