[Tuglist] Environment slide in pdfscreen.sty

David Kastrup tuglist@tug.org.in
12 Jun 2002 12:14:48 +0200


Manoj K N <knm@india.ti.com> writes:

> On Wed, Jun 12, 2002 at 09:59:32AM +0200, David Kastrup wrote:
> 
> > Manoj K N <knm@india.ti.com> writes:
> > 
> > > On Tue, Jun 11, 2002 at 09:29:33PM +0530, Radhakrishnan CV wrote:
> > > 
> > > > Figure environment can't be used inside slide because it is already a
> > > > minipage. However you can make use of \caption command provided you
> > > > define \@captype.
> > > > 
> > > >  \def\@captype{figure}
> > > 
> > > It did not work, but its following variant worked:
> > > 
> > > \makeatletter\newcommand{\@captype}{figure}\makeatother
> > > 
> > > What is the difference? With the first command, the following error
> > > appeared.
> > > 
> > > ! Undefined control sequence.
> > > <argument> c@\@captype 
> > >                        
> > > l.184 \caption
> > >               {Binary Symmetric Channel}\label{fig:bsc}
> > > ? 
> > 
> > The difference is the \makeatletter...\makeatother that allows making
> > @ part of command names.  That the first version does not immediately
> > give an error message does not mean a thing:  you redefine the macro
> > \@ with a mandatory argument of captype to evaluate to figure.
> > 
> > Now, when you will write
> > \@captype
> > in your text (without \makeatletter, \makeatother), it will produce
> > figure, if you type \@ followed by anything else you will get a "use
> > of \@ does not match its definition" error.
> 
> Do you mean that there is a macro \@ with a mandatory argument already
> defined in TeX, or is it my \def statement that defines it?

There is an argumentless macro \@ defined in _LaTeX_, and your \def
replaces it with a different definition with a mandatory argument.

> I removed the line \makeatletter....\makeatother and reinserted the line  
> 
> \def\@captype{figure}
> 
> in my code.

Why?  I explicitly explained why the \makeatletter was necessary, so
why do you delete it?  And why do you make just the definition again
for which I explained to you why and how it failed?

If you insist on ignoring my explanations, you might also find this
explained in the UKTUG FAQ, under the heading

\@ and @ in macro names

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David.Kastrup@t-online.de