• Tidak ada hasil yang ditemukan

Index of /CTAN/macros/latex/contrib/labelschanged

N/A
N/A
Protected

Academic year: 2023

Membagikan "Index of /CTAN/macros/latex/contrib/labelschanged"

Copied!
4
0
0

Teks penuh

(1)

The labelschanged package

Identifies labels which cause endless “may have changed” warnings, and also labels which are “multiply-defined”.

v1.0 — 2017/12/11

Packaged, documented, and maintained byBrian Dunn.

In the public domain.

“Label(s) may have changed.”

Several conditions can cause LATEX labels to keep changing, no matter how many times a document is recompiled.

Dynamic references: Some packages, such as varioref, generate text references which dynamically change depending on the location of each float, and these changing messages may then cause the floats themselves to move.

Margin/foot notes: References in margin or foot notes may have a similar ef- fect.

Active characters: Due to the way changing labels are detected, problems may also be caused by active characters in captions or section names.

In these circumstances, the warning LaTeX Warning:

Label(s) may have changed. Rerun to get cross-references right.

reoccurs despite multiple document re-compiles. Locating the problem labels may be difficult, as there may not be any message identifying which labels have changed.

Locating the changing labels

In the preamble of the document, place:

\usepackage{labelschanged}

Thelabelschangedpackage will print the names of the labels which changed, and their associated definitions before and after the recompile.

Label ‘xyz’ has changed:

<before/after comparisons>

(2)

Solutions

Dynamic references: variorefissues a warning if the reference text spans a page break. \fullrefor a plain\refmay be used instead.

Margin notes: See the packagesmarginfit, mparhack, marginfix, andmarginnote for possible improvements in margin note placement, which then may resolve the changing labels problem.

Footnotes: See the packages footnotehyper, footnote, and ftnright for possible improvements in footnote placement, which again may resolve the changing labels problem. Forfootmisc, try avoiding theperpageoption.

Active characters: The sectioning commands (\chapter, \section, etc.) and the \caption command all have an optional “short” argument which, if provided, is used in the table of contents and list of figures/tables instead of the regular argument.

\section[Simple heading name]{Complicated heading name}

\caption[Simple caption]{Complicated caption}

Providing a simplified caption or section heading may resolve the problem of incorrectly detecting changing labels.

memoir and breqn: Seehttps://tex.stackexchange.com/questions/331209/

warning-labels-may-have-changed-with-breqn

Multiply-defined labels

A bonus side-effect of the labelschanged packages is that multiply-defined labels are also listed at the end of the compilation. While warnings of multiply-defined labels also appear earlier in the log, listing them again at the end makes it easier to quickly identify those which are a problem.

Avoid using\label{}or\bibitem{}.

Missing references

Unfortunately, locating missing references still requires searching the log to find which are a problem.

2

(3)

References

This code is taken almost verbatim from David Carlisle’s reply to a post onTeX- LaTeX Stack Exchange:

https://tex.stackexchange.com/questions/154594/

how-to-diagnose-a-permanent-labels-may-have-changed-warning David has given permission to have this reply converted to a LATEX package, and has placed hisStack Exchangeposts the in public domain, per:

https://tex.meta.stackexchange.com/a/3332/1090

For other discussion on this topic, see:

https://tex.stackexchange.com/questions/109178/

why-does-the-compiler-keeps-telling-me-forever- to-rerun-because-labels-have-ch

3

(4)

Code

At the end of the document, the .aux file is read back while \newlabel and

\bibciteare effectively redefined as:

\def\newlabel{\@testdef r} — and —

\def\bibcite{\@testdef b}

While the.auxfile is read, each label’s new definition as given in the .auxfile is compared to its existing definition as defined byr@<label>orb@<label>.

\@testdef {hr -or- bi} {hlabeli} {hnew definitioni}

1\def\@testdef #1#2#3{%

Remember the new definition for comparison purposes:

2 \def\reserved@a{#3}%

Compare with the old definition. No action if the same.

3 \expandafter \ifx \csname #1@#2\endcsname \reserved@a \else%

If different, print a warning:

4 \typeout{^^JLabel ‘#2’ has changed:^^J%

Display the new meaning:

5 \meaning\reserved@a^^J%

Display the old meaning:

6 \expandafter\meaning\csname #1@#2\endcsname^^J}%

Remember that labels have changed:

7 \@tempswatrue%

8 \fi%

9}

Change History

v1.0

General: 2017/12/11: New pkg. . . 1

4

Referensi

Dokumen terkait

The macro now checks wether the requested abbreviation has been defined, and sets the conditional accordingly: 220\def\fk@checkfirst #1 #2{% 221

The latexcolors package ∗ Tobias Plüss 2019/01/06 Abstract Built on top of the xcolor package, the latexcolors package defines the set of colors shown on latexcolor.com, for use in

In general, documents that were written for version 0.3 will exhibit different line and page breaks when typeset using the new version of this document class.. A Document Preparation

This command takes two mandatory arguments in the following form: \lecture{Title of this lecture}{pdf_file_name} Two optional arguments can specify the range of slides that need to be

In tensor mathematics, for instance, some notations use a transponed sign at the left side of the symbol: tAij = Aji For symbols with a normal character height, this can be reached by

leftindex – left indices with better spacing v0.1β Sebastian Ørsted [email protected] August 25, 2020 The packageleftindexprovides commands for typesetting left indices.. Unlike any

[r]

102 2.19 Without line numbers in equations 103 Cras dapibus, augue quis scelerisque ultricies, felis dolor placerat sem, id porta 104 velit odio eu elit.. Aenean interdum nibh sed