[comp.text.tex] Problem with captions

sharp@usceast.UUCP (Harry Sharp) (09/13/90)

Greetings!

    I recently tried using the figure environment in my Master's thesis
and it solved a problem I had been having with displaying code fragments.
However, I have uncovered a most unsettling problem while trying to caption
one of my figures.
    The problem is as follows:

    I am displaying a group of #define statements and wish to caption
my figure

		#defines for GOTO labels

with the #define in emphasized type {\em}.  
	\caption{\label {\em \#define}s for GOTO labels}

First, the #, even when escaped, causes TeX grief and an error message about 
a bad \csname-\endcsname pair.  When I remove the \#, I get a message
about a \protect should not appear between \csname and \endcsname.  I
looked \csname up in the TeXBook and was properly confused by the 
non-answer there.  My local TeX guru was equally confused by the TeX error
messages.
   I really need the # in my caption, more than I need the word `define'
emphasized,  so I would greatly appreciate any ideas on how to solve that
little problem.  The emphasis thing would be nice, but is not vital.
   Any ideas?

Harry Sharp
sharp@usceast.cs.scarolina.edu
-- 
[=============================================================================]
            USMail : Dept of Mathematics, USC, Columbia, SC 29208
    E-mail : gatech!hubcap!usceast!sharp    sharp@usceast.cs.scarolina.edu
GO COCKS!	You can't lick our cocks!	University of South Carolina

piet@cs.ruu.nl (Piet van Oostrum) (09/14/90)

In article <3446@usceast.UUCP>, sharp@usceast (Harry Sharp) writes:
 |	\caption{\label {\em \#define}s for GOTO labels}
 |                     ^
The problem is that you forgot the parameter for \label. Now \label tries
to use your text as a ref name, which gives all kinds of problems with \em
in it.

Summary: use 	\caption{\label{XXX}{\em \#define}s for GOTO labels}
-- 
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31 30 531806   Uucp:   uunet!mcsun!ruuinf!piet
Telefax:   +31 30 513791   Internet:  piet@cs.ruu.nl   (*`Pete')

dougcc@csv.viccol.edu.au (Douglas Miller) (09/26/90)

In article <3446@usceast.UUCP>, sharp@usceast.UUCP (Harry Sharp) writes:
> 
>     I recently tried using the figure environment in my Master's thesis
> and it solved a problem I had been having with displaying code fragments.
> However, I have uncovered a most unsettling problem while trying to caption
> one of my figures.

> 	\caption{\label {\em \#define}s for GOTO labels}

Shouldn't this be something like:

        \caption{\label{GOTO} {\em \#define}s for GOTO labels}