summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fragments/checklab.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fragments/checklab.tex
Initial commit
Diffstat (limited to 'macros/latex/contrib/fragments/checklab.tex')
-rw-r--r--macros/latex/contrib/fragments/checklab.tex41
1 files changed, 41 insertions, 0 deletions
diff --git a/macros/latex/contrib/fragments/checklab.tex b/macros/latex/contrib/fragments/checklab.tex
new file mode 100644
index 0000000000..9799a485b8
--- /dev/null
+++ b/macros/latex/contrib/fragments/checklab.tex
@@ -0,0 +1,41 @@
+ % Making those `Label(s) have changed\dots' messages more explicit
+%
+% The \LaTeX{} kernel produces the messages when something, while the
+% |.aux| file is being scanned (after the \cs{AtEndDocument} tokens
+% have been executed), sets the \cs{if@tempswa} switch with the
+% command \cs{@tempswatrue}.
+%
+% (This fact can be used by packages, such as my |footmisc.sty|, to
+% piggy-back on the message; but it's nice in that circumstance and
+% others to be sure where the message is coming from.)
+%
+% This is a jiffy patch to the kernel so that it produces a
+% (\cs{typeout}) message for each label \emph{it} thinks has changed.
+%
+% Usage: Incorporate this code into a package or class file, or
+% \input this file from a package or class file, or
+% \makeatletter \input{checklab} \makeatother in your document
+% preamble
+%
+% This software jiffy is placed in the public domain. Do with it as
+% you wish, though I have to say I would prefer you not to claim it
+% as your own (otoh, it's the product of a twisted mind, so probably
+% not an attractive thing to claim).
+%
+% Robin Fairbairns (rf10@cl.cam.ac.uk)
+% Produced in this form 1999/01/15
+%
+\def\@testdef #1#2#3{%
+ \def\reserved@a{#3}%
+ \expandafter \ifx \csname #1@#2\endcsname \reserved@a
+ \else
+ \@tempswatrue
+ \typeout{label change: #1@#2 was
+ \expandafter \ifx \csname #1@#2\endcsname \relax
+ unset
+ \else
+ \csname#1@#2\endcsname\space
+ \fi
+ now #3}%
+ \fi
+}