LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Frank Mittelbach <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Sun, 16 May 2004 18:29:20 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
\iffalse

followup: here is what i would propose except that either one also has to do
this to \@dbflt or put the \@currentlabel definition into \@xfloat or perhaps
\@floatboxreset --- which of these is best really depends on how other
packages hook into the kernel float mechanism

frank

\fi

\documentclass{article}

\makeatletter
\def\@float#1{%
  \def\@currentlabel{\textbf{[bad label]}\protect\before@caption@err}%
%%   or perhaps only:        ?
  \@ifnextchar[%
    {\@xfloat{#1}}%
    {\edef\reserved@a{\noexpand\@xfloat{#1}[\csname fps@#1\endcsname]}%
     \reserved@a}}

\def\before@caption@err{\@latexerr{\noexpand\ref to misplaced
       \string\label}%
      {Labels have to follow the object that they are labeling. The
       label you\MessageBreak  are
       referencing here should be moved after the
       \noexpand\caption command.}}%
\makeatother

\begin{document}

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

Hallo \ref{foo} on page \pageref{foo}.

\end{document}

ATOM RSS1 RSS2