summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/cleveref/cleveref.dtx1600
1 files changed, 1070 insertions, 530 deletions
diff --git a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
index 2b3bcd8e45f..704f114087a 100644
--- a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
+++ b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% Package 'cleveref' to use with LaTeX2e
-% Copyright 2007--2009 by Toby Cubitt
+% Copyright 2007--2010 by Toby Cubitt
%
% Written and maintained by Toby Cubitt
%
@@ -15,13 +15,13 @@
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%
-% Please send bugreports and suggestions to toby-cleveref@dr-qubit.org
+% Please send bug reports and suggestions to toby-cleveref@dr-qubit.org
% \fi
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{cleveref}
-%<package> [2009/12/11 v0.15.3 Intelligent cross-referencing]
+%<package> [2010/05/12 v0.16.2 Intelligent cross-referencing]
%
%<*driver>
\documentclass{ltxdoc}
@@ -29,7 +29,7 @@
\usepackage{url}
\usepackage{pifont} % FIXME: find nicer line-continuation symbol than \ding{229}
% \usepackage{hyperref} % breaks index
-\usepackage{cleveref}
+\usepackage[capitalise]{cleveref}
\DisableCrossrefs
\CodelineIndex
\RecordChanges
@@ -62,7 +62,7 @@
%</driver>
% \fi
%
-% \CheckSum{8133}
+% \CheckSum{8806}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -155,12 +155,28 @@
% \changes{v0.15.3}{2009/12/11}{Fixed bug in \package{varioref} support.
% Changed \option{poorman} \textbackslash{}usepackage sed substitution
% rule to use POSIX regexp syntax.}
+% \changes{v0.16}{2010/04/19}{Major changes to the low-level
+% implementation! \package{cleveref} now stores the extra information
+% it requires in its own \textbackslash{}cref@currentlabel and its own
+% parallel series of labels in the aux file, staying out of the way of
+% the standard cross-reference mechanism and \textbackslash{}ref
+% command. Also added \textbackslash{}namecref and
+% \textbackslash{}nameCref commands, fixed a serious bug in the
+% \package{amsmath} support affecting spacing of multi-line equation
+% environments, added support for footnotes, and made
+% \textbackslash{}newtheorem automatically define the singular form of
+% the cross-reference name for new theorem-like environments.}
+% \changes{v0.16.1}{2010/04/30}{Fixed bugs in \package{amsmath} spacing
+% fix and \package{amsthm} support.}
+% \changes{v0.16.2}{2010/05/12}{Fixed bugs in \textbackslash{}appendix
+% version used with \package{hyperref}, and in \textbackslash{}footnote
+% support.}
%
%
% \GetFileInfo{cleveref.sty}
%
-% \def\fileversion{0.15.3}
-% \def\filedate{11/12/2009}
+% \def\fileversion{0.16.2}
+% \def\filedate{12/05/2010}
%
% \title{The \package{cleveref} package\thanks{This document
% corresponds to \textsf{cleveref}~\fileversion, dated
@@ -172,27 +188,28 @@
%
% \begin{abstract}
% The \package{cleveref} package enhances \LaTeX{}'s cross-referencing
-% features, allowing the format of cross-references to be determined
-% automatically according to the ``type'' of cross-reference (equation,
-% section, etc.) and the context in which the cross-reference is
-% used. The formatting for each cross-reference type can be fully
-% customised in the preamble of your document. In addition,
-% \package{cleveref} can type-set cross-references to lists of multiple
-% labels, automatically formatting them according to their types,
-% sorting them, and compressing sequences of numerically consecutive
-% labels. Again, the multiple-reference formatting is fully
+% features,\linebreak[4] allowing the format of cross-references to be
+% determined automatically according to the ``type'' of cross-reference
+% (equation, section, etc.) and the context in which the
+% cross-reference is used. The formatting for each cross-reference type
+% can be fully customised in the preamble of your document. In
+% addition, \package{cleveref} can type-set cross-references to lists
+% of multiple labels, automatically formatting them according to their
+% types, sorting them, and compressing sequences of numerically
+% consecutive labels. Again, the multiple-reference formatting is fully
% customisable.
% \end{abstract}
%
% \tableofcontents
% \clearpage
%
+%
% \section{Introduction}
% When ``clever'' is used in the name of a computer program, it usually
% signifies that the programmer is overly smug about his own
% achievements! But at the heart of the \LaTeX{} philosophy is the idea
-% that it is clever to delegate as much of the typesetting as possible to
-% the computer, in order to achieve a beautiful --- and above all
+% that it is clever to delegate as much of the type-setting as possible
+% to the computer, in order to achieve a beautiful --- and above all
% consistent --- visual appearance.
%
% Both these probably apply to the \package{cleveref} package. Its goals
@@ -215,17 +232,17 @@
% things like |Eq.~(\ref{eq1})| and |Theorems~\ref{thm1} to~\ref{thm3}|
% over and over again. Tedium isn't the only downside to this. What
% happens if you later decide you want equation references to be type-set
-% as |Equation~\ref{eq1}| instead (i.e.\ without the brackets)? What
+% as |Equation~\ref{eq1}| instead (i.e.\ without the brackets)? What
% happens if you decide to change the theorem labelled |thm1| into a
% lemma? What if you move |thm3| so that it appears (and is numbered)
-% before |thm1|, so that references to both should be ordered
-% |Theorems~\ref{thm3} to~\ref{thm1}| (i.e.\ the other way around)? What
-% if you decide you prefer references to multiple theorems to be written
-% as |Theorems~\ref{thm1}--\ref{thm3}|? You have to search through the
-% entire \LaTeX{} source of your document, modifying all references to
-% equations, updating all references to |thm1|, re-ordering all
-% references to |thm1| and |thm3|, and changing the formatting of all
-% references to multiple theorems.
+% before |thm1|, so that references to the sequence of theorems 1 through
+% 3 should be ordered |Theorems~\ref{thm3} to~\ref{thm1}| (i.e.\ the
+% other way around)? What if you decide you prefer references to multiple
+% theorems to be written as |Theorems~\ref{thm1}--\ref{thm3}|? You have
+% to search through the entire \LaTeX{} source of your document,
+% modifying all references to equations, updating all references to
+% |thm1|, re-ordering all references to |thm1| and |thm3|, and changing
+% all the formatting of references to multiple theorems!
%
% The \package{cleveref} package allows you to define the format for
% cross-references once-and-for-all in the preamble of your document. If
@@ -263,14 +280,13 @@
% in which they are referenced, which can sometimes be very useful. For
% example, if you want cross-references at the beginning of a sentence
% formatted any other way than by capitalising the first letter of the
-% cross-reference text, it is impossible using
-% \package{varioref}. Perhaps even more significantly, it makes it
-% impossible to type-set multiple references automatically; you are back
-% to typing %
+% cross-reference text, it is impossible using \package{varioref}.
+% Perhaps even more significantly, it makes it impossible to type-set
+% multiple references automatically; you are back to typing
% |Eqs.~(\ref{eq1}) to~(\ref{eq3})| by hand. Not to mention missing out
% on automatic sorting and compressing of consecutive references,
-% \package{ntheorem} support, precise control over hyper-links,
-% etc. \package{cleveref} fully supports \package{varioref}, taking over
+% \package{ntheorem} support, precise control over hyper-links, etc.
+% \package{cleveref} fully supports \package{varioref}, taking over
% responsibility for type-setting cross-references, whilst retaining all
% the \package{varioref} page-referencing magic.
%
@@ -336,23 +352,15 @@
% labels: they are no longer allowed to contain commas ``,''. These are
% instead used to type-set multiple cross-references (see below).
%
-% \DescribeMacro\Cref As it is very difficult\footnote{Actually, very
-% likely impossible!} for \LaTeX{} to determine whether a
-% cross-reference appears at the beginning of a sentence or not, a
-% beginning-of-sentence variant exists: |\Cref{|\meta{label}|}|. By
-% default, this type-sets the cross-reference with the first letter
-% capitalised, and without using an abbreviation in those cases where the
-% standard variant does use one. (However, the formatting of the |\cref|
-% and |\Cref| forms can be fully and independently customised, see
-% \cref{sec:customising}.)
-%
-% \DescribeMacro\ref
-% \package{cleveref} does \emph{not} modify the standard |\ref|
-% command\footnote{This is not quite true. The original \cmd{\ref}
-% command no longer works when \package{cleveref} is loaded, so
-% \package{cleveref} redefines it to recover the original behaviour.},
-% so you can still use it to type-set the formatted label counter alone,
-% without any additional text or formatting.
+% \DescribeMacro\Cref
+% As it is very difficult\footnote{Actually, very likely impossible!} for
+% \LaTeX{} to determine whether a cross-reference appears at the
+% beginning of a sentence or not, a beginning-of-sentence variant exists:
+% |\Cref{|\meta{label}|}|. By default, this type-sets the cross-reference
+% with the first letter capitalised, and without using an abbreviation in
+% those cases where the standard variant does use one. (However, the
+% formatting of the |\cref| and |\Cref| forms can be fully and
+% independently customised, see \cref{sec:customising}.)
%
% \DescribeMacro\crefrange
% \DescribeMacro\Crefrange
@@ -384,6 +392,38 @@
% hyper-links; the starred variants prevent this, producing the same
% type-set text but without creating hyper-links.
%
+% \DescribeMacro\ref
+% \package{cleveref} does \emph{not} modify the standard |\ref| command,
+% so you can still use it to type-set the formatted label counter alone,
+% without any additional text or formatting.
+%
+% \pagebreak
+% \DescribeMacro{\namecref}
+% \DescribeMacro{\nameCref}
+% Occasinally, it's useful to produce just the name of a reference,
+% without the label itself. For example, if you want to refer to ``this
+% section'', but you're not sure whether you might later change the
+% section into a chapter, it might be useful to produce just the name
+% ``section'' associated with the section's label. If you later change
+% the section into a chapter, the text will then automatically change to
+% ``this chapter''. The |\namecref| and |\nameCref| do exactly this:
+% \begin{quote}
+% |\namecref{sec1}|
+% \end{quote}
+% is type-set as ``section'' (assuming |sec1| labels a section).
+%
+% There is a slight pitfall that you should be aware of when using the
+% \cmd{\namecref} commands. They get the reference name from the names
+% defined for the label's reference type using |\crefname| or |\Crefname|
+% (see \cref{sec:individual_customisation}). The default reference
+% formats provide these definitions. However, it is possible to customise
+% reference formats using lower-level commands that do not create
+% |\crefname| definitions (see \cref{sec:low-level_customisation}). If
+% the |\crefname| definitions are missing for a particular reference
+% type, |\namecref| and |\nameCref| will produce errors for labels of
+% that type. You can fix the error by adding explicit |\crefname|
+% definitions for these types.
+%
%
%
% \section{Sorting and Compressing}
@@ -460,7 +500,7 @@
%
% All the default cross-reference formats will then have the first letter
% capitalised, as will the automatically generated |\cref| variants (see
-% \cref{sec:individual_customisation,sec:full-control_customisation}).
+% \cref{sec:individual_customisation,sec:low-level_customisation}).
% (However, if you explicitly define a |\cref| variant to \emph{not} be
% capitalised, \package{cleveref} will still honour your definition. In
% other words, you're responsible for defining the capitalisation
@@ -468,32 +508,33 @@
%
% You should \emph{still} use the |\Cref| variants at the beginning of
% sentences, for one thing, because abbreviations should not be used at
-% the beginning of a sentence\footnote{At least in English; I'm not sure
-% about other languages.}, and for another, in case you later change
+% the beginning of a sentence,\footnote{At least in English; I'm not sure
+% about other languages.} and for another, in case you later change
% your mind and remove the \option{capitalise} option.
%
%
%
+% \pagebreak
% \section{Customising the Cross-Reference Format}
% \label{sec:customising}
% The \package{cleveref} package allows you to take full control of the
% type-setting of cross-references, by allowing the formatting to be
% customised. Defaults appropriate for English documents are provided for
-% the standard label types\footnote{For any pedantic classics scholars
+% the standard label types,\footnote{For any pedantic classics scholars
% out there: ``lemmas'' is recognised as a valid plural form of
-% ``lemma'' in all current versions of the Oxford English
-% Dictionary. ``Lemmata'' was last heard in a mathematical debate that
-% took place in a pub just around the corner from Hadrian's wall\dots a
-% few years before the Romans pulled out of Britain. \package{cleveref}
-% might have ``clever'' in its name, but even that doesn't make it
-% pretentious enough to use ``lemmata''.}, and support for German,
+% ``lemma'' in all current versions of the Oxford English Dictionary.
+% ``Lemmata'' was last heard in a mathematical debate that took place
+% in a pub just around the corner from Hadrian's wall\dots a few years
+% before the Romans pulled out of Britain. \package{cleveref} might
+% have ``clever'' in its name, but even that doesn't make it
+% pretentious enough to use ``lemmata''.} and support for German,
% French, Spanish and Italian is provided via package options (see
% \cref{sec:language_babel}). But if you don't like the defaults, or are
-% writing in a different language\footnote{Any contributions of
+% writing in a different language,\footnote{Any contributions of
% translations for missing languages are very welcome! See
% \cref{sec:code:babel} for information on how to contribute
-% translations.}, or you need to refer to something for which no
-% default format is defined, then you can take charge and define your own
+% translations.} or you need to refer to something for which no default
+% format is defined, then you can take charge and define your own
% formats.
%
% If \package{cleveref} encounters a cross-reference to a type it does
@@ -623,12 +664,12 @@
% \DescribeMacro\creflastgroupconjunction
% By default, the conjunctions used to separate sub-lists of different
% cross-reference types in a multi-reference are identical to those used
-% to separate cross-references of the same type\footnote{More accurately,
-% if you redefine $\backslash$crefpairconjunction etc.\ in your
-% preamble, $\backslash$crefpairgroupconjunction etc.\ are
+% to separate cross-references of the same type.\footnote{More
+% accurately, if you redefine $\backslash$crefpairconjunction etc.\ in
+% your preamble, $\backslash$crefpairgroupconjunction etc.\ are
% automatically redefined so that they match. (In some languages, the
% default definition of $\backslash$creflastgroupconjunction has an
-% additional comma lacking in $\backslash$creflastconjunction.)}. You
+% additional comma lacking in $\backslash$creflastconjunction.)} You
% can override this by defining the conjunction commands
% |\crefpairgroupconjunction|, |\crefmiddlegroupconjunction| and
% |\creflastgroupconjunction|.
@@ -734,8 +775,40 @@
% \end{quote}
%
%
+% \subsubsection{Automatic \textbackslash\texttt{newtheorem} Definitions}
+% \DescribeMacro\newtheorem
+% The standard \LaTeX{} |\newtheorem| command for defining new
+% theorem-like environments provides enough information to deduce a
+% reasonable cross-reference name for the new environment. So
+% \package{cleveref} automatically defines an appropriate cross-reference
+% name for new theorem-like environments. This automatic definition is
+% only used if no default definition is provided by \package{cleveref}
+% itself, and if no |\crefname| or |\Crefname| definition is given
+% explicitly (see \cref{sec:individual_customisation}).
+%
+% The caveat with this automatic definition is that, although
+% |\newtheorem| essentially provides the singular form of the
+% cross-reference name, it doesn't provide the plural form. And there is
+% no reliable way of constructing the plural form from the
+% singular.\footnote{If you're a native English-speaker, you might think
+% that just adding an `s' would work, though a moment's thought will
+% provide examples of words where this will fail. If you're a
+% non-English speaker, it probably won't even occur to you to claim
+% that plurals can reliably be constructed automatically!} Therefore,
+% if the plural form is ever required, \package{cleveref} will produce a
+% ``reference type undefined'' warning, and type-set the cross-reference
+% where the plural form is required as:
+% \begin{quote}
+% {\bf ??}~|\ref{|\meta{label}|}| \dots
+% \end{quote}
+% In this case, you will have to provide an explicit |\crefname| or
+% |\Crefname| definition yourself, to define the plural form as well as
+% the singular form.
+%
+%
+%
% \subsection{Low-Level Customisation: Taking Full Control}
-% \label{sec:full-control_customisation}
+% \label{sec:low-level_customisation}
% If you need more precise control over the cross-reference format than
% is possible by customising the individual components, then you can take
% full control of the format for any given type, overriding the
@@ -748,10 +821,10 @@
% together for sorting and/or compressing, \package{cleveref} does
% something slightly more complicated than simply checking whether the
% reference types match. In fact, it checks whether the reference
-% \emph{formats} match\footnote{To be precise, \package{cleveref} checks
-% whether the $\backslash$|crefformat|'s match.}. This will always be
-% the case for cross-references of the same type. But it could also be
-% the case for cross-references that have different types, if the
+% \emph{formats} match.\footnote{To be precise, \package{cleveref} checks
+% whether the $\backslash$|crefformat| definitions match.} This will
+% always be the case for cross-references of the same type. But it could
+% also be the case for cross-references that have different types, if the
% cross-reference formats happen to be identical.
%
% The reason for doing this is to allow cross-references to e.g.\
@@ -764,6 +837,11 @@
% sufficient for the formats to produce identical type-set text; the
% format definitions must contain identical \LaTeX{} code.)
%
+% Note that if you use the low-level customisation commands, you might
+% still want to provide |\crefname| and |\Crefname| definitions too, so
+% that the |\namecref| and |\nameCref| commands will work (see
+% \cref{sec:typesetting}).
+%
%
% \subsubsection{Single Cross-References}
% \label{sec:ref_format}
@@ -929,13 +1007,11 @@
% \label{sec:language_babel}
% \package{cleveref} supports different languages via package options, in
% the usual way, though not all languages are supported
-% yet\footnote{Currently, only \option{english}, \option{german},
-% \option{ngerman}, \option{french}, \option{spanish} and
-% \option{italian} are supported. Contributions of translations for
-% missing languages are very welcome! See \cref{sec:code:babel} for
-% information on how to contribute translations.}. The \package{babel}
-% package is also supported when it is loaded, allowing you to change
-% language using the \package{babel} language switching commands such as
+% yet.\footnote{Contributions of translations for missing languages are
+% very welcome! See \cref{sec:code:babel} for information on how to
+% contribute translations.} The \package{babel} package is also
+% supported when it is loaded, allowing you to change language using the
+% \package{babel} language switching commands such as
% \cmd{\selectlanguage} and \cmd{\foreignlanguage}.
%
% The \package{babel} support works by redefining the cross-reference
@@ -951,7 +1027,7 @@
% main one, you either have to explicitly redefine them after every
% language switching command, or hook the redefinitions into
% \package{babel}'s language switching mechanism. (See
-% \cref{sec:code:babel} and the \package{babel} documentation.)
+% \cref{sec:code:babel} and the \package{babel} package documentation.)
%
% If you have defined formats for new cross-reference types for which no
% defaults are provided, then you're on your own. \package{cleveref} will
@@ -974,6 +1050,7 @@
% macro names contain the ``@'' character, you must use
% \cmd{\makeatletter} and \cmd{\makeatother} to access them.)
%
+% \enlargethispage{\baselineskip}
% For example, if you wanted to redefine the equation format so that the
% cross-reference name (``equation'') was also part of the hyper-link,
% but you still want to be able to switch language using \package{babel},
@@ -1032,10 +1109,10 @@
%
% You can use this trick to get different cross-reference formats for
% different theorem-like environments, \emph{without} using the
-% \package{ntheorem} package\footnote{This trick seems to belong to
+% \package{ntheorem} package.\footnote{This trick seems to belong to
% \LaTeX{} mythology, and certainly isn't my own idea! But I haven't
-% been able to definitively track down who originally came up with
-% it.}. For example,
+% been able to definitively track down who originally came up with it.}
+% For example,
% \begin{quote}
% |\usepackage{aliascnt}|\\
% |\usepackage{cleveref}|\\
@@ -1100,9 +1177,9 @@
%
% Note that the \option{poorman} script cannot fully reproduce the
% type-setting of the original \package{cleveref} cross-references in all
-% cases\footnote{At least, not without resorting to inserting low-level
+% cases.\footnote{At least, not without resorting to inserting low-level
% \LaTeX{} code in your document, which would somewhat defeat the
-% purpose of the \option{poorman} option.}. In particular, any
+% purpose of the \option{poorman} option.} In particular, any
% customisation of hyper-links will be lost, and if you're using
% \package{varioref} with the \option{legacyvarioref} option (see
% \cref{sec:other_packages}, the spacing before the \cmd{\vref} command
@@ -1113,8 +1190,8 @@
% \section{Interaction with Other Packages}
% \label{sec:other_packages}
% The \package{cleveref} package \emph{must} be loaded \emph{after} all
-% other packages that don't specifically support it\footnote{At the time
-% of writing, I'm not aware of any that do.}, i.e.\ the
+% other packages that don't specifically support it,\footnote{At the time
+% of writing, I'm not aware of any that do.} i.e.\ the
% \begin{quote}
% |\usepackage{cleveref}|
% \end{quote}
@@ -1123,14 +1200,15 @@
%
% Since \package{cleveref} redefines many internal commands involved in
% \LaTeX{}'s cross-referencing system, it can interact badly with other
-% packages that do the same. The \package{fancyref} package,
-% \package{ntheorem}'s \option{thref} option, and \package{varioref}'s
-% |\labelformat| command, are incompatible with \package{cleveref}. (Note
-% that \package{varioref} \emph{is} fully supported by
-% \package{cleveref}, just that \package{cleveref}'s features supersede
-% \package{varioref}'s |\labelformat| feature.) However, since
-% \package{cleveref} implements a significantly enhanced version of these
-% packages' features, this is not really a problem.
+% packages that do the same. \package{cleveref} implements a
+% significantly enhanced version of the features found in the
+% \package{fancyref} package, \package{ntheorem}'s \option{thref} option,
+% and \package{varioref}'s |\labelformat| command. Although these
+% features may (or may not) work correctly alongside \package{cleveref},
+% there is no good reason to use these when using \package{cleveref}, and
+% their use is unsupported. (Note that \package{varioref} \emph{is} fully
+% supported by \package{cleveref}, just that \package{cleveref}'s
+% features supersede \package{varioref}'s |\labelformat| feature.)
%
% \DescribeMacro{\thref}
% \DescribeMacro{\vref}
@@ -1179,13 +1257,14 @@
% around the commands as per the original \package{varioref}
% implementation, rather than supressing hyper-links.
%
-% Other packages which alter the \LaTeX{} referencing system are unlikely
-% to work properly with \package{cleveref}. (For example, although
-% \package{cleveref} fully supports the \package{hyperref} package's
-% hyper-link features, the \option{backref} option is not currently
-% supported. Similarly, \package{cleveref} is currently incompatible with
-% the \package{memoir} class, though some versions are reported to
-% partially work.) See \cref{sec:known_bugs} for additional information.
+% \package{cleveref} should now be compatible with the \package{memoir}
+% class, as well as with the \package{titleref}, \package{nameref} and
+% \package{byname} packages, and \package{hyperref}'s \option{backref}
+% option. This support is quite new, however, so expect some niggles and
+% please report any bugs you encounter. Other packages which alter the
+% \LaTeX{} referencing system may or may not work properly with
+% \package{cleveref}. See \cref{sec:known_bugs} for additional
+% information.
%
%
%
@@ -1209,16 +1288,15 @@
% as |gather|, |align|, |multline| and |split|, which \emph{do} work
% properly with \package{cleveref}. (See
% \url{http://www.tug.org/pracjourn/2006-4/madsen/}).
-% \item \package{cleveref} currently only provides language support for
-% English, German, French, Spanish and Italian. Please contribute
-% translations for missing languages!\footnote{See
+% \item \package{cleveref} doesn't include support for all languages yet.
+% Please contribute translations for missing languages!\footnote{See
% \cref{sec:code:babel} for information on how to contribute
% translations.}
% \item \package{cleveref} can't cope with active characters being
% present in cross-reference label names. For example, if French
% \package{babel} support is loaded, the commonly used ``:'' in label
% names will often fail, spewing the usual random selection of
-% mysterious TeX errors that accompany such deep-seated errors. The
+% mysterious \TeX{} errors that accompany such deep-seated errors. The
% solution is to avoid using active characters in label names. (You may
% need to consult e.g.\ the \package{babel} documentation to discover
% which active characters are defined in your language.)
@@ -1228,24 +1306,6 @@
% cross-references into a reference range may be incorrect. Making this
% more flexible would be a simple task, but so far there doesn't seem
% to be much need for it.
-% \item \package{cleveref} breaks \package{hyperref}'s \option{backref}
-% option, and probably also the \package{backref} package when used as
-% a stand-alone package. (This should be fixed in a future version.)
-% \item \package{cleveref} is almost certainly incompatible with
-% \package{titleref}, \package{byname}, \package{nameref} and the
-% like. This shouldn't be difficult to fix, and if you want this
-% feature, then\dots patches are always welcome! (Note that
-% \package{cleveref} \emph{is} compatible with \package{hyperref},
-% despite that fact that this loads \package{nameref}
-% automatically. It's just that the \package{nameref} features won't
-% work.)
-% \item Given all the above, it's not surprising that \package{cleveref}
-% is incompatible with the \package{memoir} class, which incorporates
-% many of the above packages. There are some reports of some versions
-% of \package{cleveref} partially working with \package{memoir}, but
-% this should not be considered reliable. Compatibility with
-% \package{memoir} will become a realistic possibility once
-% compatibility with the other packages (listed above) is added.
% \item \package{cleveref} doesn't know about the \package{subfloat}
% package, so you have to revert to using \cmd{\ref} for
% cross-references to sub-figures. (This should be fixed in a future
@@ -1288,14 +1348,15 @@
% contributing the \package{amsthm} support code, and to Stefan Pinnow,
% Gonzalo Medina, Massimo Redaelli and Philip H\"olzenspies for
% contributing translations. Many people have suggested improvements or
-% reported bugs, indeed many have spent significant effort in helping to
+% reported bugs, indeed many have put significant effort into helping
% investigate and fix them. So thanks (in alphabetical order) to: Anand
-% Deopurkar, Bas Ploeger, Dan Luecking, David Gleich, Donald Arsenau,
-% Hendrik Maryns, James Sharam, Jens Mueller, Joel C. Salomon, Joris
-% Pinkse, Leo Shidai Liu, Lev Bishop, Matej Batic, Matthew Skala, Michael
-% Barber, Michael Gorven, Michal Kaut, Olivier Roy, Paul Gomme, Ricardo
-% de Aldama S\'anchez, Stefan Pinnow, Ted Pavlic, Thomas Arildsen, and
-% Uwe L\"uck for their help. (If I missed someone, please let me know!)
+% Deopurkar, Arne Meier, Bas Ploeger, Dan Luecking, David Gleich, Denis
+% Bitouz\'e, Domenic Denicola, Donald Arsenau, Hendrik Maryns, James
+% Sharam, Jens Mueller, Joel C. Salomon, Joris Pinkse, Leo Shidai Liu,
+% Lev Bishop, Matej Batic, Matthew Skala, Michael Barber, Michael Gorven,
+% Michal Kaut, Olivier Roy, Paul Gomme, Ricardo de Aldama S\'anchez,
+% Stefan Pinnow, Ted Pavlic, Thomas Arildsen, and Uwe L\"uck for their
+% help. (If I missed you out, please let me know!)
%
%
% \StopEventually{\clearpage\PrintChanges\clearpage\PrintIndex}
@@ -1312,29 +1373,50 @@
% that used by the \package{varioref} package. Namely, to redefine the
% \cmd{\refstepcounter} command so that the \cmd{\@currentlabel} macro,
% which usually just contains the type-set version of the counter, now
-% contains the additional type information. (In fact, we write three
-% extra pieces of information: the type, the counter value itself, and
-% the value of the counter that causes the label's counter to be reset,
-% which we call the ``prefix'' from now on.) \cmd{\@currentlabel}
-% eventually gets written to the aux file as an argument to
-% \cmd{\newlabel} by the usual \LaTeX{} mechanisms. This involves less
-% hacking to get everything else working again, since very few macros
-% other than \cmd{\ref} rely on this particular \cmd{\newlabel} argument
-% (nor are other packages likely to, given that \package{varioref} plays
-% around with it and is a \texttt{required} \LaTeX{} package).
+% contains the additional type information.
+%
+% However, even less invasive than \package{varioref}'s implementation is
+% to leave \cmd{\@currentlabel} alone, and define a new
+% \cmd{\cref@currentlabel} macro to hold the extra information. (In fact,
+% we store three extra pieces of information: the type, the counter value
+% itself, and the value of the counter that causes the label's counter to
+% be reset, which we call the ``prefix'' from now on.)
+% \cmd{\@currentlabel} eventually gets written to the aux file as an
+% argument to \cmd{\newlabel} by the usual \LaTeX{} label mechanisms. In
+% order to get the information in \cmd{\cref@currentlabel} into the aux
+% file, we also have to redefine the \cmd{\label} macro so that it writes
+% \emph{two} \cmd{\newlabel} lines to the aux file for \emph{each} label:
+% the standard one, plus an additional one which contains the extra
+% information in \cmd{\cref@currentlabel}. The additional \cmd{\newlabel}
+% line has the prefix |cref@| added to the label name. Thus the extra
+% information in \cmd{\cref@currentlabel} will end up in
+% \cmd{\r@cref@\meta{label}} when the aux file is re-read on the next
+% pass.
+%
+% Doing things this way involves less hacking to get everything else
+% working again, since the standard cross-reference mechanism and
+% \cmd{\ref} command are left entirely intact. \package{cleveref} can
+% then do what it likes with its own parallel set of labels, without
+% getting in the way of other packages that play around with the
+% cross-reference mechanism. The only downside is the additional memory
+% resources this uses, but on modern \TeX{} implementations this is
+% unlikely to be a problem.
%
%
% \subsection{Redefinitions of \LaTeX{} kernel macros}
% \begin{macro}{\refstepcounter}
-% \begin{macro}{\@currentlabel}
+% \begin{macro}{\cref@currentlabel}
% \begin{macro}{\cref@old@refstepcounter}
% We store the original \cmd{\refstepcounter} in
% \cmd{\cref@old@refstepcounter}, then redefine \cmd{\refstepcounter}
-% so that it first calls the old version before adding the extra
-% information to \cmd{\@currentlabel}. The new \cmd{\@refstepcounter}
-% can take an optional argument, which overrides the default ``type''
-% inferred from the counter.
-% \begin{macrocode}
+% so that it first calls the old version to define the standard
+% \cmd{\@currentlabel} macro, before defining \package{cleveref}'s
+% \cmd{\cref@currentlabel}, which contains the extra information. The
+% new \cmd{\refstepcounter} can take an optional argument, which
+% overrides the default ``type'' stored in \cmd{\cref@currentlabel},
+% which is otherwise inferred from the counter.
+% \begin{macrocode}
+\def\cref@currentlabel{}
\let\cref@old@refstepcounter\refstepcounter
\def\refstepcounter{%
\@ifnextchar[{\refstepcounter@optarg}{\refstepcounter@noarg}%]
@@ -1342,40 +1424,81 @@
\def\refstepcounter@noarg#1{%
\cref@old@refstepcounter{#1}%
\cref@constructprefix{#1}{\@result}%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[#1][\arabic{#1}][\@result]%
\csname p@#1\endcsname\csname the#1\endcsname}}
\def\refstepcounter@optarg[#1]#2{%
\cref@old@refstepcounter{#2}%
\cref@constructprefix{#2}{\@result}%
- \protected@edef\@currentlabel{%
- [#1][\arabic{#2}][\@result]\@currentlabel}}
+ \protected@edef\cref@currentlabel{%
+ [#1][\arabic{#2}][\@result]%
+ \csname p@#1\endcsname\csname the#1\endcsname}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@footnotetext}
+% \begin{macro}{\@mpfootnotetext}
+% Footnotes don't use the \cmd{\refstepcounter} mechansism, but instead
+% set \cmd{\@currentlabel} directly in \cmd{\@footnotetext} or
+% \cmd{\@mpfootnotetext}. We modifiy these to make them also set
+% \cmd{\cref@currentlabel} appropriately.
+% \begin{macrocode}
+\let\cref@old@footnotetext\@footnotetext
+\let\cref@old@mpfootnotetext\@mpfootnotetext
+\def\@footnotetext#1{%
+ \cref@constructprefix{footnote}{\@result}%
+ \protected@edef\cref@currentlabel{%
+ [footnote][\arabic{footnote}][\@result]\p@footnote\@thefnmark}%
+ \cref@old@footnotetext{#1}}
+\def\@mpfootnotetext#1{%
+ \cref@constructprefix{mpfootnote}{\@result}%
+ \protected@edef\cref@currentlabel{%
+ [footnote][\arabic{mpfootnote}][\@result]\p@footnote\@thefnmark}%
+ \cref@old@mpfootnotetext{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\label}
-% \begin{macro}{\cref@override@label@type}
-% We redefine the \cmd{\label} command to allow it to take an optional
-% argument that overrides the default reference type in
-% \cmd{\@currentlabel}. We have to postpone this redefinition of
-% \cmd{\label} until the beginning of the document because some other
-% packages do too, and we need to override their
-% redefinitions. \cmd{\cref@override@label@type} is a convenience macro
-% for overriding the label type stored in \cmd{\@currentlabel}.
+% We redefine the \cmd{\label} command to make it define \emph{two}
+% labels each time it's called: the standard one, and an additional
+% \package{cleveref}-specific one with the prefix |cref@| added to the
+% label name, which contains the extra information from
+% \cmd{cref@currentlabel}. We call the original \cmd{\label} command,
+% stored in \cmd{\cref@old@label}, to write the standard label to the
+% aux file. However, to avoid other packages messing around with the
+% content of the parallel set of \package{cleveref}-specific labels, we
+% write those directly to the aux file ourselves. We also allow
+% \cmd{\label} to take an optional argument which overrides the default
+% reference type in \cmd{\cref@currentlabel}.
+%
+% The redefinition of \cmd{\label} has to be postponed until the
+% beginning of the document because some other packages postpone their
+% own \cmd{\label} redefinitions too, and we need to override their
+% redefinitions.
% \begin{macrocode}
-\def\cref@override@label@type[#1][#2][#3]#4\@nil#5{[#5][#2][#3]#4}
\AtBeginDocument{%
\let\cref@old@label\label
- \def\label{\@ifnextchar[\label@optarg\cref@old@label}%]
- \def\label@optarg[#1]{%
- \protected@edef\@currentlabel{%
- \expandafter\cref@override@label@type\@currentlabel\@nil{#1}}%
- \cref@old@label}%
+ \def\label{\@ifnextchar[\label@optarg\label@noarg}%]
+ \def\label@noarg#1{%
+ \@bsphack%
+ \cref@old@label{#1}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{cref@#1}{{\cref@currentlabel}{\thepage}}}%
+ \@esphack}%
+ \def\label@optarg[#1]#2{%
+ \@bsphack%
+ \cref@old@label{#2}%
+ \protected@edef\cref@currentlabel{%
+ \expandafter\cref@override@label@type%
+ \cref@currentlabel\@nil{#1}}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{cref@#2}{{\cref@currentlabel}{\thepage}}}%
+ \@esphack}%
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{amsmath}
% \begin{macro}{\label}
@@ -1407,22 +1530,268 @@
\def\label@in@display@optarg[#1]#2{%
\cref@old@label@in@display{[#1]{#2}}}
\def\ltx@label#1{\cref@label#1}
- \let\cref@old@make@df@tag@@\make@df@tag@@
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
-% In order for |subequations| to be sorted properly, \package{cleveref}
-% needs to know that the |equation| counter is effectively reset by the
-% |parentequation| counter within the |subequations| environment. This
-% isn't how |amsmath| implements subequations (for obvious reasons!), but
-% we harmlessly add the |equation| counter to the |parentequation|
-% counter's reset list \emph{within} |subequations| environments, so that
-% \package{cleveref}'s sorting mechanism can figure things out. We also
-% harmlessly make sure |parentequation| is reset by the same counter as
-% |equation|.
+% \begin{macro}{\measure@}
+% \begin{macro}{\gmeasure@}
+% \begin{macro}{\multline@}
+% The \package{amsmath} multi-line equation environments scan their
+% bodies twice: once to measure, once to type-set. In the measure
+% phase, the \cmd{\label} command is disabled by letting it to
+% \cmd{\@gobble}. Unfortunately, this won't gobble all the arguments if
+% an optional argument is supplied to \cmd{\label}, so we have to
+% modify the \package{amsmath} measuring commands so that they let
+% \cmd{\label} to \cmd{\@gobble@optarg} instead.
+%
+% Unfortunately, \package{amsmath} wasn't designed with redefinitions
+% of \cmd{\label} in mind, so there appears to be no safe way of doing
+% this other than copying the \package{amsmath} definitions and making
+% the modification directly in the macro's code. This is a recipe for
+% future chaos if these commands are ever modified in a new version of
+% \package{amsmath}, but it seems we have no choice. Luckily,
+% \package{amsmath} isn't updated too often!
+% \begin{macrocode}
+\def\measure@#1{%
+ \begingroup
+ \measuring@true
+ \global\eqnshift@\z@
+ \global\alignsep@\z@
+ \global\let\tag@lengths\@empty
+ \global\let\field@lengths\@empty
+ \savecounters@
+ \global\setbox0\vbox{%
+ \let\math@cr@@@\math@cr@@@align@measure
+ \everycr{\noalign{\global\tag@false
+ \global\let\raise@tag\@empty \global\column@\z@}}%
+ \let\label\@gobble@optarg% <<< cleveref modification
+ \global\row@\z@
+ \tabskip\z@
+ \halign{\span\align@preamble\crcr
+ #1%
+ \math@cr@@@
+ \global\column@\z@
+ \add@amps\maxfields@\cr
+ }%
+ }%
+ \restorecounters@
+ \ifodd\maxfields@
+ \global\advance\maxfields@\@ne
+ \fi
+ \ifnum\xatlevel@=\tw@
+ \ifnum\maxfields@<\thr@@
+ \let\xatlevel@\z@
+ \fi
+ \fi
+ \setbox\z@\vbox{%
+ \unvbox\z@ \unpenalty \global\setbox\@ne\lastbox
+ }%
+ \global\totwidth@\wd\@ne
+ \if@fleqn \global\advance\totwidth@\@mathmargin \fi
+ \global\let\maxcolumn@widths\@empty
+ \begingroup
+ \let\or\relax
+ \loop
+ \global\setbox\@ne\hbox{%
+ \unhbox\@ne \unskip \global\setbox\thr@@\lastbox
+ }%
+ \ifhbox\thr@@
+ \xdef\maxcolumn@widths{ \or \the\wd\thr@@ \maxcolumn@widths}%
+ \repeat
+ \endgroup
+ \dimen@\displaywidth
+ \advance\dimen@-\totwidth@
+ \ifcase\xatlevel@
+ \global\alignsep@\z@
+ \let\minalignsep\z@
+ \@tempcntb\z@
+ \if@fleqn
+ \@tempcnta\@ne
+ \global\eqnshift@\@mathmargin
+ \else
+ \@tempcnta\tw@
+ \global\eqnshift@\dimen@
+ \global\divide\eqnshift@\@tempcnta
+ \fi
+ \or
+ \@tempcntb\maxfields@
+ \divide\@tempcntb\tw@
+ \@tempcnta\@tempcntb
+ \advance\@tempcntb\m@ne
+ \if@fleqn
+ \global\eqnshift@\@mathmargin
+ \global\alignsep@\dimen@
+ \global\divide\alignsep@\@tempcnta
+ \else
+ \global\advance\@tempcnta\@ne
+ \global\eqnshift@\dimen@
+ \global\divide\eqnshift@\@tempcnta
+ \global\alignsep@\eqnshift@
+ \fi
+ \or
+ \@tempcntb\maxfields@
+ \divide\@tempcntb\tw@
+ \global\advance\@tempcntb\m@ne
+ \global\@tempcnta\@tempcntb
+ \global\eqnshift@\z@
+ \global\alignsep@\dimen@
+ \if@fleqn
+ \global\advance\alignsep@\@mathmargin\relax
+ \fi
+ \global\divide\alignsep@\@tempcntb
+ \fi
+ \ifdim\alignsep@<\minalignsep\relax
+ \global\alignsep@\minalignsep\relax
+ \ifdim\eqnshift@>\z@
+ \if@fleqn\else
+ \global\eqnshift@\displaywidth
+ \global\advance\eqnshift@-\totwidth@
+ \global\advance\eqnshift@-\@tempcntb\alignsep@
+ \global\divide\eqnshift@\tw@
+ \fi
+ \fi
+ \fi
+ \ifdim\eqnshift@<\z@
+ \global\eqnshift@\z@
+ \fi
+ \calc@shift@align
+ \global\tagshift@\totwidth@
+ \global\advance\tagshift@\@tempcntb\alignsep@
+ \if@fleqn
+ \ifnum\xatlevel@=\tw@
+ \global\advance\tagshift@-\@mathmargin\relax
+ \fi
+ \else
+ \global\advance\tagshift@\eqnshift@
+ \fi
+ \iftagsleft@ \else
+ \global\advance\tagshift@-\displaywidth
+ \fi
+ \dimen@\minalignsep\relax
+ \global\advance\totwidth@\@tempcntb\dimen@
+ \ifdim\totwidth@>\displaywidth
+ \global\let\displaywidth@\totwidth@
+ \else
+ \global\let\displaywidth@\displaywidth
+ \fi
+ \endgroup
+}
+\def\gmeasure@#1{%
+ \begingroup
+ \measuring@true
+ \totwidth@\z@
+ \global\let\tag@lengths\@empty
+ \savecounters@
+ \setbox\@ne\vbox{%
+ \everycr{\noalign{\global\tag@false
+ \global\let\raise@tag\@empty \global\column@\z@}}%
+ \let\label\@gobble% <<< cleveref modification
+ \halign{%
+ \setboxz@h{$\m@th\displaystyle{##}$}%
+ \ifdim\wdz@>\totwidth@
+ \global\totwidth@\wdz@
+ \fi
+ &\setboxz@h{\strut@{##}}%
+ \savetaglength@
+ \crcr
+ #1%
+ \math@cr@@@
+ }%
+ }%
+ \restorecounters@
+ \if@fleqn
+ \global\advance\totwidth@\@mathmargin
+ \fi
+ \iftagsleft@
+ \ifdim\totwidth@>\displaywidth
+ \global\let\gdisplaywidth@\totwidth@
+ \else
+ \global\let\gdisplaywidth@\displaywidth
+ \fi
+ \fi
+ \endgroup
+}
+\def\multline@#1{%
+ \Let@
+ \@display@init{\global\advance\row@\@ne \global\dspbrk@lvl\m@ne}%
+ \chardef\dspbrk@context\z@
+ \restore@math@cr
+ \let\tag\tag@in@align
+ \global\tag@false \global\let\raise@tag\@empty
+ \mmeasure@{#1}%
+ \let\tag\gobble@tag \let\label\@gobble% <<< cleveref modification
+ \tabskip \if@fleqn \@mathmargin \else \z@skip \fi
+ \totwidth@\displaywidth
+ \if@fleqn
+ \advance\totwidth@-\@mathmargin
+ \fi
+ \halign\bgroup
+ \hbox to\totwidth@{%
+ \if@fleqn
+ \hskip \@centering \relax
+ \else
+ \hfil
+ \fi
+ \strut@
+ $\m@th\displaystyle{}##\endmultline@math
+ \hfil
+ }% $
+ \crcr
+ \if@fleqn
+ \hskip-\@mathmargin
+ \def\multline@indent{\hskip\@mathmargin}% put it back
+ \else
+ \hfilneg
+ \def\multline@indent{\hskip\multlinegap}%
+ \fi
+ \iftagsleft@
+ \iftag@
+ \begingroup
+ \ifshifttag@
+ \rlap{\vbox{%
+ \normalbaselines
+ \hbox{%
+ \strut@
+ \make@display@tag
+ }%
+ \vbox to\lineht@{}%
+ \raise@tag
+ }}%
+ \multline@indent
+ \else
+ \setbox\z@\hbox{\make@display@tag}%
+ \dimen@\@mathmargin \advance\dimen@-\wd\z@
+ \ifdim\dimen@<\multlinetaggap
+ \dimen@\multlinetaggap
+ \fi
+ \box\z@ \hskip\dimen@\relax
+ \fi
+ \endgroup
+ \else
+ \multline@indent
+ \fi
+ \else
+ \multline@indent
+ \fi
+ #1%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{subequations}
+% In order for |subequations| to be sorted properly, \package{cleveref}
+% needs to know that the |equation| counter is effectively reset by the
+% |parentequation| counter within the |subequations| environment. This
+% isn't how |amsmath| implements subequations (for obvious reasons!),
+% but we harmlessly add the |equation| counter to the |parentequation|
+% counter's reset list \emph{within} |subequations| environments, so
+% that \package{cleveref}'s sorting mechanism can figure things out. We
+% also harmlessly make sure |parentequation| is reset by the same
+% counter as |equation|.
% \begin{macrocode}
\let\cref@old@subequations\subequations%
\let\cref@old@endsubequations\endsubequations%
@@ -1448,43 +1817,17 @@
% \begin{macrocode}
\def\make@df@tag@@#1{%
\gdef\df@tag{\maketag@@@{#1}%
- \def\@currentlabel{[equation][][]#1}}}
+ \def\cref@currentlabel{[equation][][]#1}}}
\def\make@df@tag@@@#1{%
\gdef\df@tag{\tagform@{#1}%
\toks@\@xp{\p@equation{#1}}%
- \edef\@currentlabel{[equation][][]\the\toks@}}}
- }{}%
-}
+ \edef\cref@currentlabel{[equation][][]\the\toks@}}}
+ }{}% end of \@ifpackageloaded{amsmath}
+}% end of AtBeginDocument
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\ref}
-% The standard \cmd{\ref} macro spits out whatever was in
-% \cmd{\@currentlabel} when the label was written to the aux file, but
-% this now contains additional information which we don't
-% want. Therefore, we redefine \cmd{\ref} to recover the original
-% behaviour. We have to defer redefinition of \cmd{\ref} till the
-% beginning of the document, in case other packages (such as
-% \package{ntheorem}) modify it after \package{cleveref} is loaded. The
-% apparently pointless \cmd{\cref@reflabel} adds a leyer of indirection
-% to make it easier in case we need to redefine it for
-% \package{hyperref} later.
-% \begin{macrocode}
-\def\cref@reflabel#1#2{\@result}
-\AtBeginDocument{%
- \DeclareRobustCommand{\ref}{\cref@ref}
- \def\cref@ref#1{%
- \expandafter\ifx\csname r@#1\endcsname\relax%
- \let\@result\relax%
- \else%
- \cref@getlabel{#1}{\@result}%
- \fi%
- \expandafter\@setref\csname r@#1\endcsname{\cref@reflabel}{#1}}%
-}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\appendix}
% \begin{macro}{\cref@old@appendix}
% The \cmd{\appendix} command causes the top-level sectioning commands
@@ -1521,24 +1864,27 @@
\def\@tmpa{##1}%
\def\@tmpb{section}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
- [appendix][\arabic{##1}][\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [appendix][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
- [subappendix][\arabic{##1}][\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [subappendix][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsubsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subsubappendix][\arabic{##1}][\@result]%
- \@currentlabel}%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \protected@edef\@currentlabel{%
- [##1][\arabic{##1}][\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [##1][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\fi%
\fi%
\fi}%
@@ -1561,31 +1907,34 @@
\def\@tmpa{##1}%
\def\@tmpb{chapter}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
- [appendix][\arabic{##1}][\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [appendix][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{section}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
- [subappendix][\arabic{##1}][\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [subappendix][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subsubappendix][\arabic{##1}][\@result]%
- \@currentlabel}%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsubsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
- [subsubsubappendix][\arabic{##1}]%
- [\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [subsubsubappendix][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \protected@edef\@currentlabel{%
- [##1][\arabic{##1}][\@result]\@currentlabel}%
+ \protected@edef\cref@currentlabel{%
+ [##1][\arabic{##1}][\@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
\fi%
\fi%
\fi%
@@ -1599,14 +1948,26 @@
%
% \subsection{Utility Macros}
%
+% \subsubsection{miscelaneous}
+% \begin{macro}{\@gobble@optarg}
+% A basic macro that gobbles one argument plus, if present, one
+% optional argument.
+% \begin{macrocode}
+\def\@gobble@optarg{\@ifnextchar[\@@gobble@optarg\@gobble@orig}%]
+\def\@gobble@orig#1{}
+\def\@@gobble@optarg[#1]#2{}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \subsubsection{aux file information}
% \begin{macro}{\cref@getlabel}
% \begin{macro}{\cref@gettype}
% \begin{macro}{\cref@getcounter}
% \begin{macro}{\cref@getprefix}
% Define some utility macros for extracting label, type, and counter
-% information from the contents of \cmd{\@currentlabel}, as written to
-% the aux file and stored in \cmd{\r@\meta{label}} when this is re-read
+% information from the contents of \cmd{\cref@currentlabel}, as written to
+% the aux file and stored in \cmd{\r@cref@\meta{label}} when this is re-read
% on the next pass. Some other packages commandeer the referencing
% system to write label information to the aux file for other purposes,
% and probably use \cmd{\ref} to recover it later. We still want them
@@ -1620,7 +1981,7 @@
% \cmd{\csname}\ldots\cmd{\endcsname}.
% \begin{macrocode}
\def\cref@getlabel#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
+ \expandafter\let\expandafter\@tmpa\csname r@cref@#1\endcsname%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tmpa%
\expandafter\expandafter\expandafter{%
@@ -1630,7 +1991,7 @@
\@@cref@getlabel{\@@cref@getlabel[][][]}}
\def\@@cref@getlabel[#1][#2][#3]#4\@nil#5{\def#5{#4}}
\def\cref@gettype#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
+ \expandafter\let\expandafter\@tmpa\csname r@cref@#1\endcsname%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tmpa%
\expandafter\expandafter\expandafter{%
@@ -1640,7 +2001,7 @@
\@@cref@gettype{\@@cref@gettype[][][]}}
\def\@@cref@gettype[#1][#2][#3]#4\@nil#5{\def#5{#1}}
\def\cref@getcounter#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
+ \expandafter\let\expandafter\@tmpa\csname r@cref@#1\endcsname%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tmpa%
\expandafter\expandafter\expandafter{%
@@ -1650,7 +2011,7 @@
\@@cref@getcounter{\@@cref@getcounter[][][]}}
\def\@@cref@getcounter[#1][#2][#3]#4\@nil#5{\def#5{#2}}
\def\cref@getprefix#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
+ \expandafter\let\expandafter\@tmpa\csname r@cref@#1\endcsname%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tmpa%
\expandafter\expandafter\expandafter{%
@@ -1665,9 +2026,17 @@
% \end{macro}
% \end{macro}
%
+% \cmd{\cref@override@label@type} is a convenience macro for overriding
+% the label type stored in \cmd{\cref@currentlabel}.
+% \begin{macro}{\cref@override@label@type}
+% \begin{macrocode}
+\def\cref@override@label@type[#1][#2][#3]#4\@nil#5{[#5][#2][#3]#4}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\cref@constructprefix}
% The \cmd{\cref@constructprefix} macro constructs the prefix
-% information stored in \cmd{\@currentlabel} (retrieved using
+% information stored in \cmd{\cref@currentlabel} (retrieved using
% \cmd{\cref@getprefix}). This information consists of the numerical
% value of each counter that's involved in resetting the label's
% counter, i.e.\ it contains the numerical values of the chapter,
@@ -1675,8 +2044,8 @@
% formatted label produced by \cmd{\the\meta{counter}}. E.g. if
% \cmd{\theequation} produces ``B.1.3'', this utility macro will return
% ``2,1'' (the ``3'' corresponds to the equation number itself, which
-% is stored separately in \cmd{\@currentlabel}). The first argument is
-% the counter in question; the return value is stored in the second
+% is stored separately in \cmd{\cref@currentlabel}). The first argument
+% is the counter in question; the return value is stored in the second
% argument, which should be a macro name.
%
% The real work is done by the recursive \cmd{\@cref@constructprefix}
@@ -1958,10 +2327,10 @@
% \end{macrocode}
% Conversely, undefined references come after everything else.
% \begin{macrocode}
- \expandafter\ifx\csname r@#1\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#1\endcsname\relax%
\def\@result{2}%
\else%
- \expandafter\ifx\csname r@#2\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#2\endcsname\relax%
\def\@result{1}%
\else%
% \end{macrocode}
@@ -2090,7 +2459,7 @@
%
% FIXME: We could easily remove the hard-coded search order in
% \cmd{\cref@resetby} and, say, replace it with a customisable list of
-% counters to search in order. But so far I've yet to encounter a need
+% counters to search in order. But, so far, I've yet to encounter a need
% for anything other than the hard-coded default.
% \begin{macrocode}
\def\cref@resetby#1#2{%
@@ -2235,7 +2604,7 @@
% Define a new conditional to test whether two references are
% consecutive (needed when type-setting reference ranges). This uses the
% counter and prefix (i.e. formatted version of the counter that resets
-% the label's counter) information provided by \cmd{\r@\meta{label}}
+% the label's counter) information provided by \cmd{\r@cref@\meta{label}}
% (via the aux file) to check if the prefices are identical (i.e. the
% references come from the same chapter, section or whatever), and that
% the label counters differ by 0 or 1.
@@ -2278,7 +2647,7 @@
% \begin{macrocode}
\def\cref@processgroup#1#2{%
\edef\@nextref{\cref@stack@top{#1}}%
- \expandafter\ifx\csname r@\@nextref\endcsname\relax%
+ \expandafter\ifx\csname r@cref@\@nextref\endcsname\relax%
\def\@grouptype{\@undefined}%
\def\@groupformat{\@undefined}%
\else%
@@ -2305,7 +2674,7 @@
\let\@nexttype\@grouptype%
\let\@nextforamt\@groupformat%
\else%
- \expandafter\ifx\csname r@\@nextref\endcsname\relax%
+ \expandafter\ifx\csname r@cref@\@nextref\endcsname\relax%
\def\@nexttype{\@undefined}%
\def\@nextformat{\@undefined}%
\else%
@@ -2337,7 +2706,7 @@
\def\cref@processgroupall#1#2{%
\cref@stack@init{\@tmpstack}%
\edef\@nextref{\cref@stack@top{#1}}%
- \expandafter\ifx\csname r@\@nextref\endcsname\relax%
+ \expandafter\ifx\csname r@cref@\@nextref\endcsname\relax%
\def\@grouptype{\@undefined}%
\def\@groupformat{\@undefined}%
\else%
@@ -2363,7 +2732,7 @@
\let\@nextformat\relax%
\fi%
\else%
- \expandafter\ifx\csname r@\@nextref\endcsname\relax%
+ \expandafter\ifx\csname r@cref@\@nextref\endcsname\relax%
\def\@nexttype{\@undefined}%
\def\@nextformat{\@undefined}%
\else%
@@ -2422,7 +2791,7 @@
\let#3\relax%
\edef\@nextref{\cref@stack@top{#1}}%
#4=1\relax%
- \expandafter\ifx\csname r@#2\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#2\endcsname\relax%
\@cref@refconsecutivefalse%
\else%
% \end{macrocode}
@@ -2445,7 +2814,7 @@
% Otherwise, test whether next reference is consecutive or not.
% \begin{macrocode}
\else%
- \expandafter\ifx\csname r@\@nextref\endcsname\relax%
+ \expandafter\ifx\csname r@cref@\@nextref\endcsname\relax%
\@cref@refconsecutivefalse%
\else%
\edef\@tmpa{{#2}{\@nextref}}%
@@ -2484,7 +2853,7 @@
% Otherwise, test whether next reference is consecutive or not.
% \begin{macrocode}
\else%
- \expandafter\ifx\csname r@\@nextref\endcsname\relax%
+ \expandafter\ifx\csname r@cref@\@nextref\endcsname\relax%
\@cref@refconsecutivefalse%
\else%
\edef\@tmpa{{#3}{\@nextref}}%
@@ -2498,7 +2867,7 @@
%
%
%
-% \subsection{Referencing Commands}
+% \subsection{Cross-Referencing Commands}
% \begin{macro}{\cref}
% \begin{macro}{\Cref}
% \begin{macro}{\crefrange}
@@ -2524,9 +2893,9 @@
% loaded, so we only define it in those cases.\footnote{In fact, the
% flag isn't needed when only \package{varioref} is loaded and the
% \option{legacyvarioref} is set, \emph{unless} the \option{poorman}
-% option is also set. However, avoid the redundant \textbackslash{}if
-% in these cases doesn't seem worth the significantly more
-% complicated code that would be required.}
+% option is also set. However, avoiding the redundant
+% \textbackslash{}if in these cases doesn't seem worth the
+% significantly more complicated code that would be required.}
% \begin{macrocode}
\@ifpackageloaded{hyperref}{\newif\if@crefstarred}{%
\@ifpackageloaded{varioref}{\newif\if@crefstarred}{}}
@@ -2739,7 +3108,7 @@
% macro defined by \cmd{\crefformat} etc.
% \begin{macrocode}
\def\@setcref#1#2#3{%
- \expandafter\ifx\csname r@#1\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#1\endcsname\relax%
\protect\G@refundefinedtrue%
\nfss@text{\reset@font\bfseries ??}%
\@latex@warning{Reference `#1' on page \thepage \space undefined}%
@@ -2783,11 +3152,11 @@
% \end{macrocode}
% Check if both references are defined.
% \begin{macrocode}
- \expandafter\ifx\csname r@#1\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#1\endcsname\relax%
\protect\G@refundefinedtrue%
\@latex@warning{Reference `#1' on page \thepage \space%
undefined}%
- \expandafter\ifx\csname r@#2\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#2\endcsname\relax%
\nfss@text{\reset@font\bfseries ??}--%
\nfss@text{\reset@font\bfseries ??}%
\@latex@warning{Reference `#2' on page \thepage \space%
@@ -2797,7 +3166,7 @@
\nfss@text{\reset@font\bfseries ??}--\@labelb%
\fi%
\else%
- \expandafter\ifx\csname r@#2\endcsname\relax%
+ \expandafter\ifx\csname r@cref@#2\endcsname\relax%
\protect\G@refundefinedtrue%
\cref@getlabel{#1}{\@labela}%
\@labela--\nfss@text{\reset@font\bfseries ??}%
@@ -2845,9 +3214,9 @@
% \end{macro}
%
% \begin{macro}{\@@setcrefrange}
-% We again separate out the very final type-setting step into a separate
-% macro, in order to make it easier to redefine things later to make
-% them work with the \package{hyperref} package.
+% We again separate out the very final type-setting step into a
+% separate macro, in order to make it easier to redefine things later
+% to make them work with the \package{hyperref} package.
% \begin{macrocode}
\def\@@setcrefrange#1#2#3{%
\cref@getlabel{#2}{\@labela}%
@@ -2865,6 +3234,45 @@
\def\@setcref@lastgroupconjunction{\creflastgroupconjunction}
% \end{macrocode}
%
+% \begin{macro}{\namecref}
+% \begin{macro}{\nameCref}
+% Finally, we define \cmd{\namecref} and \cmd{\nameCref} commands that
+% return just the type-set name of a reference, without the reference
+% label, which is occasionally useful. They retrieves the reference name
+% from the corresponding \cmd{\crefname} or \cmd{\Crefname} definition,
+% if these exist, otherwise they fall back to using the reference type as
+% the name.
+% \begin{macrocode}
+\DeclareRobustCommand{\namecref}[1]{%
+ \expandafter\ifx\csname r@cref@#1\endcsname\relax%
+ \protect\G@refundefinedtrue%
+ \nfss@text{\reset@font\bfseries ??}%
+ \@latex@warning{Reference `#1' on page \thepage \space undefined}%
+ \else%
+ \cref@gettype{#1}{\@tmpa}%
+ \@ifundefined{cref@\@tmpa @name}{%
+ \protect\G@refundefinedtrue%``
+ \nfss@text{\reset@font\bfseries ??}%
+ \@latex@warning{Reference name for label type `\@tmpa' undefined}%
+ }{\csname cref@\@tmpa @name\endcsname}%
+ \fi}
+\DeclareRobustCommand{\nameCref}[1]{%
+ \expandafter\ifx\csname r@cref@#1\endcsname\relax%
+ \protect\G@refundefinedtrue%
+ \nfss@text{\reset@font\bfseries ??}%
+ \@latex@warning{Reference `#1' on page \thepage \space undefined}%
+ \else%
+ \cref@gettype{#1}{\@tmpa}%
+ \@ifundefined{Cref@\@tmpa @name}{%
+ \protect\G@refundefinedtrue%``
+ \nfss@text{\reset@font\bfseries ??}%
+ \@latex@warning{Reference name for label type `\@tmpa' undefined}%
+ }{\csname Cref@\@tmpa @name\endcsname}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
%
%
% \subsection{Reference Format Customisation Commands}
@@ -2922,8 +3330,8 @@
% \begin{macro}{\Crefname@preamble}
% The \cmd{\crefname@preamble} and \cmd{\Crefname@preamble} commands
% are very like the \cmd{\crefname} and \cmd{\Crefname} commands, but
-% they tag ``|@preamble|'' onto the end of the generated macro
-% names. They are used when defining the formats for different
+% they tag ``|@preamble|'' onto the end of the generated macro names.
+% They are used when defining the default formats for different
% languages (see \cref{sec:code:babel}).
%\begin{macrocode}
\newcommand{\crefname@preamble}[3]{%
@@ -2939,7 +3347,7 @@
% format names, by defining an appropriately named command to contain
% the format component, and using the additional first argument
% (``cref'' or ``Cref'') to determine how to define the corresponding
-% command with the other capitalisation. The extra fifth argument
+% command with the other capitalisation. The extra fifth argument gets
% tagged onto the end of the generated macro names.
% \begin{macrocode}
\def\@crefname#1#2#3#4#5{%
@@ -2972,8 +3380,7 @@
% \end{macrocode}
% Define \cmd{\@tmpa} and \cmd{@tmpb} to be partial expansions (expanded
% just once) of the macros for the capitalisation variant we've just
-% defined above. The \cmd{\@toska} token register just makes the code
-% less verbose.
+% defined above.
% \begin{macrocode}
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tmpa%
@@ -2997,7 +3404,8 @@
\expandafter\@changecase\@tmpb}%
% \end{macrocode}
% Define the other capitalisation variants to be the partial expansions
-% (expanded just once) of \cmd{\@tmpa} and \cmd{\@tmpb}.
+% (expanded just once) of \cmd{\@tmpa} and \cmd{\@tmpb}. The
+% \cmd{\@toksa} token register just makes the code less verbose.
% \begin{macrocode}
\toksdef\@toksa=0%
\@toksa={%
@@ -3021,8 +3429,8 @@
% format components for the specified reference type into temporary
% macros, for use by later macros. The ridiculous number of ``\#''
% characters ensure that the correct number remain when they come to be
-% used later (pairs ``\#\#'' are collapsed to a single ``\#'' each time
-% the code is expanded).
+% used later (recall that pairs ``\#\#'' are collapsed to a single
+% ``\#'' each time the code is expanded).
% \begin{macrocode}
\def\@crefconstructcomponents#1{%
% \end{macrocode}
@@ -3327,7 +3735,8 @@
% \end{macro}
%
%
-% \subsubsection{Format Definition Commands}\label{sec:crefformat}
+% \subsubsection{Cross-Reference Format Definition Commands}
+% \label{sec:crefformat}
% \begin{macro}{\crefformat}
% \begin{macro}{\Crefformat}
% \begin{macro}{\crefrangeformat}
@@ -3431,7 +3840,8 @@
% \end{macro}
%
% \begin{macro}{\@crefrangeformat}
-% \cmd{\@crefrangeformat} defines the macros for single reference ranges.
+% \cmd{\@crefrangeformat} defines the macros for single reference
+% ranges.
% \begin{macrocode}
\def\@crefrangeformat#1#2#3{%
\begingroup%
@@ -3683,7 +4093,6 @@
%
% \subsection{\package{hyperref} Support}
% \begin{macro}{hyperref}
-% \begin{macro}{backref}
% If the \package{hyperref} package is loaded, we add hyper-link
% support to \package{cleveref}. Since \package{hyperref} messes around
% with some of the same \LaTeX{} internals as we do, we also have to
@@ -3692,67 +4101,34 @@
% \begin{macrocode}
\@ifpackageloaded{hyperref}{%
\PackageInfo{cleveref}{`hyperref' support loaded}
- \@ifpackagewith{hyperref}{backref}{%
- \PackageError{cleveref}{`cleveref' is currently incompatible with
- `hyperref's `backref' option}{Remove the `backref' option from
- `hyperref' if you want to use `cleveref'}}{}
% \end{macrocode}
-% \begin{macro}{\cref@reflabel}
-% \begin{macro}{\cref@getlabel}
-% \begin{macro}{\cref@gettype}
-% \begin{macro}{\cref@getcounter}
-% \begin{macro}{\cref@getprefix}
-% We redefine the utility macros to cope with the extra arguments
-% supplied by hyperref (via the aux file).
+% \begin{macro}{\cref@hyperref}
+% We define a utility macro to extract the hyper-link supplied by
+% \package{hyperref} (via the aux file). Note that \package{hyperref}
+% adds the hyper-link information to the standard \cmd{\newlabel} line
+% in the aux file, so we have to retrieve it from the standard
+% \cmd{r@\meta{label}}, \emph{not} the one prefixed with |cref@| that
+% we've created ourselves.
% \begin{macrocode}
- \def\cref@reflabel#1#2#3#4#5{\@result}
\def\cref@hyperref#1{\expandafter\expandafter\expandafter%
\@fourthoffive\csname r@#1\endcsname}
- \def\cref@getlabel#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
- \expandafter\expandafter\expandafter\def%
- \expandafter\expandafter\expandafter\@tmpa%
- \expandafter\expandafter\expandafter{%
- \expandafter\@firstoffive\@tmpa}%
- \expandafter\@cref@getlabel\@tmpa\@nil#2}
- \def\cref@gettype#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
- \expandafter\expandafter\expandafter\def%
- \expandafter\expandafter\expandafter\@tmpa%
- \expandafter\expandafter\expandafter{%
- \expandafter\@firstoffive\@tmpa}%
- \expandafter\@cref@gettype\@tmpa\@nil#2}
- \def\cref@getcounter#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
- \expandafter\expandafter\expandafter\def%
- \expandafter\expandafter\expandafter\@tmpa%
- \expandafter\expandafter\expandafter{%
- \expandafter\@firstoffive\@tmpa}%
- \expandafter\@cref@getcounter\@tmpa\@nil#2}
- \def\cref@getprefix#1#2{%
- \expandafter\let\expandafter\@tmpa\csname r@#1\endcsname%
- \expandafter\expandafter\expandafter\def%
- \expandafter\expandafter\expandafter\@tmpa%
- \expandafter\expandafter\expandafter{%
- \expandafter\@firstoffive\@tmpa}%
- \expandafter\@cref@getprefix\@tmpa\@nil#2}
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{macro}{\H@refstepcounter}
% The \package{hyperref} package stores the original
% \cmd{\refstepcounter} definition as\linebreak[4]
-% \cmd{\H@refstepcounter}, which we therefore need to modify so that it
-% adds the extra information to \cmd{\@currentlabel}.
+% \cmd{\H@refstepcounter}. Unfortunately, it plasters
+% \cmd{H@refstepcounter} all over the place, sometimes bypassing
+% \cmd{\refstepcounter} entirely. So we're forced to modify
+% \cmd{\H@refstepcounter} itself, in order to ensure that the extra
+% information we need is stored in \cmd{\cref@currentlabel}.
% \begin{macrocode}
+ \let\cref@old@H@refstepcounter\H@refstepcounter
\def\H@refstepcounter#1{%
- \stepcounter{#1}%
+ \cref@old@H@refstepcounter{#1}%
\cref@constructprefix{#1}{\@result}%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[#1][\arabic{#1}][\@result]%
\csname p@#1\endcsname\csname the#1\endcsname}}
% \end{macrocode}
@@ -3760,20 +4136,24 @@
%
% \begin{macro}{\refstepcounter@noarg}
% \begin{macro}{\refstepcounter@optarg}
-% The original \cmd{\refstepcounter}, as stored earlier in\linebreak[4]
-% \cmd{\cref@old@refstepcounter}, already calls \cmd{\H@refstepcounter}
-% if \package{hyperref} is loaded, and we just redefined the latter to
-% store the type information. So we only need to change
-% \cmd{\@currentlabel} in our \cmd{\refstepcounter} if an optional
-% argument was supplied.
+% \package{hyperref}'s \cmd{\refstepcounter}, which ends up stored in
+% our\linebreak[4] \cmd{\cref@old@refstepcounter}, already calls
+% \cmd{\H@refstepcounter}, and we just redefined the latter to store
+% the extra information. So we only need to change
+% \cmd{\cref@currentlabel} in \emph{our} \cmd{\refstepcounter} if an
+% optional argument was supplied. (Note that, in this case, the
+% mechanism for setting \cmd{\cref@currentlabel} is slightly different
+% than it is without \package{hyperref}: \cmd{\cref@currentlabel} first
+% gets set by our modified \cmd{\H@refstepcounter}, which gets called
+% via \cmd{\cref@old@refstepcounter}. \cmd{\cref@refstepcounter@optarg}
+% then overrides the label type.)
% \begin{macrocode}
\def\refstepcounter@noarg#1{\cref@old@refstepcounter{#1}}
\def\refstepcounter@optarg[#1]#2{%
\cref@old@refstepcounter{#2}%
- \expandafter\@cref@getlabel\@currentlabel\@nil{\@tmplabel}%
- \cref@constructprefix{#2}{\@tmpreset}%
- \protected@edef\@currentlabel{%
- [#1][\arabic{#2}][\@tmpreset]\@tmplabel}}
+ \protected@edef\cref@currentlabel{%
+ \expandafter\cref@override@label@type%
+ \cref@currentlabel\@nil{#1}}}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3788,7 +4168,7 @@
\cref@old@appendix%
\@ifundefined{chapter}{%
\def\H@refstepcounter##1{%
- \stepcounter{##1}%
+ \cref@old@H@refstepcounter{##1}%
\cref@constructprefix{##1}{\@result}%
% \end{macrocode}
% We add a large value to the front of the counter data, to force
@@ -3806,25 +4186,25 @@
\def\@tmpa{##1}%
\def\@tmpb{section}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[appendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subappendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsubsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subsubappendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[##1][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\fi%
@@ -3832,7 +4212,7 @@
\fi}%
}{%
\def\H@refstepcounter##1{%
- \stepcounter{##1}%
+ \cref@old@H@refstepcounter{##1}%
\cref@constructprefix{##1}{\@result}%
% \end{macrocode}
% Again, the large value added to the front of the counter data
@@ -3849,32 +4229,32 @@
\def\@tmpa{##1}%
\def\@tmpb{chapter}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[appendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{section}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subappendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subsubappendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tmpa{##1}%
\def\@tmpb{subsubsection}%
\ifx\@tmpa\@tmpb%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[subsubsubappendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \protected@edef\@currentlabel{%
+ \protected@edef\cref@currentlabel{%
[##1][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\fi%
@@ -3925,8 +4305,8 @@
% \begin{macro}{\@@setcrefrange}
% Redefine \cmd{\@@setcref} and \cmd{\@@setrangeref} to create
% hyper-links (unless the starred flag is set), using the extra
-% arguments supplied in \cmd{\r@\meta{label}} (via the aux file) by
-% \package{hyperref}.
+% arguments supplied in \cmd{\r@cref@\meta{label}} (via the aux file)
+% by \package{hyperref}.
% \begin{macrocode}
\def\@@setcref#1#2{%
\cref@getlabel{#2}{\@tmplabel}%
@@ -3948,33 +4328,11 @@
{\hyper@linkstart{link}{\@linka}}{\hyper@linkend}%
{\hyper@linkstart{link}{\@linkb}}{\hyper@linkend}%
\fi}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\ref*}
-% Redefine \cmd{\ref} command to provide a starred variant with the
-% same behaviour as \package{hyperref}'s \cmd{\ref*}. As before, we
-% defer the redefinition until the beginning of the document, to ensure
-% it `takes'. (\package{hyperref} stores the original \cmd{\@setref} in
-% \cmd{\real@setref}.)
-% \begin{macrocode}
- \AtBeginDocument{%
- \DeclareRobustCommand{\ref}{\@ifstar\cref@refstar\cref@ref}
- \def\cref@refstar#1{%
- \expandafter\ifx\csname r@#1\endcsname\relax%
- \let\@result\relax%
- \else%
- \cref@getlabel{#1}{\@result}%
- \fi%
- \expandafter\real@setref\csname r@#1\endcsname{%
- \cref@reflabel}{#1}}%
- }
}{}% end of \@ifpackageloaded{hyperref}
% \end{macrocode}
% \end{macro}
-%
% \end{macro}
+%
% \end{macro}
%
%
@@ -3994,8 +4352,8 @@
%
% \begin{macro}{\theorem@prework}
% Newer versions of \package{ntheorem} require a call to
-% \cmd{\theorem@prework} when type-setting theorems. If an older version
-% of \package{ntheorem} is being used, we just \cmd{\let} it to
+% \cmd{\theorem@prework} when type-setting theorems. If an older
+% version of \package{ntheorem} is being used, we just \cmd{\let} it to
% \cmd{\relax} to make sure it's defined.
% \begin{macrocode}
\@ifundefined{theorem@prework}{\let\theorem@prework\relax}{}
@@ -4016,7 +4374,7 @@
\stepcounter{curr#1ctr}%
\setcounter{end#1ctr}{0}%
\fi%
- \refstepcounter[#1]{#2}% <<<<<
+ \refstepcounter[#1]{#2}% <<< cleveref modification
\theorem@prework%
\thm@topsepadd \theorempostskipamount%
\ifvmode \advance\thm@topsepadd\partopsep\fi%
@@ -4028,29 +4386,122 @@
\parshape \@ne \@totalleftmargin \linewidth%
\@ifnextchar[{\@ythm{#1}{#2}{#3}}{\@xthm{#1}{#2}{#3}}%]
}
- }{}% end of \@ifpackageloaded
+ }{}% end of \@ifpackageloaded{ntheorem}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \subsection{\cmd{\newtheorem} Support}
+% \label{sec:newtheorem}
+% \begin{macro}{\newtheorem}
+% A \cmd{\newtheorem} command provides sufficient information to
+% automatically define a reasonable cross-reference name for
+% theorem-like environments (\package{ntheorem}'s \option{thmref} does
+% essentially this). So we modify \cmd{\newtheorem} (actually, the
+% lower-level \cmd{\@othm}, \cmd{\@xnthm} and \cmd{\@ynthm} macros) so
+% that it does so. We do this in such a way that default definitions or
+% explicit \cmd{\crefname} definitions for for theorem-like
+% environments override those produced automatically by our modified
+% \cmd{\newtheorem}.
+%
+% The catch is that, although the \cmd{\newtheorem} command provides
+% the singular form, there's no way of reliably deducing the plural
+% form from this. Rather than implement some half-baked attempt at this
+% which will be wrong more often than it's right (especially in
+% languages other than English) and generally cause more trouble than
+% it's worth, we simply define the singular form but leave the plural
+% form undefined. If the latter is ever needed, it will produce a
+% ``undefined cross-reference type'' warning, prompting the author to
+% provide an appropriate \cmd{\crefname} definition themselves.
+%
+% \begin{macro}{\@othm}
+% \begin{macro}{\@xnthm}
+% \begin{macro}{\@ynthm}
+% After sorting out its arguments, \cmd{\newtheorem} calls one of
+% \cmd{\@othm}, \cmd{\@xthm} or \cmd{\@ythm}. We add automatic
+% definitions of \cmd{\cref@\meta{type}@name} and
+% \cmd{\Cref@\meta{type}@name} to all three of these, and add the
+% theorem-like environment to the list of cross-reference types that
+% need to be defined from components at |\||begin{document}|. Since we
+% want explicit \cmd{\crefname}'s to override these automatic
+% definitions, we store the definitions in
+% \cmd{\cref@\meta{type}@name@preamble}, which are processed at
+% |\||begin{document}|) if they haven't been overridden. The default
+% definitions also get stored in \cmd{\cref@\meta{type}@name@preamble}
+% later on, so they too will override these automatic definitions,
+% which is what we want.
+%
+% All this means that these automatic \cmd{\newtheorem} definitions
+% will only work when \cmd{\newtheorem} is used in the preamble.
+% However, this is also true of (new) cross-reference types defined
+% using \cmd{\crefname}, so it doesn't seem worth the significant
+% effort of getting the automatic definitions to work within the
+% document body.
+% \begin{macrocode}
+\let\cref@old@othm\@othm
+\def\@othm#1[#2]#3{%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeLowercase #3}%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname Cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeUppercase #3}%
+ \cref@stack@add{#1}{\cref@label@types}%
+ \cref@old@othm{#1}[#2]{#3}}
+\let\cref@old@xnthm\@xnthm
+\def\@xnthm#1#2[#3]{%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeLowercase #2}%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname Cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeUppercase #2}%
+ \cref@stack@add{#1}{\cref@label@types}%
+ \cref@old@xnthm{#1}{#2}[#3]}
+\let\cref@old@ynthm\@ynthm
+\def\@ynthm#1#2{%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeLowercase #2}%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname Cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeUppercase #2}%
+ \cref@stack@add{#1}{\cref@label@types}%
+ \cref@old@ynthm{#1}{#2}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
%
%
% \subsection{\package{amsthm} Support}
% \begin{macro}{amsthm}
-% \begin{macro}{\@thm}
% If \package{amsthm} is loaded, we need to modify its theorem
% referencing features so that they work with \package{cleveref}.
% \begin{macrocode}
\@ifpackageloaded{amsthm}{%
\PackageInfo{cleveref}{`amsthm' support loaded}
-% We modify \package{amsthm}'s version of the \cmd{\@thm} macro very
-% slightly, to have it call \cmd{\refstepcounter} with an optional
-% argument containing the theorem type.
+% \end{macrocode}
+%
+% \begin{macro}{\@thm}
+% We modify \package{amsthm}'s version of the \cmd{\@thm} macro, to
+% have it call \cmd{\refstepcounter} with an optional argument
+% containing the theorem type.
% \begin{macrocode}
-\let\@thmnoarg\@thm
-\def\@thm{\@ifnextchar[{\@thmoptarg}{\@thmnoarg}}%]
-\def\@thmoptarg[#1]#2#3#4{%
+\let\cref@thmnoarg\@thm
+\def\@thm{\@ifnextchar[{\cref@thmoptarg}{\cref@thmnoarg}}%]
+\def\cref@thmoptarg[#1]#2#3#4{%
\ifhmode\unskip\unskip\par\fi%
\normalfont%
\trivlist%
@@ -4061,12 +4512,12 @@
\thm@headsep 5\p@ plus\p@ minus\p@\relax%
\thm@space@setup%
#2% style overrides
- \@topsep \thm@preskip% used by thm head
- \@topsepadd \thm@postskip% used by \@endparenv
+ \@topsep \thm@preskip % used by thm head
+ \@topsepadd \thm@postskip % used by \@endparenv
\def\@tempa{#3}\ifx\@empty\@tempa%
\def\@tempa{\@oparg{\@begintheorem{#4}{}}[]}%
\else%
- \refstepcounter[#1]{#3}%
+ \refstepcounter[#1]{#3}% <<< cleveref modification
\def\@tempa{\@oparg{\@begintheorem{#4}{\csname the#3\endcsname}}[]}%
\fi%
\@tempa}
@@ -4075,9 +4526,29 @@
%
% \begin{macro}{\@ynthm}
% We also have to modify \package{amsthm}'s \cmd{\@ynthm} command so
-% that it passes the optional argument to \cmd{\@thm}.
+% that it passes the optional argument to \cmd{\@thm}. Since
+% \package{amsmath}'s \cmd{\@ynthm} takes a different parameter list to
+% the standard \LaTeX{} \cmd{\@ynthm} macro, we deliberately override
+% our previous redefinition, and add the code for the automatic
+% \cmd{\crefname} definitions directly to this version.
% \begin{macrocode}
\def\@ynthm#1[#2]#3{%
+% \end{macrocode}
+% Here's the automatic \cmd{\crefname} definition.
+% \begin{macrocode}
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeLowercase #3}%
+ \edef\@tmpa{\expandafter\noexpand%
+ \csname Cref@#1@name@preamble\endcsname}%
+ \expandafter\expandafter\expandafter\gdef\expandafter%
+ \@tmpa\expandafter{\MakeUppercase #3}%
+ \cref@stack@add{#1}{\cref@label@types}%
+% \end{macrocode}
+% Here's the original \package{amsthm} \cmd{\@ynthm} definition, with
+% the \package{cleveref} modification.
+% \begin{macrocode}
\ifx\relax#2\relax%
\def\@tempa{\@oparg{\@xthm{#1}{#3}}[]}%
\else%
@@ -4087,7 +4558,7 @@
\@xp\xdef\csname the#1\endcsname{\@xp\@nx\csname the#2\endcsname}%
\toks@{#3}%
\@xp\xdef\csname#1\endcsname{%
- \@nx\@thm[#1]{% <<<<< new optional argument for theorem name
+ \@nx\@thm[#1]{% <<< new optional argument for theorem name
\let\@nx\thm@swap%
\if S\thm@swap\@nx\@firstoftwo\else\@nx\@gobble\fi%
\@xp\@nx\csname th@\the\thm@style\endcsname}%
@@ -4096,7 +4567,17 @@
}%
\fi%
\@tempa}
- }{}% end of \@ifpackageloaded
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xnthm}
+% Finally, we have to restore the \package{amsthm} version of
+% \cmd{\@xnthm}, which we stored earlier in \cmd{\cref@old@xnthm} and
+% redefined. With \package{amsthm}, \cmd{\@xnthm} calls \cmd{\@ynthm},
+% so the automatic \cmd{\crefname} definition is already taken care of.
+% \begin{macrocode}
+ \let\@xnthm\cref@old@xnthm
+ }{}% end of \@ifpackageloaded{amsthm}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -4229,17 +4710,23 @@
\DeclareRobustCommand{\vrefrange}{%
\@ifstar{\cref@vrefrangestar{cref}}{\cref@vrefrange{cref}}}
\DeclareRobustCommand{\Vrefrange}{%
- \@ifstar{\cref@vrefrangestar{Cref}}{\cref@vrefrange{Cref}}}%
+ \@ifstar{\cref@vrefrangestar{Cref}}{\cref@vrefrange{Cref}}}
\DeclareRobustCommand{\fullref}{%
\@ifstar{\cref@fullrefstar{cref}}{\cref@fullref{cref}}}
\DeclareRobustCommand{\Fullref}{%
\@ifstar{\cref@fullrefstar{Cref}}{\cref@fullref{Cref}}}
\def\cref@vrefstar#1#2{%
- \@crefstarredtrue\cref@vref{#1}{#2}\@crefstarredfalse}
+ \@crefstarredtrue%
+ \cref@vref{#1}{#2}%
+ \@crefstarredfalse}
\def\cref@vrefrangestar#1#2#3{%
- \@crefstarredtrue\cref@vrefrange{#1}{#2}{#3}\@crefstarredfalse}
+ \@crefstarredtrue%
+ \cref@vrefrange{#1}{#2}{#3}%
+ \@crefstarredfalse}
\def\cref@fullrefstar#1#2{%
- \@crefstarredtrue\cref@fullref{#1}{#2}\@crefstarredfalse}
+ \@crefstarredtrue%
+ \cref@fullref{#1}{#2}%
+ \@crefstarredfalse}
}{%
\DeclareRobustCommand{\vref}{\cref@vref{cref}}
\DeclareRobustCommand{\Vref}{\cref@vref{Cref}}
@@ -4250,7 +4737,7 @@
}
\fi%
}% end of \AtBeginDocument
- }{}% end of \@ifpackageloaded
+ }{}% end of \@ifpackageloaded{varioref}
% \end{macrocode}
%
% \begin{macro}{legacyvarioref}
@@ -4280,9 +4767,9 @@
%
%
% \begin{macro}{\cref@poorman@text}
-% Define global macro \cmd{\cref@poorman@text} to store the text produced by
-% the \cmd{\cref} commands, and open an output stream for writing the
-% script before starting to process the document body.
+% Define global macro \cmd{\cref@poorman@text} to store the text
+% produced by the \cmd{\cref} commands, and open an output stream for
+% writing the script before starting to process the document body.
% \begin{macrocode}
\gdef\cref@poorman@text{}
\AtBeginDocument{%
@@ -4924,7 +5411,7 @@
\@tmpa#1\@nil%
\endgroup}
}% end of \AtBeginDocument
- }{}% end of \@ifpackageloaded
+ }{}% end of \@ifpackageloaded{varioref}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -5062,8 +5549,8 @@
% \subsection{Capitalise option}
% \begin{macro}{capitalise}
% \begin{macro}{\if@cref@capitalise}
-% The \option{capitalise} option causes \package{cleveref} to always use
-% the |\Cref|* variants for type-setting cross-references, so that
+% The \option{capitalise} option causes \package{cleveref} to always
+% use the |\Cref|* variants for type-setting cross-references, so that
% cross-reference names are always capitalised.
% \begin{macrocode}
\newif\if@cref@capitalise
@@ -5176,8 +5663,8 @@
\DeclareOption{english}{%
\PackageInfo{cleveref}{loaded `english' language definitions}
% \end{macrocode}
-% First, we set up the definitions used at the beginning of the document to
-% define the formats created by the document preamble.
+% First, we set up the definitions used at the beginning of the document
+% to define the formats created by the document preamble.
% \begin{macrocode}
\AtBeginDocument{%
\def\crefrangeconjunction@preamble{ to~}%
@@ -5199,10 +5686,11 @@
\Crefname@preamble{chapter}{Chapter}{Chapters}%
\Crefname@preamble{section}{Section}{Sections}%
\Crefname@preamble{appendix}{Appendix}{Appendices}%
+ \Crefname@preamble{enumi}{Item}{Items}%
+ \Crefname@preamble{footnote}{Footnote}{Footnotes}%
\Crefname@preamble{figure}{Figure}{Figures}%
\Crefname@preamble{table}{Table}{Tables}%
\Crefname@preamble{theorem}{Theorem}{Theorems}%
- \Crefname@preamble{enumi}{Item}{Items}%
\Crefname@preamble{lemma}{Lemma}{Lemmas}%
\Crefname@preamble{corollary}{Corollary}{Corollaries}%
\Crefname@preamble{proposition}{Proposition}{Propositions}%
@@ -5216,10 +5704,11 @@
\crefname@preamble{chapter}{Chapter}{Chapters}%
\crefname@preamble{section}{Section}{Sections}%
\crefname@preamble{appendix}{Appendix}{Appendices}%
+ \crefname@preamble{enumi}{Item}{Items}%
+ \crefname@preamble{footnote}{Footnote}{Footnotes}%
\crefname@preamble{figure}{Fig.}{Figs.}%
\crefname@preamble{table}{Table}{Tables}%
\crefname@preamble{theorem}{Theorem}{Theorems}%
- \crefname@preamble{enumi}{Item}{Items}%
\crefname@preamble{lemma}{Lemma}{Lemmas}%
\crefname@preamble{corollary}{Corollary}{Corollaries}%
\crefname@preamble{proposition}{Proposition}{Propositions}%
@@ -5233,10 +5722,11 @@
\crefname@preamble{chapter}{chapter}{chapters}%
\crefname@preamble{section}{section}{sections}%
\crefname@preamble{appendix}{appendix}{appendices}%
+ \crefname@preamble{enumi}{item}{items}%
+ \crefname@preamble{footnote}{footnote}{footnotes}%
\crefname@preamble{figure}{fig.}{figs.}%
\crefname@preamble{table}{table}{tables}%
\crefname@preamble{theorem}{theorem}{theorems}%
- \crefname@preamble{enumi}{item}{items}%
\crefname@preamble{lemma}{lemma}{lemmas}%
\crefname@preamble{corollary}{corollary}{corollaries}%
\crefname@preamble{proposition}{proposition}{propositions}%
@@ -5272,16 +5762,17 @@
\Crefname{subappendix}{Appendix}{Appendices}%
\Crefname{subsubappendix}{Appendix}{Appendices}%
\Crefname{subsubsubappendix}{Appendix}{Appendices}%
- \Crefname{figure}{Figure}{Figures}%
- \Crefname{subfigure}{Figure}{Figures}%
- \Crefname{table}{Table}{Tables}%
- \Crefname{subtable}{Table}{Tables}%
- \Crefname{theorem}{Theorem}{Theorems}%
\Crefname{enumi}{Item}{Items}%
\Crefname{enumii}{Item}{Items}%
\Crefname{enumiii}{Item}{Items}%
\Crefname{enumiv}{Item}{Items}%
\Crefname{enumv}{Item}{Items}%
+ \Crefname{footnote}{Footnote}{Footnotes}%
+ \Crefname{figure}{Figure}{Figures}%
+ \Crefname{subfigure}{Figure}{Figures}%
+ \Crefname{table}{Table}{Tables}%
+ \Crefname{subtable}{Table}{Tables}%
+ \Crefname{theorem}{Theorem}{Theorems}%
\Crefname{lemma}{Lemma}{Lemmas}%
\Crefname{corollary}{Corollary}{Corollaries}%
\Crefname{proposition}{Proposition}{Propositions}%
@@ -5300,16 +5791,17 @@
\crefname{subappendix}{Appendix}{Appendices}%
\crefname{subsubappendix}{Appendix}{Appendices}%
\crefname{subsubsubappendix}{Appendix}{Appendices}%
- \crefname{figure}{Fig.}{Figs.}%
- \crefname{subfigure}{Fig.}{Figs.}%
- \crefname{table}{Table}{Tables}%
- \crefname{subtable}{Table}{Tables}%
- \crefname{theorem}{Theorem}{Theorems}%
\crefname{enumi}{Item}{Items}%
\crefname{enumii}{Item}{Items}%
\crefname{enumiii}{Item}{Items}%
\crefname{enumiv}{Item}{Items}%
\crefname{enumv}{Item}{Items}%
+ \crefname{footnote}{Footnote}{Footnotes}%
+ \crefname{figure}{Fig.}{Figs.}%
+ \crefname{subfigure}{Fig.}{Figs.}%
+ \crefname{table}{Table}{Tables}%
+ \crefname{subtable}{Table}{Tables}%
+ \crefname{theorem}{Theorem}{Theorems}%
\crefname{lemma}{Lemma}{Lemmas}%
\crefname{corollary}{Corollary}{Corollaries}%
\crefname{proposition}{Proposition}{Propositions}%
@@ -5328,16 +5820,17 @@
\crefname{subappendix}{appendix}{appendices}%
\crefname{subsubappendix}{appendix}{appendices}%
\crefname{subsubsubappendix}{appendix}{appendices}%
- \crefname{figure}{fig.}{figs.}%
- \crefname{subfigure}{fig.}{figs.}%
- \crefname{table}{table}{tables}%
- \crefname{subtable}{table}{tables}%
- \crefname{theorem}{theorem}{theorems}%
\crefname{enumi}{item}{items}%
\crefname{enumii}{item}{items}%
\crefname{enumiii}{item}{items}%
\crefname{enumiv}{item}{items}%
\crefname{enumv}{item}{items}%
+ \crefname{footnote}{footnote}{footnotes}%
+ \crefname{figure}{fig.}{figs.}%
+ \crefname{subfigure}{fig.}{figs.}%
+ \crefname{table}{table}{tables}%
+ \crefname{subtable}{table}{tables}%
+ \crefname{theorem}{theorem}{theorems}%
\crefname{lemma}{lemma}{lemmas}%
\crefname{corollary}{corollary}{corollaries}%
\crefname{proposition}{proposition}{propositions}%
@@ -5359,8 +5852,8 @@
\DeclareOption{german}{%
\PackageInfo{cleveref}{loaded `german' language definitions}
% \end{macrocode}
-% First, we set up the definitions used at the beginning of the document to
-% define the formats created by the document preamble.
+% First, we set up the definitions used at the beginning of the document
+% to define the formats created by the document preamble.
% \begin{macrocode}
\AtBeginDocument{%
\def\crefrangeconjunction@preamble{ bis~}%
@@ -5384,10 +5877,11 @@
\Crefname@preamble{chapter}{Kapitel}{Kapitel}%
\Crefname@preamble{section}{Abschnitt}{Abschnitte}%
\Crefname@preamble{appendix}{Anhang}{Anh\"ange}%
+ \Crefname@preamble{enumi}{Punkt}{Punkte}%
+ \Crefname@preamble{footnote}{Fu\ss note}{Fu\ss noten}%
\Crefname@preamble{figure}{Abbildung}{Abbildungen}%
\Crefname@preamble{table}{Tabelle}{Tabellen}%
\Crefname@preamble{theorem}{Theorem}{Theoremen}%
- \Crefname@preamble{enumi}{Punkt}{Punkte}%
\Crefname@preamble{lemma}{Lemma}{Lemmata}%
\Crefname@preamble{corollary}{Korollar}{Korollaren}%
\Crefname@preamble{proposition}{Satz}{S\"atze}%
@@ -5401,10 +5895,11 @@
\crefname@preamble{chapter}{Kapitel}{Kapitel}%
\crefname@preamble{section}{Abschnitt}{Abschnitte}%
\crefname@preamble{appendix}{Anhang}{Anh\"ange}%
+ \crefname@preamble{enumi}{Punkt}{Punkte}%
+ \crefname@preamble{footnote}{Fu\ss note}{Fu\ss noten}%
\crefname@preamble{figure}{Abbildung}{Abbildungen}%
\crefname@preamble{table}{Tabelle}{Tabellen}%
\crefname@preamble{theorem}{Theorem}{Theoremen}%
- \crefname@preamble{enumi}{Punkt}{Punkte}%
\crefname@preamble{lemma}{Lemma}{Lemmata}%
\crefname@preamble{corollary}{Korollar}{Korollaren}%
\crefname@preamble{proposition}{Satz}{S\"atze}%
@@ -5418,10 +5913,11 @@
\crefname@preamble{chapter}{Kapitel}{Kapitel}%
\crefname@preamble{section}{Abschnitt}{Abschnitte}%
\crefname@preamble{appendix}{Anhang}{Anh\"ange}%
+ \crefname@preamble{enumi}{Punkt}{Punkte}%
+ \crefname@preamble{footnote}{Fu\ss note}{Fu\ss noten}%
\crefname@preamble{figure}{Abbildung}{Abbildungen}%
\crefname@preamble{table}{Tabelle}{Tabellen}%
\crefname@preamble{theorem}{Theorem}{Theoremen}%
- \crefname@preamble{enumi}{Punkt}{Punkte}%
\crefname@preamble{lemma}{Lemma}{Lemmata}%
\crefname@preamble{corollary}{Korollar}{Korollaren}%
\crefname@preamble{proposition}{Satz}{S\"atze}%
@@ -5457,16 +5953,17 @@
\Crefname{subappendix}{Anhang}{Anh\"ange}%
\Crefname{subsubappendix}{Anhang}{Anh\"ange}%
\Crefname{subsubsubappendix}{Anhang}{Anh\"ange}%
- \Crefname{figure}{Abbildung}{Abbildungen}%
- \Crefname{subfigure}{Abbildung}{Abbildungen}%
- \Crefname{table}{Tabelle}{Tabellen}%
- \Crefname{subtable}{Tabelle}{Tabellen}%
- \Crefname{theorem}{Theorem}{Theoremen}%
\Crefname{enumi}{Punkt}{Punkte}%
\Crefname{enumii}{Punkt}{Punkte}%
\Crefname{enumiii}{Punkt}{Punkte}%
\Crefname{enumiv}{Punkt}{Punkte}%
\Crefname{enumv}{Punkt}{Punkte}%
+ \Crefname{footnote}{Fu\ss note}{Fu\ss noten}%
+ \Crefname{figure}{Abbildung}{Abbildungen}%
+ \Crefname{subfigure}{Abbildung}{Abbildungen}%
+ \Crefname{table}{Tabelle}{Tabellen}%
+ \Crefname{subtable}{Tabelle}{Tabellen}%
+ \Crefname{theorem}{Theorem}{Theoremen}%
\Crefname{lemma}{Lemma}{Lemmata}%
\Crefname{corollary}{Korollar}{Korollaren}%
\Crefname{proposition}{Satz}{S\"atze}%
@@ -5485,16 +5982,17 @@
\crefname{subappendix}{Anhang}{Anh\"ange}%
\crefname{subsubappendix}{Anhang}{Anh\"ange}%
\crefname{subsubsubappendix}{Anhang}{Anh\"ange}%
- \crefname{figure}{Abbildung}{Abbildungen}%
- \crefname{subfigure}{Abbildung}{Abbildungen}%
- \crefname{table}{Tabelle}{Tabellen}%
- \crefname{subtable}{Tabelle}{Tabellen}%
- \crefname{theorem}{Theorem}{Theoremen}%
\crefname{enumi}{Punkt}{Punkte}%
\crefname{enumii}{Punkt}{Punkte}%
\crefname{enumiii}{Punkt}{Punkte}%
\crefname{enumiv}{Punkt}{Punkte}%
\crefname{enumv}{Punkt}{Punkte}%
+ \crefname{footnote}{Fu\ss note}{Fu\ss noten}%
+ \crefname{figure}{Abbildung}{Abbildungen}%
+ \crefname{subfigure}{Abbildung}{Abbildungen}%
+ \crefname{table}{Tabelle}{Tabellen}%
+ \crefname{subtable}{Tabelle}{Tabellen}%
+ \crefname{theorem}{Theorem}{Theoremen}%
\crefname{lemma}{Lemma}{Lemmata}%
\crefname{corollary}{Korollar}{Korollaren}%
\crefname{proposition}{Satz}{S\"atze}%
@@ -5513,16 +6011,17 @@
\crefname{subappendix}{Anhang}{Anh\"ange}%
\crefname{subsubappendix}{Anhang}{Anh\"ange}%
\crefname{subsubsubappendix}{Anhang}{Anh\"ange}%
- \crefname{figure}{Abbildung}{Abbildungen}%
- \crefname{subfigure}{Abbildung}{Abbildungen}%
- \crefname{table}{Tabelle}{Tabellen}%
- \crefname{subtable}{Tabelle}{Tabellen}%
- \crefname{theorem}{Theorem}{Theoremen}%
\crefname{enumi}{Punkt}{Punkte}%
\crefname{enumii}{Punkt}{Punkte}%
\crefname{enumiii}{Punkt}{Punkte}%
\crefname{enumiv}{Punkt}{Punkte}%
\crefname{enumv}{Punkt}{Punkte}%
+ \crefname{footnote}{Fu\ss note}{Fu\ss noten}%
+ \crefname{figure}{Abbildung}{Abbildungen}%
+ \crefname{subfigure}{Abbildung}{Abbildungen}%
+ \crefname{table}{Tabelle}{Tabellen}%
+ \crefname{subtable}{Tabelle}{Tabellen}%
+ \crefname{theorem}{Theorem}{Theoremen}%
\crefname{lemma}{Lemma}{Lemmata}%
\crefname{corollary}{Korollar}{Korollaren}%
\crefname{proposition}{Satz}{S\"atze}%
@@ -5568,16 +6067,17 @@
\Crefname{subappendix}{Anhang}{Anh\"ange}%
\Crefname{subsubappendix}{Anhang}{Anh\"ange}%
\Crefname{subsubsubappendix}{Anhang}{Anh\"ange}%
- \Crefname{figure}{Abbildung}{Abbildungen}%
- \Crefname{subfigure}{Abbildung}{Abbildungen}%
- \Crefname{table}{Tabelle}{Tabellen}%
- \Crefname{subtable}{Tabelle}{Tabellen}%
- \Crefname{theorem}{Theorem}{Theoremen}%
\Crefname{enumi}{Punkt}{Punkte}%
\Crefname{enumii}{Punkt}{Punkte}%
\Crefname{enumiii}{Punkt}{Punkte}%
\Crefname{enumiv}{Punkt}{Punkte}%
\Crefname{enumv}{Punkt}{Punkte}%
+ \Crefname{footnote}{Fu\ss note}{Fu\ss noten}%
+ \Crefname{figure}{Abbildung}{Abbildungen}%
+ \Crefname{subfigure}{Abbildung}{Abbildungen}%
+ \Crefname{table}{Tabelle}{Tabellen}%
+ \Crefname{subtable}{Tabelle}{Tabellen}%
+ \Crefname{theorem}{Theorem}{Theoremen}%
\Crefname{lemma}{Lemma}{Lemmata}%
\Crefname{corollary}{Korollar}{Korollaren}%
\Crefname{proposition}{Satz}{S\"atze}%
@@ -5596,16 +6096,17 @@
\crefname{subappendix}{Anhang}{Anh\"ange}%
\crefname{subsubappendix}{Anhang}{Anh\"ange}%
\crefname{subsubsubappendix}{Anhang}{Anh\"ange}%
- \crefname{figure}{Abbildung}{Abbildungen}%
- \crefname{subfigure}{Abbildung}{Abbildungen}%
- \crefname{table}{Tabelle}{Tabellen}%
- \crefname{subtable}{Tabelle}{Tabellen}%
- \crefname{theorem}{Theorem}{Theoremen}%
\crefname{enumi}{Punkt}{Punkte}%
\crefname{enumii}{Punkt}{Punkte}%
\crefname{enumiii}{Punkt}{Punkte}%
\crefname{enumiv}{Punkt}{Punkte}%
\crefname{enumv}{Punkt}{Punkte}%
+ \crefname{footnote}{Fu\ss note}{Fu\ss noten}%
+ \crefname{figure}{Abbildung}{Abbildungen}%
+ \crefname{subfigure}{Abbildung}{Abbildungen}%
+ \crefname{table}{Tabelle}{Tabellen}%
+ \crefname{subtable}{Tabelle}{Tabellen}%
+ \crefname{theorem}{Theorem}{Theoremen}%
\crefname{lemma}{Lemma}{Lemmata}%
\crefname{corollary}{Korollar}{Korollaren}%
\crefname{proposition}{Satz}{S\"atze}%
@@ -5624,16 +6125,17 @@
\crefname{subappendix}{Anhang}{Anh\"ange}%
\crefname{subsubappendix}{Anhang}{Anh\"ange}%
\crefname{subsubsubappendix}{Anhang}{Anh\"ange}%
- \crefname{figure}{Abbildung}{Abbildungen}%
- \crefname{subfigure}{Abbildung}{Abbildungen}%
- \crefname{table}{Tabelle}{Tabellen}%
- \crefname{subtable}{Tabelle}{Tabellen}%
- \crefname{theorem}{Theorem}{Theoremen}%
\crefname{enumi}{Punkt}{Punkte}%
\crefname{enumii}{Punkt}{Punkte}%
\crefname{enumiii}{Punkt}{Punkte}%
\crefname{enumiv}{Punkt}{Punkte}%
\crefname{enumv}{Punkt}{Punkte}%
+ \crefname{footnote}{Fu\ss note}{Fu\ss noten}%
+ \crefname{figure}{Abbildung}{Abbildungen}%
+ \crefname{subfigure}{Abbildung}{Abbildungen}%
+ \crefname{table}{Tabelle}{Tabellen}%
+ \crefname{subtable}{Tabelle}{Tabellen}%
+ \crefname{theorem}{Theorem}{Theoremen}%
\crefname{lemma}{Lemma}{Lemmata}%
\crefname{corollary}{Korollar}{Korollaren}%
\crefname{proposition}{Satz}{S\"atze}%
@@ -5646,15 +6148,15 @@
}}}
% \end{macrocode}
%
-% \begin{macro}{german}
+% \begin{macro}{dutch}
% Dutch translations kindly contributed by Philip H\"olzenspies.
% \end{macro}
% \begin{macrocode}
\DeclareOption{dutch}{%
\PackageInfo{cleveref}{loaded `dutch' language definitions}
% \end{macrocode}
-% First, we set up the definitions used at the beginning of the document to
-% define the formats created by the document preamble.
+% First, we set up the definitions used at the beginning of the document
+% to define the formats created by the document preamble.
% \begin{macrocode}
\AtBeginDocument{%
\def\crefrangeconjunction@preamble{ tot~}%
@@ -5666,22 +6168,22 @@
% \end{macrocode}
% As in German, we don't want the extra comma before ``en'' that would be
% added by the default fall-back definitions in terms of the above
-% conjunctions, so we define \cmd{\crefpairgroupconjunction} explicitly. In
-% fact, we have to define the other group conjunctions explicitly too here, in
-% case any other language option defines them explicitly and we need to
-% override them.
+% conjunctions, so we define \cmd{\crefpairgroupconjunction} explicitly.
+% In fact, we have to define the other group conjunctions explicitly too
+% here, in case any other language option defines them explicitly and we
+% need to override them.
% \begin{macrocode}
\def\crefpairgroupconjunction@preamble{ en~}%
\def\crefmiddlegroupconjunction@preamble{, }%
\def\creflastgroupconjunction@preamble{ en~}%
- \Crefname@preamble{equation}%
- {Ver\-ge\-l\ij{}k\-ing}{Ver\-ge\-l\ij{}k\-ing\-en}%
+ \Crefname@preamble{equation}{Vergel\ij{}king}{Vergel\ij{}kingen}%
\Crefname@preamble{chapter}{Hoofdstuk}{Hoofdstuken}%
\Crefname@preamble{section}{Paragraaf}{Paragrafen}%
\Crefname@preamble{appendix}{Appendix}{Appendices}%
\Crefname@preamble{figure}{Figuur}{Figuren}%
\Crefname@preamble{table}{Tabel}{Tabellen}%
\Crefname@preamble{enumi}{Punt}{Punten}%
+ \Crefname@preamble{footnote}{Voetnote}{Voetnoten}%
\Crefname@preamble{lemma}{Lemma}{Lemma's}%
\Crefname@preamble{corollary}{Corollarium}{Corollaria}%
\Crefname@preamble{proposition}{Bewering}{Beweringen}%
@@ -5695,10 +6197,11 @@
\crefname@preamble{chapter}{Hoofdstuk}{Hoofdstukken}%
\crefname@preamble{section}{Paragraaf}{Paragrafen}%
\crefname@preamble{appendix}{Appendix}{Appendices}%
+ \crefname@preamble{enumi}{Punt}{Punten}%
+ \crefname@preamble{footnote}{Voetnote}{Voetnoten}%
\crefname@preamble{figure}{Fig.}{Fig's.}%
\crefname@preamble{table}{Tabel}{Tabellen}%
\crefname@preamble{theorem}{Theorema}{Theorema's}%
- \crefname@preamble{enumi}{Punt}{Punten}%
\crefname@preamble{lemma}{Lemma}{Lemma's}%
\crefname@preamble{corollary}{Corollarium}{Corollaria}%
\crefname@preamble{proposition}{Bewering}{Beweringen}%
@@ -5712,10 +6215,11 @@
\crefname@preamble{chapter}{hoofdstuk}{hoofdstukken}%
\crefname@preamble{section}{paragraaf}{paragrafen}%
\crefname@preamble{appendix}{appendix}{appendices}%
+ \crefname@preamble{enumi}{punt}{punten}%
+ \crefname@preamble{footnote}{voetnote}{voetnoten}%
\crefname@preamble{figure}{fig.}{fig's.}%
\crefname@preamble{table}{tabel}{tabellen}%
\crefname@preamble{theorem}{theorema}{theorema's}%
- \crefname@preamble{enumi}{punt}{punten}%
\crefname@preamble{lemma}{lemma}{lemma's}%
\crefname@preamble{corollary}{corollarium}{corollaria}%
\crefname@preamble{proposition}{bewering}{beweringen}%
@@ -5742,7 +6246,7 @@
\renewcommand{\crefpairgroupconjunction}{ en~}%
\renewcommand{\crefmiddlegroupconjunction}{, }%
\renewcommand{\creflastgroupconjunction}{ en~}%
- \Crefname{equation}{Ver\-ge\-l\ij{}k\-ing}{Ver\-ge\-l\ij{}k\-ing\-en}%
+ \Crefname{equation}{Vergel\ij{}king}{Vergel\ij{}kingen}%
\Crefname{chapter}{Hoofdstuk}{Hoofdstuken}%
\Crefname{section}{Paragraaf}{Paragrafen}%
\Crefname{subsection}{Paragraaf}{Paragrafen}%
@@ -5751,16 +6255,17 @@
\Crefname{subappendix}{Appendix}{Appendices}%
\Crefname{subsubappendix}{Appendix}{Appendices}%
\Crefname{subsubsubappendix}{Appendix}{Appendices}%
- \Crefname{figure}{Figuur}{Figuren}%
- \Crefname{subfigure}{Figuur}{Figuren}%
- \Crefname{table}{Tabel}{Tabellen}%
- \Crefname{subtable}{Tabel}{Tabellen}%
- \Crefname{theorem}{Theorema}{Theorema's}%
\Crefname{enumi}{Punt}{Punten}%
\Crefname{enumii}{Punt}{Punten}%
\Crefname{enumiii}{Punt}{Punten}%
\Crefname{enumiv}{Punt}{Punten}%
\Crefname{enumv}{Punt}{Punten}%
+ \Crefname{footnote}{Voetnote}{Voetnoten}%
+ \Crefname{figure}{Figuur}{Figuren}%
+ \Crefname{subfigure}{Figuur}{Figuren}%
+ \Crefname{table}{Tabel}{Tabellen}%
+ \Crefname{subtable}{Tabel}{Tabellen}%
+ \Crefname{theorem}{Theorema}{Theorema's}%
\Crefname{lemma}{Lemma}{Lemma's}%
\Crefname{corollary}{Corollarium}{Corollaria}%
\Crefname{proposition}{Bewering}{Beweringen}%
@@ -5774,10 +6279,11 @@
\crefname{chapter}{Hoofdstuk}{Hoofdstukken}%
\crefname{section}{Paragraaf}{Paragrafen}%
\crefname{appendix}{Appendix}{Appendices}%
+ \crefname{enumi}{Punt}{Punten}%
+ \crefname{footnote}{Voetnote}{Voetnoten}%
\crefname{figure}{Fig.}{Fig's.}%
\crefname{table}{Tabel}{Tabellen}%
\crefname{theorem}{Theorema}{Theorema's}%
- \crefname{enumi}{Punt}{Punten}%
\crefname{lemma}{Lemma}{Lemma's}%
\crefname{corollary}{Corollarium}{Corollaria}%
\crefname{proposition}{Bewering}{Beweringen}%
@@ -5791,10 +6297,11 @@
\crefname{chapter}{hoofdstuk}{hoofdstukken}%
\crefname{section}{paragraaf}{paragrafen}%
\crefname{appendix}{appendix}{appendices}%
+ \crefname{enumi}{punt}{punten}%
+ \crefname{footnote}{voetnote}{voetnoten}%
\crefname{figure}{fig.}{fig's.}%
\crefname{table}{tabel}{tabellen}%
\crefname{theorem}{theorema}{theorema's}%
- \crefname{enumi}{punt}{punten}%
\crefname{lemma}{lemma}{lemma's}%
\crefname{corollary}{corollarium}{corollaria}%
\crefname{proposition}{bewering}{beweringen}%
@@ -5838,10 +6345,11 @@
\Crefname@preamble{chapter}{Chapitre}{Chapitres}%
\Crefname@preamble{section}{Section}{Sections}%
\Crefname@preamble{appendix}{Appendice}{Appendices}%
+ \Crefname@preamble{enumi}{Point}{Points}%
+ \Crefname@preamble{footnote}{Note}{Notes}%
\Crefname@preamble{figure}{Figure}{Figures}%
\Crefname@preamble{table}{Tableau}{Tableaux}%
\Crefname@preamble{theorem}{Th\'eor\`eme}{Th\'eor\`emes}%
- \Crefname@preamble{enumi}{Point}{Points}%
\Crefname@preamble{lemma}{Lemme}{Lemmes}%
\Crefname@preamble{corollary}{Corollaire}{Corollaires}%
\Crefname@preamble{proposition}{Proposition}{Propositions}%
@@ -5854,10 +6362,11 @@
\crefname@preamble{chapter}{Chapitre}{Chapitres}%
\crefname@preamble{section}{Section}{Sections}%
\crefname@preamble{appendix}{Appendice}{Appendices}%
+ \crefname@preamble{enumi}{Point}{Points}%
+ \crefname@preamble{footnote}{Note}{Notes}%
\crefname@preamble{figure}{Figure}{Figures}%
\crefname@preamble{table}{Tableau}{Tableaux}%
\crefname@preamble{theorem}{Th\'eor\`eme}{Th\'eor\`emes}%
- \crefname@preamble{enumi}{Point}{Points}%
\crefname@preamble{lemma}{Lemme}{Lemmes}%
\crefname@preamble{corollary}{Corollaire}{Corollaires}%
\crefname@preamble{proposition}{Proposition}{Propositions}%
@@ -5871,10 +6380,11 @@
\crefname@preamble{chapter}{chapitre}{chapitres}%
\crefname@preamble{section}{section}{sections}%
\crefname@preamble{appendix}{appendice}{appendices}%
+ \crefname@preamble{enumi}{point}{points}%
+ \crefname@preamble{footnote}{note}{notes}%
\crefname@preamble{figure}{figure}{figures}%
\crefname@preamble{table}{tableau}{tableaux}%
\crefname@preamble{theorem}{th\'eor\`eme}{th\'eor\`emes}%
- \crefname@preamble{enumi}{point}{points}%
\crefname@preamble{lemma}{lemme}{lemmes}%
\crefname@preamble{corollary}{corollaire}{corollaires}%
\crefname@preamble{proposition}{proposition}{propositions}%
@@ -5910,16 +6420,17 @@
\Crefname{subappendix}{Appendice}{Appendices}%
\Crefname{subsubappendix}{Appendice}{Appendices}%
\Crefname{subsubsubappendix}{Appendice}{Appendices}%
- \Crefname{figure}{Figure}{Figures}%
- \Crefname{subfigure}{Figure}{Figures}%
- \Crefname{table}{Tableau}{Tableaux}%
- \Crefname{subtable}{Tableau}{Tableaux}%
- \Crefname{theorem}{Th\'eor\`eme}{Th\'eor\`emes}%
\Crefname{enumi}{Point}{Points}%
\Crefname{enumii}{Point}{Points}%
\Crefname{enumiii}{Point}{Points}%
\Crefname{enumiv}{Point}{Points}%
\Crefname{enumv}{Point}{Points}%
+ \Crefname{footnote}{Note}{Notes}%
+ \Crefname{figure}{Figure}{Figures}%
+ \Crefname{subfigure}{Figure}{Figures}%
+ \Crefname{table}{Tableau}{Tableaux}%
+ \Crefname{subtable}{Tableau}{Tableaux}%
+ \Crefname{theorem}{Th\'eor\`eme}{Th\'eor\`emes}%
\Crefname{lemma}{Lemme}{Lemmes}%
\Crefname{corollary}{Corollaire}{Corollaires}%
\Crefname{proposition}{Proposition}{Propositions}%
@@ -5938,16 +6449,17 @@
\crefname{subappendix}{Appendice}{Appendices}%
\crefname{subsubappendix}{Appendice}{Appendices}%
\crefname{subsubsubappendix}{Appendice}{Appendices}%
- \crefname{figure}{Figure}{Figures}%
- \crefname{subfigure}{Figure}{Figures}%
- \crefname{table}{Tableau}{Tableaux}%
- \crefname{subtable}{Tableau}{Tableaux}%
- \crefname{theorem}{Th\'eor\`eme}{Th\'eor\`emes}%
\crefname{enumi}{Point}{Points}%
\crefname{enumii}{Point}{Points}%
\crefname{enumiii}{Point}{Points}%
\crefname{enumiv}{Point}{Points}%
\crefname{enumv}{Point}{Points}%
+ \crefname{footnote}{Note}{Notes}%
+ \crefname{figure}{Figure}{Figures}%
+ \crefname{subfigure}{Figure}{Figures}%
+ \crefname{table}{Tableau}{Tableaux}%
+ \crefname{subtable}{Tableau}{Tableaux}%
+ \crefname{theorem}{Th\'eor\`eme}{Th\'eor\`emes}%
\crefname{lemma}{Lemme}{Lemmes}%
\crefname{corollary}{Corollaire}{Corollaires}%
\crefname{proposition}{Proposition}{Propositions}%
@@ -5966,16 +6478,17 @@
\crefname{subappendix}{appendice}{appendices}%
\crefname{subsubappendix}{appendice}{appendices}%
\crefname{subsubsubappendix}{appendice}{appendices}%
- \crefname{figure}{figure}{figures}%
- \crefname{subfigure}{figure}{figures}%
- \crefname{table}{tableau}{tableaux}%
- \crefname{subtable}{tableau}{tableaux}%
- \crefname{theorem}{th\'eor\`eme}{th\'eor\`emes}%
\crefname{enumi}{point}{points}%
\crefname{enumii}{point}{points}%
\crefname{enumiii}{point}{points}%
\crefname{enumiv}{point}{points}%
\crefname{enumv}{point}{points}%
+ \crefname{footnote}{note}{notes}%
+ \crefname{figure}{figure}{figures}%
+ \crefname{subfigure}{figure}{figures}%
+ \crefname{table}{tableau}{tableaux}%
+ \crefname{subtable}{tableau}{tableaux}%
+ \crefname{theorem}{th\'eor\`eme}{th\'eor\`emes}%
\crefname{lemma}{lemme}{lemmes}%
\crefname{corollary}{corollaire}{corollaires}%
\crefname{proposition}{proposition}{propositions}%
@@ -6013,10 +6526,11 @@
\Crefname@preamble{chapter}{Cap\'itulo}{Cap\'itulos}%
\Crefname@preamble{section}{Secci\'on}{Secciones}%
\Crefname@preamble{appendix}{Ap\'endice}{Ap\'endices}%
+ \Crefname@preamble{enumi}{Punto}{Puntos}%
+ \Crefname@preamble{footnote}{Nota}{Notas}%
\Crefname@preamble{figure}{Figura}{Figuras}%
\Crefname@preamble{table}{Cuadro}{Cuadros}%
\Crefname@preamble{theorem}{Teorema}{Teoremas}%
- \Crefname@preamble{enumi}{Punto}{Puntos}%
\Crefname@preamble{lemma}{Lema}{Lemas}%
\Crefname@preamble{corollary}{Corolario}{Corolarios}%
\Crefname@preamble{proposition}{Proposici\'on}{Proposiciones}%
@@ -6030,10 +6544,11 @@
\crefname@preamble{chapter}{Cap\'itulo}{cap\'itulos}%
\crefname@preamble{section}{Secci\'on}{secciones}%
\crefname@preamble{appendix}{Ap\'endice}{ap\'endices}%
+ \crefname@preamble{enumi}{Punto}{puntos}%
+ \crefname@preamble{footnote}{Nota}{Notas}%
\crefname@preamble{figure}{Figura}{figuras}%
\crefname@preamble{table}{Cuadro}{cuadros}%
\crefname@preamble{theorem}{Teorema}{teoremas}%
- \crefname@preamble{enumi}{Punto}{puntos}%
\crefname@preamble{lemma}{Lema}{lemas}%
\crefname@preamble{corollary}{Corolario}{corolarios}%
\crefname@preamble{proposition}{Proposici\'on}{proposiciones}%
@@ -6047,10 +6562,11 @@
\crefname@preamble{chapter}{cap\'itulo}{cap\'itulos}%
\crefname@preamble{section}{secci\'on}{secciones}%
\crefname@preamble{appendix}{ap\'endice}{ap\'endices}%
+ \crefname@preamble{enumi}{punto}{puntos}%
+ \crefname@preamble{footnote}{nota}{notas}%
\crefname@preamble{figure}{figura}{figuras}%
\crefname@preamble{table}{cuadro}{cuadros}%
\crefname@preamble{theorem}{teorema}{teoremas}%
- \crefname@preamble{enumi}{punto}{puntos}%
\crefname@preamble{lemma}{lema}{lemas}%
\crefname@preamble{corollary}{corolario}{corolarios}%
\crefname@preamble{proposition}{proposici\'on}{proposiciones}%
@@ -6086,16 +6602,17 @@
\Crefname{subappendix}{Ap\'endice}{Ap\'endices}%
\Crefname{subsubappendix}{Ap\'endice}{Ap\'endices}%
\Crefname{subsubsubappendix}{Ap\'endice}{Ap\'endices}%
- \Crefname{figure}{Figura}{Figuras}%
- \Crefname{subfigure}{Figura}{Figuras}%
- \Crefname{table}{Cuadro}{Cuadros}%
- \Crefname{subtable}{Cuadro}{Cuadros}%
- \Crefname{theorem}{Teorema}{Teoremas}%
\Crefname{enumi}{Punto}{Puntos}%
\Crefname{enumii}{Punto}{Puntos}%
\Crefname{enumiii}{Punto}{Puntos}%
\Crefname{enumiv}{Punto}{Puntos}%
\Crefname{enumv}{Punto}{Puntos}%
+ \Crefname{footnote}{Nota}{Notas}%
+ \Crefname{figure}{Figura}{Figuras}%
+ \Crefname{subfigure}{Figura}{Figuras}%
+ \Crefname{table}{Cuadro}{Cuadros}%
+ \Crefname{subtable}{Cuadro}{Cuadros}%
+ \Crefname{theorem}{Teorema}{Teoremas}%
\Crefname{lemma}{Lema}{Lemas}%
\Crefname{corollary}{Corolario}{Corolarios}%
\Crefname{proposition}{Proposici\'on}{Proposiciones}%
@@ -6114,16 +6631,17 @@
\crefname{subappendix}{Ap\'endice}{Ap\'endices}%
\crefname{subsubappendix}{Ap\'endice}{Ap\'endices}%
\crefname{subsubsubappendix}{Ap\'endice}{Ap\'endices}%
- \crefname{figure}{Figura}{Figuras}%
- \crefname{subfigure}{Figura}{Figuras}%
- \crefname{table}{Cuadro}{Cuadros}%
- \crefname{subtable}{Cuadro}{Cuadros}%
- \crefname{theorem}{Teorema}{Teoremas}%
\crefname{enumi}{Punto}{Puntos}%
\crefname{enumii}{Punto}{Puntos}%
\crefname{enumiii}{Punto}{Puntos}%
\crefname{enumiv}{Punto}{Puntos}%
\crefname{enumv}{Punto}{Puntos}%
+ \crefname{footnote}{Nota}{Notas}%
+ \crefname{figure}{Figura}{Figuras}%
+ \crefname{subfigure}{Figura}{Figuras}%
+ \crefname{table}{Cuadro}{Cuadros}%
+ \crefname{subtable}{Cuadro}{Cuadros}%
+ \crefname{theorem}{Teorema}{Teoremas}%
\crefname{lemma}{Lema}{Lemas}%
\crefname{corollary}{Corolario}{Corolarios}%
\crefname{proposition}{Proposici\'on}{Proposiciones}%
@@ -6142,16 +6660,17 @@
\crefname{subappendix}{ap\'endice}{ap\'endices}%
\crefname{subsubappendix}{ap\'endice}{ap\'endices}%
\crefname{subsubsubappendix}{ap\'endice}{ap\'endices}%
- \crefname{figure}{figura}{figuras}%
- \crefname{subfigure}{figura}{figuras}%
- \crefname{table}{cuadro}{cuadros}%
- \crefname{subtable}{cuadro}{cuadros}%
- \crefname{theorem}{teorema}{teoremas}%
\crefname{enumi}{punto}{puntos}%
\crefname{enumii}{punto}{puntos}%
\crefname{enumiii}{punto}{puntos}%
\crefname{enumiv}{punto}{puntos}%
\crefname{enumv}{punto}{puntos}%
+ \crefname{footnote}{nota}{notas}%
+ \crefname{figure}{figura}{figuras}%
+ \crefname{subfigure}{figura}{figuras}%
+ \crefname{table}{cuadro}{cuadros}%
+ \crefname{subtable}{cuadro}{cuadros}%
+ \crefname{theorem}{teorema}{teoremas}%
\crefname{lemma}{lema}{lemas}%
\crefname{corollary}{corolario}{corolarios}%
\crefname{proposition}{proposici\'on}{proposiciones}%
@@ -6197,10 +6716,11 @@
\Crefname@preamble{chapter}{Capitolo}{Capitoli}%
\Crefname@preamble{section}{Sezione}{Sezioni}%
\Crefname@preamble{appendix}{Appendice}{Appendici}%
+ \Crefname@preamble{enumi}{Voce}{Voci}%
+ \Crefname@preamble{footnote}{Nota}{Note}%
\Crefname@preamble{figure}{Figura}{Figure}%
\Crefname@preamble{table}{Tabella}{Tabelle}%
\Crefname@preamble{theorem}{Teorema}{Teoremi}%
- \Crefname@preamble{enumi}{Voce}{Voci}%
\Crefname@preamble{lemma}{Lemma}{Lemmi}%
\Crefname@preamble{corollary}{Corollario}{Corollari}%
\Crefname@preamble{proposition}{Proposizione}{Proposizioni}%
@@ -6214,10 +6734,11 @@
\crefname@preamble{chapter}{Capitolo}{Capitoli}%
\crefname@preamble{section}{Sezione}{Sezioni}%
\crefname@preamble{appendix}{Appendice}{Appendici}%
+ \crefname@preamble{enumi}{Voce}{Voci}%
+ \crefname@preamble{footnote}{Nota}{Note}%
\crefname@preamble{figure}{Fig.}{Fig.}%
\crefname@preamble{table}{Tabella}{Tabelle}%
\crefname@preamble{theorem}{Teorema}{Teoremi}%
- \crefname@preamble{enumi}{Voce}{Voci}%
\crefname@preamble{lemma}{Lemma}{Lemmi}%
\crefname@preamble{corollary}{Corollario}{Corollari}%
\crefname@preamble{proposition}{Proposizione}{Proposizioni}%
@@ -6231,10 +6752,11 @@
\crefname@preamble{chapter}{capitolo}{capitoli}%
\crefname@preamble{section}{sezione}{sezioni}%
\crefname@preamble{appendix}{appendice}{appendici}%
+ \crefname@preamble{enumi}{voce}{voci}%
+ \crefname@preamble{footnote}{nota}{note}%
\crefname@preamble{figure}{fig.}{fig.}%
\crefname@preamble{table}{tabella}{tabelle}%
\crefname@preamble{theorem}{teorema}{teoremi}%
- \crefname@preamble{enumi}{voce}{voci}%
\crefname@preamble{lemma}{lemma}{lemmi}%
\crefname@preamble{corollary}{corollario}{corollari}%
\crefname@preamble{proposition}{proposizione}{proposizioni}%
@@ -6270,16 +6792,17 @@
\Crefname{subappendix}{Appendice}{Appendici}%
\Crefname{subsubappendix}{Appendice}{Appendici}%
\Crefname{subsubsubappendix}{Appendice}{Appendici}%
- \Crefname{figure}{Figura}{Figure}%
- \Crefname{subfigure}{Figura}{Figure}%
- \Crefname{table}{Tabella}{Tabelle}%
- \Crefname{subtable}{Tabella}{Tabelle}%
- \Crefname{theorem}{Teorema}{Teoremi}%
\Crefname{enumi}{Voce}{Voci}%
\Crefname{enumii}{Voce}{Voci}%
\Crefname{enumiii}{Voce}{Voci}%
\Crefname{enumiv}{Voce}{Voci}%
\Crefname{enumv}{Voce}{Voci}%
+ \Crefname{footnote}{Nota}{Note}%
+ \Crefname{figure}{Figura}{Figure}%
+ \Crefname{subfigure}{Figura}{Figure}%
+ \Crefname{table}{Tabella}{Tabelle}%
+ \Crefname{subtable}{Tabella}{Tabelle}%
+ \Crefname{theorem}{Teorema}{Teoremi}%
\Crefname{lemma}{Lemma}{Lemmi}%
\Crefname{corollary}{Corollario}{Corollari}%
\Crefname{proposition}{Proposizione}{Proposizioni}%
@@ -6298,16 +6821,17 @@
\crefname{subappendix}{Appendice}{Appendici}%
\crefname{subsubappendix}{Appendice}{Appendici}%
\crefname{subsubsubappendix}{Appendice}{Appendici}%
- \crefname{figure}{Fig.}{Fig.}%
- \crefname{subfigure}{Fig.}{Fig.}%
- \crefname{table}{Tabella}{Tabelle}%
- \crefname{subtable}{Tabella}{Tabelle}%
- \crefname{theorem}{Teorema}{Teoremi}%
\crefname{enumi}{Voce}{Voci}%
\crefname{enumii}{Voce}{Voci}%
\crefname{enumiii}{Voce}{Voci}%
\crefname{enumiv}{Voce}{Voci}%
\crefname{enumv}{Voce}{Voci}%
+ \crefname{footnote}{Nota}{Note}%
+ \crefname{figure}{Fig.}{Fig.}%
+ \crefname{subfigure}{Fig.}{Fig.}%
+ \crefname{table}{Tabella}{Tabelle}%
+ \crefname{subtable}{Tabella}{Tabelle}%
+ \crefname{theorem}{Teorema}{Teoremi}%
\crefname{lemma}{Lemma}{Lemmi}%
\crefname{corollary}{Corollario}{Corollari}%
\crefname{proposition}{Proposizione}{Proposizioni}%
@@ -6326,16 +6850,17 @@
\crefname{subappendix}{appendice}{appendici}%
\crefname{subsubappendix}{appendice}{appendici}%
\crefname{subsubsubappendix}{appendice}{appendici}%
- \crefname{figure}{fig.}{fig.}%
- \crefname{subfigure}{fig.}{fig.}%
- \crefname{table}{tabella}{tabelle}%
- \crefname{subtable}{tabella}{tabelle}%
- \crefname{theorem}{teorema}{teoremi}%
\crefname{enumi}{voce}{voci}%
\crefname{enumii}{voce}{voci}%
\crefname{enumiii}{voce}{voci}%
\crefname{enumiv}{voce}{voci}%
\crefname{enumv}{voce}{voci}%
+ \crefname{footnote}{nota}{note}%
+ \crefname{figure}{fig.}{fig.}%
+ \crefname{subfigure}{fig.}{fig.}%
+ \crefname{table}{tabella}{tabelle}%
+ \crefname{subtable}{tabella}{tabelle}%
+ \crefname{theorem}{teorema}{teoremi}%
\crefname{lemma}{lemma}{lemmi}%
\crefname{corollary}{corollario}{corollari}%
\crefname{proposition}{proposizione}{proposizioni}%
@@ -6352,10 +6877,10 @@
%
% \subsubsection{Default Cross-Reference Formats}
% \label{sec:code:default_formats}
-% Setup default English format definitions, then process options in the
-% order they were supplied. However, the \option{capitalise} option must
-% be processed before the language options, so that it takes effect in
-% the default format definitions. Therefore, we have to manually check
+% Setup the default format definitions, then process options in the order
+% they were supplied. However, the \option{capitalise} option must be
+% processed before the language options, so that it takes effect in the
+% default format definitions. Therefore, we have to manually check
% whether it's present, and force processing of it before the other
% options.
% \begin{macrocode}
@@ -6381,7 +6906,8 @@
\AtBeginDocument{%
% \end{macrocode}
% Use whatever's in the \dots|@preamble| definitions at the beginning of
-% the document to set up the default cross-reference names.
+% the document to set up the default cross-reference names, unless
+% overridden by explicit definitions.
% \begin{macrocode}
\edef\@tmpa{%
\expandafter\noexpand\csname extras\cref@language\endcsname}%
@@ -6558,14 +7084,31 @@
\expandafter\expandafter\expandafter\cref@addto%
\expandafter\@tmpb\expandafter{\@tmpc}%
}%
+% \end{macrocode}
+% We only define the reference-range and multi-reference formats if the
+% plural form of the name is defined in the corresponding
+% \cmd{\cref\meta{type}@name@plural}. Though \cmd{\crefname} and
+% \cmd{\Crefname} always define both the singular and plural forms
+% together, cross-reference names can also be defined automatically by
+% \cmd{\newtheorem}, which can only define the singular form. In this
+% case, the singular form might be defined whilst the plural form is
+% undefined. For symmetry, we apply the same logic to the normal
+% cross-reference format definition (only defining it if
+% \cmd{\cref\meta{type}@name} is defined), though currently this should
+% always be the case.
+% \begin{macrocode}
\@ifundefined{cref@\@tmpa @format}{%
- \expandafter\@crefdefineformat\expandafter{\@tmpa}}{}%
+ \@ifundefined{cref@\@tmpa @name}{}{%
+ \expandafter\@crefdefineformat\expandafter{\@tmpa}}}{}%
\@ifundefined{crefrange@\@tmpa @format}{%
- \expandafter\@crefrangedefineformat\expandafter{\@tmpa}}{}%
+ \@ifundefined{cref@\@tmpa @name@plural}{}{%
+ \expandafter\@crefrangedefineformat\expandafter{\@tmpa}}}{}%
\@ifundefined{cref@\@tmpa @format@first}{%
- \expandafter\@crefdefinemultiformat\expandafter{\@tmpa}}{}%
+ \@ifundefined{cref@\@tmpa @name@plural}{}{%
+ \expandafter\@crefdefinemultiformat\expandafter{\@tmpa}}}{}%
\@ifundefined{crefrange@\@tmpa @format@first}{%
- \expandafter\@crefrangedefinemultiformat\expandafter{\@tmpa}}{}%
+ \@ifundefined{cref@\@tmpa @name@plural}{}{%
+ \expandafter\@crefrangedefinemultiformat\expandafter{\@tmpa}}}{}%
\cref@stack@pop{\@tmpstack}%
\cref@isstackfull{\@tmpstack}}%
% \end{macrocode}
@@ -6697,7 +7240,6 @@
% \end{macrocode}
% Similarly for subsections within appendices.
% \begin{macrocode}
-% \begin{macrocode}
\@ifundefined{cref@subappendix@format}{%
\let\cref@subappendix@format%
\cref@appendix@format}{}%
@@ -6944,7 +7486,6 @@
\let\Crefrange@subfigure@format@last%
\Crefrange@figure@format@last}{}%
%
-% \begin{macrocode}
\@ifundefined{cref@subtable@format}{%
\let\cref@subtable@format%
\cref@table@format}{}%
@@ -7008,7 +7549,6 @@
% \end{macrocode}
% Ditto for enums.
% \begin{macrocode}
-% \begin{macrocode}
\@ifundefined{cref@enumii@format}{%
\let\cref@enumii@format%
\cref@enumi@format}{}%
@@ -7070,7 +7610,6 @@
\let\Crefrange@enumii@format@last%
\Crefrange@enumi@format@last}{}%
%
-% \begin{macrocode}
\@ifundefined{cref@enumiii@format}{%
\let\cref@enumiii@format%
\cref@enumii@format}{}%
@@ -7255,7 +7794,7 @@
\Crefrange@enumiv@format@last}{}%
%
\let\cref@language\relax%
-}
+}% end of \AtBeginDocument
% \end{macrocode}
%
%
@@ -7266,5 +7805,6 @@
%%% Local Variables:
%%% mode: doctex
+%%% fill-column: 73
%%% TeX-master: t
%%% End: