[OS X TeX] How to Insert Graphics Using TeXShop?

Gary L. Gray gray at engr.psu.edu
Mon Mar 11 23:58:23 EST 2002

On 3/11/02 2:50 AM, "Ross Moore" <ross at ics.mq.edu.au> wrote:

> Putting the \label inside the caption works, sort-of.
> It's better conceptually to put it afterwards, since the \label
> is not actually a part of the caption itself:
> \caption{Here is my figure.}\label{pulleykin}
> Also, it's better to *not* use numbering within label identifiers.
> You may later choose to re-order the sections/chapters of your document,
> or to add new figures  within existing sections,
> which would then require you to change all the labels
> and any \ref commands pointing to those \label s.
> It is *much* better to choose a descriptor that is
> associated with the contents of the figure.
> That way you can refer to it easily:
> in your mind: "that picture about pulleys and their kinematics"
> in LaTeX:  \ref{pulleykin}
>>> \end{figure}
>>> \end{document}
>>> instead of what you had. In addition, notice that the \label should go
>>> *inside* the caption to avoid potential problems with references.
> What problems do you refer to, Gary ?
> Certainly the \label must come *after* the \caption ,
> for numbering and hyperlinking to work.
> Putting it *inside* the \caption's argument is still after the \caption,
> but this means that it will be written into the .toc file,
> and be expanded when the Table-Of-Contents is constructed.
> (This is redundant, and risks errors with badly written macros.)


I wish I could find the example in which this occurred, but I have had \ref
commands give me the wrong figure number (off by one -- I don't remember in
which direction) when the \label was outside and after the \caption command.
I have never had problems when including the \label inside the \caption
command. In fact, I noticed this evening that Kopka and Daly recommend this.

-- Gary

To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.

More information about the MacOSX-TeX mailing list