[comp.text.tex] Assigning Labels Manually in LaTeX

terryb.bbs@shark.cs.fau.edu (terry bohning) (05/04/91)

Is there any way to assign a number to a figure label manually in
LaTeX?  I have a picture on a separate page which I would like to 
refer to in the text using a label such as Figure~\ref{fi:fig}.  
But since it's not a LaTeX figure, I cannot use 
\caption{This Figure \label{fi:fig}}.
So I need a way to assign a number to a caption label and step the caption
label counter.   

thanx
terry

texinfo1@rusmv1.rus.uni-stuttgart.de (Rainer Schoepf) (05/06/91)

In article <gBLF21w163w@shark.cs.fau.edu> terryb.bbs@shark.cs.fau.edu (terry bohning) writes:
>
>Is there any way to assign a number to a figure label manually in
>LaTeX?  I have a picture on a separate page which I would like to 
>refer to in the text using a label such as Figure~\ref{fi:fig}.  
>But since it's not a LaTeX figure, I cannot use 
>\caption{This Figure \label{fi:fig}}.
>So I need a way to assign a number to a caption label and step the caption
>label counter.   
>
>thanx
>terry


AMS-LaTeX allows you to define your own labels. Since this is failry modular,
it should be sufficient to use the amstex style option that comes with
AMS-LaTeX.


   Dr. Rainer Sch"opf
   DANTE Koordinator f"ur Server
   Konrad-Zuse-Zentrum                       ,,Ich mag es nicht, wenn
    fuer Informationstechnik Berlin            sich die Dinge so frueh
   Heilbronner Strasse 10                      am Morgen schon so
   D-1000 Berlin 31                            dynamisch entwickeln!''
   Federal Republic of Germany
   <Schoepf@sc.ZIB-Berlin.de> oder <Schoepf@sc.ZIB-Berlin.dbp.de>

duchier@cs.yale.edu (Denys Duchier) (05/07/91)

In article <gBLF21w163w@shark.cs.fau.edu> terryb.bbs@shark.cs.fau.edu (terry bohning) writes:
 >   Is there any way to assign a number to a figure label manually in
 >   LaTeX?  I have a picture on a separate page which I would like to 
 >   refer to in the text using a label such as Figure~\ref{fi:fig}.  
 >   But since it's not a LaTeX figure, I cannot use 
 >   \caption{This Figure \label{fi:fig}}.
 >   So I need a way to assign a number to a caption label and step the caption
 >   label counter.   

Try this:

{\makeatletter
 \gdef\mylabel#1#2{{\def\@currentlabel{#1}\label{#2}}}}


Usage:		\mylabel{REFERENCE TEXT}{LABEL}

Example:	\mylabel{[Funky Picture]}{fi:fig}

--Denys

duchier@cs.yale.edu (Denys Duchier) (05/07/91)

I forgot to say: \mylabel is a general interface.  If you also want to
increment the figure counter, you should do so explicitly.

--Denys