LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sat, 15 May 2004 14:50:21 +0200
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=us-ascii
From: Frank Mittelbach <[log in to unmask]>
Parts/Attachments: text/plain (53 lines)
\iffalse
David Kastrup writes:
 > \def\@float{...
 >   \let\@currentlabel\barf ...
 > }
 >
 > {\xdef\barf{%
 >     \csname
 >     No, read the FAQ. Really. You have to place \string\caption
 >     \space before using \string\label \space inside of a figure.
 >     \endcsname}}
 >
 > Something like that.

perhaps better ...
\fi

\documentclass{article}

\makeatletter
\def\@float#1{%
  \def\@currentlabel{\@latexerr{ref to misplaced label}{explain}}%
  \@ifnextchar[%
    {\@xfloat{#1}}%
    {\edef\reserved@a{\noexpand\@xfloat{#1}[\csname fps@#1\endcsname]}%
     \reserved@a}}

\makeatother

\begin{document}

\begin{figure} \label{foo} \end{figure}

Hallo \ref{foo}

\end{document}

 > Or does _anybody_ know of _any_ intentional use
 > of a \label _inside_ of a figure, _not_ referring to the figure but
 > to its section?

no and any env or command that would allow for labels would change
\@currentlabel anyway

 > I mean, this must be the candidate for the most frequently asked
 > question on LaTeX, ever.

well it keeps people busy

any suggestion for a good text?

frank

ATOM RSS1 RSS2