summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/cleveref/cleveref.dtx')
-rw-r--r--Master/texmf-dist/source/latex/cleveref/cleveref.dtx731
1 files changed, 506 insertions, 225 deletions
diff --git a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
index 7cfef5ae041..7a54e2e2798 100644
--- a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
+++ b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
@@ -1,5 +1,5 @@
-\def\packagedate{2012/02/15}
-\def\packageversion{0.18.4}
+\def\packagedate{2012/03/07}
+\def\packageversion{0.18.5}
% \iffalse meta-comment
%
% Package 'cleveref' to use with LaTeX2e
@@ -56,7 +56,7 @@
%</driver>
% \fi
%
-% \CheckSum{18194}
+% \CheckSum{18436}
%% \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
@@ -172,7 +172,7 @@
% \textbackslash{}crefname definitions for subsection, subsubsection
% etc. in terms of those for section, so that \textbackslash{}namecref
% works for those (and also switching language in the middle of a
-% document). Added \package{babel} support for Russian and Ukranian.
+% document). Added \package{babel} support for Russian and Ukrainian.
% Fixed bug in \textbackslash{}refstepcounter@optarg.}
% \changes{v0.17}{2010/06/07}{Fixed bug in non-\package{hyperref}
% version of \textbackslash{}refstepcounter. Added
@@ -255,9 +255,9 @@
% of \package{caption} package.}
% \changes{v0.18.2}{2012/01/17}{Don't try to redefine
% \textbackslash{}appendix if it's not defined in current document
-% class. Fixed bug in \textbackslash{}\@setnamecref. Refactored common
+% class. Fixed bug in \textbackslash{}@setnamecref. Refactored common
% code in format-definition macros into separate
-% \textbackslash{}\cref@othervariant macro. Added
+% \textbackslash{}cref@othervariant macro. Added
% \package{IEEEtrantools} support.}
% \changes{v0.18.3}{2012/01/18}{Fixed bugs with multiple equations and
% subequations in an \textbackslash{}IEEEeqnarray.}
@@ -266,6 +266,11 @@
% \textbackslash{}@currentlabel is set. Fix \package{xr} compatibility
% by adding a ``cref'' suffix to \package{cleveref}'s internal label
% names, instead of a prefix.}
+% \changes{v0.18.5}{2012/03/05}{Fix \package{listings} and
+% \package{algorithm} package support, broken by change to local rather
+% than global \textbackslash{}cref@currentlabel definitions. Fixed
+% compatibility with \package{memoir}'s internal \package{subfig}
+% re-implementation.}
%
% \GetFileInfo{cleveref.sty}
%
@@ -295,7 +300,7 @@
% Normally, the latest version of the \package{cleveref} package is
% available via CTAN.\ Occasionally, slightly newer ``pre-release''
% versions are available at \url{www.dr-qubit.org/latex.php#cleveref} a
-% little bit before they make their way onto CTAN.
+% little before they make their way onto CTAN.
% \end{abstract}
%
% \clearpage
@@ -323,26 +328,26 @@
% according to the type of thing they refer to (chapter, section,
% equation, theorem, etc.) and the context in which the cross-reference
% is used. It can automatically format cross-references to multiple
-% labels, sort lists of multiple cross-references, compress references to
-% consecutive labels into a reference range, and all kinds of other
-% clever wizardry. It also does similar things with page references.
+% labels, sort lists of multiple cross-references, compress consecutive
+% labels into a reference range, and all kinds of other clever wizardry.
+% It also does similar things with page references.
%
% In standard \LaTeX{}, you have almost certainly found yourself writing
% 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 typeset
% as |Equation~\ref{eq1}| instead (i.e.\ without the abbreviation and
-% 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|, meaning that references to the
-% sequence of theorems 1 through 3 should now be ordered
+% without the parentheses)? 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|, meaning that references to
+% the sequence of theorems 1 through 3 should now 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}|? Any such change requires you 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!
+% formatting of references to multiple theorems.
%
% The \package{cleveref} package allows you to define the format for the
% different types of cross-references once-and-for-all in the preamble of
@@ -380,11 +385,11 @@
% the thing you're referencing in front of the |\cref| command, because
% \package{cleveref} will sort that out for you: i.e.\ use |\cref{eq1}|
% instead of |eq.~(\ref{eq1})|. If you want to refer to a range of
-% labels, use the |\crefrange| command: |\crefrange{eq1}{eq5}| gives
+% labels, use the |\crefrange| command: |\crefrange{eq1}{eq5}| produces
% |eqs.~(1) to~(5)|. If you want to refer to multiple things at once, you
% can simply throw them all into one cross-reference and leave
% \package{cleveref} to sort it out: e.g.\
-% |\cref{eq2,eq1,eq3,eq5,thm2,def1}| produces:%
+% |\cref{eq2,eq1,eq3,eq5,thm2,def1}| produces%
% |eqs.~(1) to~(3) and~(5),| |theorem~5, and definition~1|. Finally, if
% you want a page reference, use |\cpageref| (and don't write ``page'' in
% front), if you want a page range, use |\cpagerefrange|, and if you want
@@ -398,13 +403,13 @@
% pass it as a global option to |\documentclass|. Note that if you're
% writing in a language in which nouns decline, the |\cref| and
% |\cpageref| commands may be less useful, as they always produce the
-% cross-reference name in the nominative case.\footnote{Trying to
-% determine the appropriate case automatically would be tantamount to
-% solving the full natural-language processing problem in
-% \package{cleveref}. Check back in a century or so. Providing separate
-% variants of the \package{cleveref} commands for each noun case quickly
-% becomes more cumbersome than just typing the cross-reference name by
-% hand.} In such languages, you may instead prefer to use the
+% cross-reference name in the nominative case.\footnote{Providing
+% separate variants of the \package{cleveref} commands for each noun case
+% quickly becomes more cumbersome than just typing the cross-reference
+% name by hand. Trying to determine the appropriate case automatically
+% would be tantamount to solving the full natural-language processing
+% problem in \package{cleveref}. Check back in a century or so for this
+% feature.} In such languages, you may instead prefer to use the
% |\labelcref| and |\labelcpageref| commands. Unlike |\cref| and
% |\cpageref|, these don't produce the name in front of the
% cross-reference, so you must supply it (in the appropriate case)
@@ -415,7 +420,7 @@
%
% \section{Comparison with Other Packages}
% Given how useful automated cross-reference typesetting is, there are
-% naturally a number of other packages with similar goals to
+% naturally a number of other \LaTeX{} packages with similar goals to
% \package{cleveref}, most notably \package{varioref},
% \package{fancyref}, \package{hyperref}'s |\autoref| command, and (for
% theorem-like environments) \package{ntheorem} (with the \option{thref}
@@ -443,8 +448,8 @@
% 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}. For
-% example, you may want to use the abbreviation ``eq.'', but revert to
+% cross-reference text, it is impossible using \package{varioref}. E.g.\
+% you may want to use the abbreviation ``eq.'', but revert to
% ``Equation'' at the beginning of sentences (words at the start of
% sentences shouldn't be abbreviated in English). This is not possible
% with \package{varioref}. Perhaps even more significantly,
@@ -454,8 +459,8 @@
% typing |Eqs.~(\ref{eq1}) to~(\ref{eq3})| by hand. Not to mention
% missing out on all the other \package{cleveref} features. In fact,
% \package{cleveref} fully supports \package{varioref}, taking over
-% responsibility for typesetting cross-references, whilst retaining all
-% the \package{varioref} page-referencing magic.
+% responsibility for typesetting cross-references, whilst retaining (and
+% even enhancing) all the \package{varioref} page-referencing magic.
%
% The \package{hyperref} package's |\autoref| command typesets a name
% before a cross-reference, determined by the cross-reference type. This
@@ -472,8 +477,8 @@
% things right with regards to how and when the format is defined\ldots
% except that it only works for theorem-like environments. It is possible
% to use it for other environments, but only in a bastardized form, by
-% manually supplying an optional argument to |\label| commands that
-% specifies the label type. \package{Cleveref} works equally well when
+% manually supplying an optional argument to every |\label| command,
+% specifying the label type. \package{Cleveref} works equally well when
% referencing any type of thing, as well as fully supporting
% \package{ntheorem}. And again, \package{cleveref} provides a number of
% additional features over \package{ntheorem}, such as multi-references,
@@ -838,8 +843,8 @@
% \cref{sec:typesetting,sec:other_packages}.)
%
% Note that the default format for equation cross-references already
-% overrides |\crefdefaultlabelformat| in order to surround the label
-% by brackets, so the redefining |\crefdefaultlabelformat| will have no
+% overrides |\crefdefaultlabelformat| in order to surround the label with
+% parentheses, so the redefining |\crefdefaultlabelformat| will have no
% effect on equations. The label format for equations must be customised
% separately if you want to change it (see
% \cref{sec:individual_customisation}).
@@ -872,7 +877,7 @@
% \DescribeMacro\crefrangepreconjunction
% \DescribeMacro\crefrangepostconjunction
% There are two other ``conjunction'' commands available for customizing
-% the formating for reference ranges. These are
+% the formatting for reference ranges. These are
% |\crefrangepreconjunction| and |\crefrangepostconjunction|, which
% insert text before the first label defining the range, and after the
% second label, respectively. For example, when these commands are
@@ -1146,7 +1151,7 @@
% \begin{quote}
% Eq.~(\meta{counter})
% \end{quote}
-% with the counter (excluding the brackets) forming the hyperlink.
+% with the counter (excluding the parentheses) forming the hyperlink.
%
% Note that the hyperlink arguments are \emph{not} letters, so if |#2|
% appears at the beginning of \meta{format}, \package{cleveref} will not
@@ -1196,7 +1201,7 @@
% \begin{quote}
% eqs.~(\meta{counter1}) to~(\meta{counter2})
% \end{quote}
-% with the counters (excluding the brackets) forming the hyperlinks.
+% with the counters (excluding the parentheses) forming the hyperlinks.
%
%
% \subsubsection{Multiple Cross-References}
@@ -1600,11 +1605,12 @@
%
%
%
-% \section{Known Bugs and Possible Improvements}
+% \section{Known Bugs, Non-Bugs, and Possible Future Enhancements}
% \label{sec:known_bugs}
%
-% \subsection{Known Bugs, Non-Bugs, and Work-Arounds}
-% In no particular order:
+% \subsection{Non-Bugs}
+% The following are \emph{not} bugs. They are either intentional
+% behaviour, or are caused by \LaTeX{} misunderstandings:
% \begin{itemize}
% \item If you are using both \package{varioref} and \package{hyperref},
% \emph{make sure you are loading them in the correct order}, otherwise
@@ -1617,14 +1623,16 @@
% \package{babel}. Passing it to \package{babel} alone is \emph{not}
% sufficient (you will get the default English cross-reference
% formats). The best way to set the document language is as a global
-% option in the |\documentclass| line.
+% option in the |\documentclass| line. (This is standard \LaTeX{} and
+% \package{babel} practice -- read up on \LaTeX{}'s option handling for
+% more detail.)
% \item \package{cleveref} will not work properly with the standard
% \LaTeX{} |eqnarray| environment. There is no intention to fix this.
% The |eqnarray| environment is poorly implemented, making it difficult
-% to get it to work properly with \package{cleveref}. You're better off
-% using the \package{amsmath} replacements in any case, such as
-% |gather|, |align|, |multline| and |split|, which \emph{do} work
-% properly with \package{cleveref}. (See
+% to get it to work properly with \package{cleveref}, and it's broken
+% any way. You're \emph{far} better off using the \package{amsmath}
+% replacements, such 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} can't cope with active characters being
% present in cross-reference label names. For example, if French
@@ -1634,6 +1642,25 @@
% solution is to avoid using active characters in label names. (You may
% need to consult the \package{babel} documentation to discover which
% active characters are defined in your language.)
+% \item The \option{poorman} |sed| script loses any custom
+% \package{cleveref} hyperlink formatting you might have defined, and
+% does not always reproduce the original spacing around the
+% \package{varioref} commands when \package{varioref} is used. This is
+% not a bug; it is a side-effect of the intended purpose of the
+% \option{poorman} option. The philosophy behind \option{poorman} is to
+% replace \package{cleveref}'s enhanced cross-referencing with standard
+% \LaTeX{} cross-reference commands that are guaranteed to work with
+% any standard \LaTeX{} installation. Although it would be simple to
+% fix these ``bugs'', it's almost certainly impossible without using
+% low-level \LaTeX{} code that is unlikely to be supported by e.g.\
+% academic journals, thereby defeating the whole purpose of the
+% \option{poorman} option.
+% \end{itemize}
+%
+%
+% \subsection{Known Bugs and Work-Arounds}
+% In rough order of significance:
+% \begin{itemize}
% \item When both the \package{amsmath} \emph{and} \package{hyperref}
% packages are loaded at the same time, the \package{cleveref}
% cross-referencing commands do not work when used within section
@@ -1652,17 +1679,28 @@
% uses to produce the page references in its enhanced |\vref| command.
% (This \emph{might} be improved in a future version by partially
% overriding \package{hyperref}.)
+% \item Due to the way \TeX{} parses arguments, you have to be a little
+% careful when using |\label| inside an optional argument to another
+% command. |\label|\marg{label} will work, but trying to pass an
+% optional argument |\label|\oarg{type}\marg{label} will fail. If you
+% want to pass an optional argument to |\label| whilst already within
+% an optional argument to some other command, you must surround the
+% entire label command with braces:
+% |{\label|\oarg{type}\marg{label}|}|. This crops up e.g.\ when adding
+% labels to subfigure subcaptions in the \package{memoir} document
+% class. A simpler solution in this particular case is to define the
+% label in the subfigure body, instead of in the subcaption.
% \item \package{cleveref} doesn't know about the \package{subfloat}
% package, so you have to revert to using |\ref| for cross-references
-% to sub-figures. (This will be fixed in a future version.)
+% to sub-figures. (To be fixed in a future version.)
% \item The \package{beamer} document class redefines the |\label|
% command in a particularly devious way that breaks
-% \package{cleveref}'s optional argument to that command. (This will be
-% fixed in a future version.)
+% \package{cleveref}'s optional argument to that command. (To be fixed
+% in a future version.)
% \item \package{cleveref} is incompatible with the \option{showonlyrefs}
% option of the \package{mathtools} package, though it should be
-% compatible with the rest of \package{mathtools}. (This will be fixed
-% in a future version.)
+% compatible with the rest of \package{mathtools}. (To be fixed in a
+% future version.)
% \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
@@ -1673,23 +1711,10 @@
% 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 The \option{poorman} |sed| script loses any custom
-% \package{cleveref} hyperlink formatting you might have defined, and
-% does not always reproduce the original spacing around the
-% \package{varioref} commands when \package{varioref} is used. This is
-% not a bug; it is a side-effect of the intended purpose of the
-% \option{poorman} option. The philosophy behind \option{poorman} is to
-% replace \package{cleveref}'s enhanced cross-referencing with standard
-% \LaTeX{} cross-reference commands that are guaranteed to work with
-% any standard \LaTeX{} installation. Although it would be simple to
-% fix these ``bugs'', it's almost certainly impossible without using
-% low-level \LaTeX{} code that is unlikely to be supported by academic
-% journals, for example, thereby defeating the whole purpose of the
-% \option{poorman} option.
% \end{itemize}
%
%
-% \subsection{Possible New Features and Other Improvements}
+% \subsection{Possible New Features and Improvements}
% In no particular order:
% \begin{itemize}
% \item The \option{poorman} option could be enhanced to allow a choice
@@ -1710,18 +1735,19 @@
% contributing code and translations. Thanks to Michael Ummels for
% contributing the \package{amsthm} support code, and to Stefan Pinnow,
% Gonzalo Medina, Massimo Redaelli, Philip H\"olzenspies, Aleksander
-% Gorohovski and Benjamin H{\o}yer for contributing translations. Thanks
-% also to Susanna Goldschmidt for additional help with the translations.
-% Many people have suggested improvements or reported bugs, indeed many
-% have put significant effort into helping investigate and fix them. So
-% thanks (in alphabetical order) to: Alan Munn, Aleksander Gorohovski,
-% Anand Deopurkar, Arne Meier, Bas Ploeger, Dan Luecking, David Gleich,
-% Denis Bitouz\'e, Domenic Denicola, Donald Arseneau, Hendrik Maryns,
-% Iain Cunningham, James Sharam, Jens Mueller, Joel C. Salomon, Joris
-% Pinkse, Kristian Debrabant, Leo Shidai Liu, Lev Bishop, Mak Trifkovic,
-% Matej Batic, Matt Gately, Matthew Skala, Michael Barber, Michael
-% Gorven, Michal Kaut, Mico Loretan, Olivier Roy, Patrick H\"acker, Paul
-% Gomme, Ricardo de Aldama S\'anchez, Robert Fischer, Stefan Pinnow, Ted
+% Gorohovski, Benjamin H{\o}yer and Johannes Mueller for contributing
+% translations. Thanks also to Susanna Goldschmidt for additional help
+% with the translations. Many people have suggested improvements or
+% reported bugs, indeed many have put significant effort into helping
+% investigate and fix them. So thanks (in alphabetical order) to: Alan
+% Munn, Aleksander Gorohovski, Anand Deopurkar, Andreas Haselbacher, Arne
+% Meier, Bas Ploeger, Dan Luecking, David Gleich, Denis Bitouz\'e,
+% Domenic Denicola, Donald Ars\-en\-eau, Hendrik Maryns, Iain Cunningham,
+% James Sharam, Jens Mueller, Joel C. Salomon, Joris Pinkse, Kristian
+% Debrabant, Leo Shidai Liu, Lev Bishop, Mak Trifkovic, Matej Batic, Matt
+% Gately, Matthew Skala, Michael Barber, Michael Gorven, Michal Kaut,
+% Mico Loretan, Olivier Roy, Patrick H\"acker, Paul Gomme, Ricardo de
+% Aldama S\'anchez, Robert Fischer, Stefan Pinnow, Steve Dower, Ted
% Pavlic, Thomas Arildsen, and Uwe L\"uck for their help. (If I missed
% you out, please let me know!)
%
@@ -1779,7 +1805,7 @@
% 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
-% cross-reference ``type'' stored in \cmd{cref@currentlabel} is usually
+% cross-reference ``type'' stored in \cmd{\cref@currentlabel} is usually
% inferred from the counter. This can be overridden by aliasing the
% counter name to a different type using \cmd{\crefalias}. The new
% \cmd{\refstepcounter} can also take an optional argument, which
@@ -1819,7 +1845,7 @@
% labels each time it's called: the standard one, and an additional
% \package{cleveref}-specific one with the suffix |@cref| added to the
% label name, which contains the extra information from
-% \cmd{cref@currentlabel}. We call the original \cmd{\label} command,
+% \cmd{\cref@currentlabel}. We call the original \cmd{\label} command,
% stored in \cmd{\cref@old@label}, to write the standard label to the
% \file{aux} file. However, to avoid other packages messing around with
% the content of the parallel set of \package{cleveref}-specific
@@ -1884,7 +1910,7 @@
% \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
+% theorem-like environments (\package{ntheorem}'s \option{thref} 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
@@ -2839,7 +2865,7 @@
% the counter and prefix (i.e.\ formatted version of the counter that
% resets the label's counter) information provided by
% \cmd{\r@\meta{label}@cref} (via the \file{aux} file) to check if the
-% prefices are identical (i.e.\ the references come from the same
+% prefixes are identical (i.e.\ the references come from the same
% chapter, section or whatever), and that the label counters differ
% by~0 or~1.
% \begin{macrocode}
@@ -3576,7 +3602,7 @@
%
% \begin{macro}{\@setnamecref}
% \cmd{\@setnamecref} is the real macro underlying all the
-% \cmd{namecref} commands.
+% \cmd{\namecref} commands.
% \begin{macrocode}
\def\@setnamecref#1#2#3#4{%
\expandafter\ifx\csname r@#2@cref\endcsname\relax%
@@ -4044,7 +4070,7 @@
\cref@othervariant{#1}{\@tempc}{\@tempd}%
\@ifundefined{\@tempc @#2@name#5}{%
% \end{macrocode}
-% Define \cmd{\@tempa} and \cmd{@tmpb} to be partial expansions (expanded
+% Define \cmd{\@tempa} and \cmd{\@tempb} to be partial expansions (expanded
% just once) of the macros for the capitalisation variant we've just
% defined above.
% \begin{macrocode}
@@ -4984,7 +5010,7 @@
% \package{hyperref} (via the \file{aux} file). Note that
% \package{hyperref} adds the hyperlink information to the standard
% \cmd{\newlabel} line in the \file{aux} file, so we have to retrieve
-% it from the standard \cmd{r@\meta{label}}, \emph{not} the one
+% it from the standard \cmd{\r@\meta{label}}, \emph{not} the one
% suffixed with |@cref| that we've created ourselves.
% \begin{macrocode}
\def\cref@hyperref#1{\expandafter\expandafter\expandafter%
@@ -4996,7 +5022,7 @@
% The \package{hyperref} package stores the original
% \cmd{\refstepcounter} definition as\linebreak[4]
% \cmd{\H@refstepcounter}. Unfortunately, it plasters
-% \cmd{H@refstepcounter} all over the place, sometimes bypassing
+% \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}.
@@ -5310,7 +5336,7 @@
}% end of false case of \@ifpackagewith{hyperref}{implicit=false}
% \end{macrocode}
%
-% The \package{revtex4-1} and \package{revtex4-1} document classes use
+% The \package{revtex4} and \package{revtex4-1} document classes use
% |\H@refstepcounter| to increment section counters, even when
% \package{hyperref} isn't explicitly loaded. Therefore, for these
% docclasses we need to redefine |\H@refstepcounter| even when
@@ -5359,7 +5385,7 @@
% To allow \cmd{\label} within equations to support an optional
% argument, we first store the original \cmd{\label@in@display} and the
% new \cmd{\label} macro we defined above (since \cmd{\label} will be
-% clobbered inside equations). Then we redefine \cmd{label@in@display}
+% clobbered inside equations). Then we redefine \cmd{\label@in@display}
% so that it wraps all its arguments, including any optional argument,
% in an extra set of braces. These are stripped away again by
% \cmd{\ltx@label} before calling the \package{cleveref} \cmd{\label}
@@ -5811,7 +5837,7 @@
% \end{macro}
%
% \begin{macro}{\IEEEyessubnumber}
-% And again for \cmd{IEEEyessubnumber} (used to turn an equation into a
+% And again for \cmd{\IEEEyessubnumber} (used to turn an equation into a
% subequation).
% \begin{macrocode}
\let\cref@orig@IEEEyessubnumber\IEEEyessubnumber
@@ -6550,10 +6576,10 @@
% \end{macrocode}
%
% \begin{macro}{\ALG@step}
-% We modify \package{algorithm}'s \cmd{ALG@step} macro, which
+% We modify \package{algorithm}'s \cmd{\ALG@step} macro, which
% increments the line number, so that it stores the necessary
-% information in \cmd{\cref@currentlabel}. \cmd{ALG@step} already
-% increments the line number counter \cmd{ALG@line} using
+% information in \cmd{\cref@currentlabel}. \cmd{\ALG@step} already
+% increments the line number counter \cmd{\ALG@line} using
% \cmd{\addtocounter}, but to get \package{cleveref} support working,
% it's cleaner to hook into the \cmd{\refstepcounter} mechanism, so we
% first decrement the counter and then re-increment it using
@@ -6563,7 +6589,25 @@
\def\ALG@step{%
\cref@old@ALG@step%
\addtocounter{ALG@line}{-1}%
- \refstepcounter[line]{ALG@line}}
+ \refstepcounter{ALG@line}%
+ \expandafter\@cref@getprefix\cref@currentlabel\@nil\cref@currentprefix%
+ \xdef\cref@currentprefix{\cref@currentprefix}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ALG@beginalgorithmic}
+% However, this is not yet sufficient. The \cmd{\refstepcounter} above
+% is called within a group, so the resulting \cmd{\cref@currentlabel}
+% definition will not persist beyond the end of the group. To transfer
+% the information to the ``outside'', we follow \package{algorithm}'s
+% own method for getting the label information into
+% \cmd{\@currentlabel}: we define \cmd{\cref@currentlabel} within
+% |algorithm| environments to refer specifically to macros that store
+% the line number information.
+% \begin{macrocode}
+ \g@addto@macro\ALG@beginalgorithmic{%
+ \def\cref@currentlabel{%
+ [line][\arabic{ALG@line}][\cref@currentprefix]\theALG@line}}
}{}% end of \@ifpackageloaded{algorithm}
% \end{macrocode}
% \end{macro}
@@ -6572,28 +6616,56 @@
%
% \subsubsection{\package{listings} support}
% \begin{macro}{listings}
-% The only thing we need to do in order to support cross-references to
-% line numbers and listings produced by the \package{listings} package
-% is to alias the counters it uses, \cmd{lstnumber} and
-% \cmd{lstlistings}, to the ``line'' and ``listing'' cross-reference
-% types.
+% To support cross-references to listings produced by the
+% \package{listings} package, all we need to do is alias the counter it
+% uses, \cmd{\lstnumber}, to the ``listing'' cross-reference type.
% \begin{macrocode}
\@ifpackageloaded{listings}{%
\PackageInfo{cleveref}{`listings' support loaded}
- \crefalias{lstnumber}{line}%
\crefalias{lstlisting}{listing}%
+ \crefalias{lstnumber}{line}%
+% \end{macrocode}
+%
+% However, supporting cross-references to the line numbers is
+% unfortunately a little more complicated than simply aliasing the
+% ``lstnumber'' counter to the ``line'' cross-reference type (above).
+% \package{listings} calls \cmd{\refstepcounter} from its
+% \cmd{\lsthk@EveryPar} hook. But the hook macro is expanded inside a
+% group. So that \cmd{\refstepcounter} call is completely useless:
+% neither the \cmd{\@currentlabel} nor the \cmd{\cref@currentlabel}
+% definitions make it out of the group, so they have no effect on
+% \cmd{\label} definitions!
+%
+% To make line labels work, \package{listings} sets \cmd{\@currentlabel}
+% to \cmd{\thelstnumber} at the beginning of a listing, via the
+% \cmd{\lsthk@Init} hook, and it is \emph{this} (and not
+% \cmd{\refstepcounter}) which causes the current line number to be
+% picked up by \cmd{\label}s. To get line numbers working with
+% \package{cleveref} too, we need to replicate this for
+% \cmd{\cref@currentlabel}, which is what the following hook code does.
+%
+% \begin{macro}{\lsthk@Init}
+% \begin{macro}{\lsthk@EveryPar}
+% \begin{macrocode}
+ \lst@AddToHook{Init}{%
+ \def\cref@currentlabel{%
+ [line][\arabic{lstnumber}][\cref@currentprefix]\thelstnumber}}
+ \lst@AddToHook{EveryPar}{%
+ \expandafter\@cref@getprefix\cref@currentlabel\@nil\cref@currentprefix%
+ \xdef\cref@currentprefix{\cref@currentprefix}}
}{}% end of \@ifpackageloaded{listings}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
%
%
% \subsubsection{\package{algorithm2e} support}
% \begin{macro}{algorithm2e}
-% Similarly, all we need to do to support the \package{algorithm2e}
-% package is to alias \emph{its} counters, \cmd{algocf} and
-% \cmd{algocfline}, to the ``algorithm and ``line'' cross-reference
-% types.
+% All we need to do to support the \package{algorithm2e} package is to
+% alias \emph{its} counters, \cmd{\algocf} and \cmd{\algocfline}, to
+% the ``algorithm'' and ``line'' cross-reference types.
% \begin{macrocode}
\@ifpackageloaded{algorithm2e}{%
\PackageInfo{cleveref}{`algorithm2e' support loaded}
@@ -6610,7 +6682,7 @@
% The \package{subfig} package modifies \cmd{\refstepcounter} within
% floats. Most of the time, this isn't a problem for
% \package{cleveref}, as \package{subfig}'s modified
-% \cmd{refstepcounter} calls \package{cleveref}'s version after it's
+% \cmd{\refstepcounter} calls \package{cleveref}'s version after it's
% done its stuff. However, this breaks support the
% \cmd{\refstepcounter} optional argument, so we fix that here.
%
@@ -6626,7 +6698,7 @@
% \cmd{\refsteponlycounter} within floats, which calls the saved
% \package{cleveref} \cmd{\refstepcounter} after doing some extra
% \package{subfig}-related processing. We redefine
-% \cmd{refsteponlycounter} so that passing it an optional argument
+% \cmd{\refsteponlycounter} so that passing it an optional argument
% bypasses \package{subfig}'s code entirely and just calls the
% \package{cleveref} code directly. Since only
% \package{cleveref}-specific commands will ever pass an optional
@@ -6645,6 +6717,8 @@
% \end{macro}
%
% \begin{macro}{\sf@sub@label}
+% \begin{macro}{\sf@old@label}
+% \begin{macro}{\cref@old@label}
% Inside a subfloat, \package{subfig} captures the current \cmd{\label}
% definition in \cmd{\sf@oldlabel}, then replaces \cmd{\label} with
% \cmd{\subfloat@label}, which does additional argument and
@@ -6655,21 +6729,21 @@
% redefined \cmd{\label} macro calls, to process \package{cleveref}'s
% optional argument. We do this by redefining \package{subfig}'s
% \cmd{\sf@sub@label} command to process \package{subfig}'s optional
-% argument (which uses brackets rather than square brackets) as usual,
-% but then have it call \cmd{cref@label} which stores
+% argument (which uses parentheses rather than square brackets) as usual,
+% but then have it call \cmd{\cref@label} which stores
% \package{cleveref}'s \cmd{\label} command (recall that we're inside a
% subfloat here, where \package{subfig} has overridden the \cmd{\label}
-% macro itself), to process \package{cleveref}'s own \cmd{label}
+% macro itself), to process \package{cleveref}'s own \cmd{\label}
% optional argument.
%
-% \cmd{cref@label} would normally call the original \cmd{\label}
+% \cmd{\cref@label} would normally call the original \cmd{\label}
% definition stored in \cmd{\cref@old@label}, whereas here we want it
-% to instead call \cmd{sf@@sub@label}, the next layer of the
+% to instead call \cmd{\sf@@sub@label}, the next layer of the
% \package{subfig} \cmd{\label} macro stack, otherwise we bypass the
% rest of the \package{subfig} processing and break it. So we
% temporarily let \cmd{\cref@old@label} to \cmd{\sf@@sub@label}, so
% that \cmd{\cref@label} hands back to \package{subfig}'s \cmd{\label}
-% processing when done. (We're inside a group, so \cmd{cref@old@label}
+% processing when done. (We're inside a group, so \cmd{\cref@old@label}
% gets restored at the end of the subfloat.)
%
% The final issue is that \package{subfig} captures the original
@@ -6679,8 +6753,8 @@
% the \package{caption} package, it captures \package{cleveref}'s
% \package{caption}-related redefinition of \cmd{\label}.} instead of
% the original \cmd{\label} definition that needs to be called after
-% \package{subfig} has finished its stuff. So, we let \cmd{sf@oldlabel}
-% to \cmd{cref@old@label} before redefining the latter, so that the
+% \package{subfig} has finished its stuff. So, we let \cmd{\sf@oldlabel}
+% to \cmd{\cref@old@label} before redefining the latter, so that the
% \package{subfig} \cmd{\label} stack calls the right thing once it's
% done its own processing. Oof!
% \begin{macrocode}
@@ -6694,6 +6768,8 @@
\cref@label}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macrocode}
}{}% end of \@ifpackageloaded{subfig}
@@ -6702,6 +6778,40 @@
%
%
%
+% \subsubsection{\package{memoir} subfig support}
+% \begin{macro}{memoir}
+% We try to stay out of \package{memoir}'s way as much as possible, by
+% using a separate set of parallel label definitions for
+% \package{cleveref}, and leaving the standard labels alone for
+% \package{memoir} and other packages to use as normal. The one
+% remaining point of contention is the \cmd{\label} command itself.
+%
+% \begin{macro}{\sf@memsub@label}
+% \begin{macro}{\@memoldlabel}
+% \begin{macro}{\cref@old@label}
+% \package{memoir} contains its own internal re-implementation of
+% \package{subfig}, which redefines \cmd{\label} in a very similar way.
+% We therefore have to replicate the \package{subfig} support for
+% \package{memoir}'s internal re-implementation. (We have to postpone
+% the redefinitions until the beginning of the document because
+% \package{memoir} does, too.)
+% \begin{macrocode}
+\@ifclassloaded{memoir}{%
+ \AtBeginDocument{
+ \def\sf@memsub@label(#1){%
+ \protected@edef\mem@currentlabelname{#1}%
+ \let\@memoldlabel\cref@old@label%
+ \let\cref@old@label\sf@@memsub@label%
+ \cref@label}}
+}{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
% \subsubsection{\package{caption} support}
% \begin{macro}{caption}
% The \package{caption} package redefines \cmd{\label} within floats.
@@ -6712,7 +6822,7 @@
%
% Earlier versions of \package{caption} do break \package{cleveref}'s
% optional argument, however, so we have to fix things here for those
-% verions.
+% versions.
% \begin{macrocode}
\@ifpackageloaded{caption}{%
\@ifpackagelater{caption}{2011/08/19}{}{%
@@ -6737,7 +6847,7 @@
% But we've let that to \cmd{\cref@old@caption@xlabel}, which stores
% the original \cmd{\caption@xlabel}. So the net effect is to insert an
% extra layer of optional argument processing between \cmd{\label} and
-% \cmd{caption@xlabel}, which can then proceed as before.
+% \cmd{\caption@xlabel}, which can then proceed as before.
%
% The final issue is that \package{caption} captures the original
% \cmd{\label} definition in \cmd{\caption@ORI@label}, but this picks
@@ -6805,7 +6915,7 @@
% written. When the original \LaTeX{} source file is processed through
% this script, it strips out all the \package{cleveref} commands,
% typesetting all the reference formatting explicitly, and using the
-% standard \cmd{\ref} and \cmd{pageref} commands to produce the
+% standard \cmd{\ref} and \cmd{\pageref} commands to produce the
% references themselves.
% \end{macro}
% \begin{macrocode}
@@ -6840,7 +6950,7 @@
% Note that we write substitution rules for the \emph{previous}
% language block when the language is changed, because we need the
% rules to appear in the script \emph{after} all the cross-reference
-% substitution rules for that language block. \cmd{cref@inputlineno}
+% substitution rules for that language block. \cmd{\cref@inputlineno}
% stores the input-file line-number of the start of the previous
% language block.
%
@@ -7636,7 +7746,7 @@
%
% \begin{macro}{\cref@fullref}
% \begin{macro}{\cref@vrefrange}
-% \cmd{\cref@fullref} and \cmd{cref@vrefrange} are also redefined so
+% \cmd{\cref@fullref} and \cmd{\cref@vrefrange} are also redefined so
% that they write substitution rules. Strictly speaking, the starred
% variants of \cmd{\fullref} and \cmd{\vrefrange} are not defined when
% \package{hyperref} isn't loaded, so we could avoid checking for them
@@ -11124,7 +11234,7 @@
% \end{macrocode}
%
%
-% \subsubsection{Danish}
+% \subsubsection{Danish}
% \begin{macro}{danish}
% Danish translations courtesy of Benjamin H{\o}yer.
% \end{macro}
@@ -11228,121 +11338,292 @@
% appropriately.
% \begin{macrocode}
\cref@addto\extrasdanish{%
- \renewcommand{\crefrangeconjunction@preamble}{ til\nobreakspace}%
- \renewcommand\crefrangepreconjunction@preamble{}%
- \renewcommand\crefrangepostconjunction@preamble{}%
- \renewcommand{\crefpairconjunction@preamble}{ og\nobreakspace}%
- \renewcommand{\crefmiddleconjunction@preamble}{, }%
- \renewcommand{\creflastconjunction@preamble}{ og\nobreakspace}%
- \renewcommand{\crefpairgroupconjunction@preamble}{ og\nobreakspace}%
- \renewcommand{\crefmiddlegroupconjunction@preamble}{, }%
- \renewcommand{\creflastgroupconjunction@preamble}{ og\nobreakspace}%
+ \renewcommand{\crefrangeconjunction@preamble}{ til\nobreakspace}%
+ \renewcommand\crefrangepreconjunction@preamble{}%
+ \renewcommand\crefrangepostconjunction@preamble{}%
+ \renewcommand{\crefpairconjunction@preamble}{ og\nobreakspace}%
+ \renewcommand{\crefmiddleconjunction@preamble}{, }%
+ \renewcommand{\creflastconjunction@preamble}{ og\nobreakspace}%
+ \renewcommand{\crefpairgroupconjunction@preamble}{ og\nobreakspace}%
+ \renewcommand{\crefmiddlegroupconjunction@preamble}{, }%
+ \renewcommand{\creflastgroupconjunction@preamble}{ og\nobreakspace}%
%
- \Crefname{equation}{Ligning}{Ligninger}%
- \Crefname{figure}{Figur}{Figurer}%
- \Crefname{subfigure}{Figur}{Figurer}%
- \Crefname{table}{Tabel}{Tabeller}%
- \Crefname{subtable}{Tabel}{Tabeller}%
- \Crefname{page}{Side}{Sider}%
- \Crefname{part}{Del}{Dele}%
- \Crefname{chapter}{Kapitel}{Kapitler}%
- \Crefname{section}{Afsnit}{Afsnit}%
- \Crefname{subsection}{Afsnit}{Afsnit}%
- \Crefname{subsubsection}{Afsnit}{Afsnit}%
- \Crefname{appendix}{Appendiks}{Appendiks}%
- \Crefname{subappendix}{Appendiks}{Appendiks}%
- \Crefname{subsubappendix}{Appendiks}{Appendiks}%
- \Crefname{subsubsubappendix}{Appendiks}{Appendiks}%
- \Crefname{enumi}{Punkt}{Punkter}%
- \Crefname{enumii}{Punkt}{Punkter}%
- \Crefname{enumiii}{Punkt}{Punkter}%
- \Crefname{enumiv}{Punkt}{Punkter}%
- \Crefname{enumv}{Punkt}{Punkter}%
- \Crefname{footnote}{Fodnote}{Fodnoter}%
- \Crefname{theorem}{Teorem}{Teoremer}%
- \Crefname{lemma}{Lemma}{Lemma}%
- \Crefname{corollary}{F\o lgeslutning}{F\o lgeslutninger}%
- \Crefname{proposition}{Udsagn}{Udsagn}%
- \Crefname{definition}{Definition}{Definitioner}%
- \Crefname{result}{Resultat}{Resultater}%
- \Crefname{example}{Eksempel}{Eksempler}%
- \Crefname{remark}{Bem\ae rkning}{Bem\ae rkninger}%
- \Crefname{note}{Note}{Noter}%
- \Crefname{algorithm}{Algoritme}{Algoritmer}%
- \Crefname{line}{Linje}{Linjer}%
+ \Crefname{equation}{Ligning}{Ligninger}%
+ \Crefname{figure}{Figur}{Figurer}%
+ \Crefname{subfigure}{Figur}{Figurer}%
+ \Crefname{table}{Tabel}{Tabeller}%
+ \Crefname{subtable}{Tabel}{Tabeller}%
+ \Crefname{page}{Side}{Sider}%
+ \Crefname{part}{Del}{Dele}%
+ \Crefname{chapter}{Kapitel}{Kapitler}%
+ \Crefname{section}{Afsnit}{Afsnit}%
+ \Crefname{subsection}{Afsnit}{Afsnit}%
+ \Crefname{subsubsection}{Afsnit}{Afsnit}%
+ \Crefname{appendix}{Appendiks}{Appendiks}%
+ \Crefname{subappendix}{Appendiks}{Appendiks}%
+ \Crefname{subsubappendix}{Appendiks}{Appendiks}%
+ \Crefname{subsubsubappendix}{Appendiks}{Appendiks}%
+ \Crefname{enumi}{Punkt}{Punkter}%
+ \Crefname{enumii}{Punkt}{Punkter}%
+ \Crefname{enumiii}{Punkt}{Punkter}%
+ \Crefname{enumiv}{Punkt}{Punkter}%
+ \Crefname{enumv}{Punkt}{Punkter}%
+ \Crefname{footnote}{Fodnote}{Fodnoter}%
+ \Crefname{theorem}{Teorem}{Teoremer}%
+ \Crefname{lemma}{Lemma}{Lemma}%
+ \Crefname{corollary}{F\o lgeslutning}{F\o lgeslutninger}%
+ \Crefname{proposition}{Udsagn}{Udsagn}%
+ \Crefname{definition}{Definition}{Definitioner}%
+ \Crefname{result}{Resultat}{Resultater}%
+ \Crefname{example}{Eksempel}{Eksempler}%
+ \Crefname{remark}{Bem\ae rkning}{Bem\ae rkninger}%
+ \Crefname{note}{Note}{Noter}%
+ \Crefname{algorithm}{Algoritme}{Algoritmer}%
+ \Crefname{line}{Linje}{Linjer}%
%
- \if@cref@capitalise%
- \crefname{equation}{Ligning}{Ligninger}%
- \crefname{figure}{Figur}{Figurer}%
- \crefname{subfigure}{Figur}{Figurer}%
- \crefname{table}{Tabel}{Tabeller}%
- \crefname{subtable}{Tabel}{Tabeller}%
- \crefname{page}{Side}{Sider}%
- \crefname{part}{Del}{Dele}%
- \crefname{chapter}{Kapitel}{Kapitler}%
- \crefname{section}{Afsnit}{Afsnit}%
- \crefname{subsection}{Afsnit}{Afsnit}%
- \crefname{subsubsection}{Afsnit}{Afsnit}%
- \crefname{appendix}{Appendiks}{Appendiks}%
- \crefname{subappendix}{Appendiks}{Appendiks}%
- \crefname{subsubappendix}{Appendiks}{Appendiks}%
- \crefname{subsubsubappendix}{Appendiks}{Appendiks}%
- \crefname{enumi}{Punkt}{Punkter}%
- \crefname{enumii}{Punkt}{Punkter}%
- \crefname{enumiii}{Punkt}{Punkter}%
- \crefname{enumiv}{Punkt}{Punkter}%
- \crefname{enumv}{Punkt}{Punkter}%
- \crefname{footnote}{Fodnote}{Fodnoter}%
- \crefname{theorem}{Teorem}{Teoremer}%
- \crefname{lemma}{Lemma}{Lemma}%
- \crefname{corollary}{F\o lgeslutning}{F\o lgeslutninger}%
- \crefname{proposition}{Udsagn}{Udsagn}%
- \crefname{definition}{Definition}{Definitioner}%
- \crefname{result}{Resultat}{Resultater}%
- \crefname{example}{Eksempel}{Eksempler}%
- \crefname{remark}{Bem\ae rkning}{Bem\ae rkninger}%
- \crefname{note}{Note}{Noter}%
- \crefname{algorithm}{Algoritme}{Algoritmer}%
- \crefname{line}{Linje}{Linjer}%
+ \if@cref@capitalise%
+ \crefname{equation}{Ligning}{Ligninger}%
+ \crefname{figure}{Figur}{Figurer}%
+ \crefname{subfigure}{Figur}{Figurer}%
+ \crefname{table}{Tabel}{Tabeller}%
+ \crefname{subtable}{Tabel}{Tabeller}%
+ \crefname{page}{Side}{Sider}%
+ \crefname{part}{Del}{Dele}%
+ \crefname{chapter}{Kapitel}{Kapitler}%
+ \crefname{section}{Afsnit}{Afsnit}%
+ \crefname{subsection}{Afsnit}{Afsnit}%
+ \crefname{subsubsection}{Afsnit}{Afsnit}%
+ \crefname{appendix}{Appendiks}{Appendiks}%
+ \crefname{subappendix}{Appendiks}{Appendiks}%
+ \crefname{subsubappendix}{Appendiks}{Appendiks}%
+ \crefname{subsubsubappendix}{Appendiks}{Appendiks}%
+ \crefname{enumi}{Punkt}{Punkter}%
+ \crefname{enumii}{Punkt}{Punkter}%
+ \crefname{enumiii}{Punkt}{Punkter}%
+ \crefname{enumiv}{Punkt}{Punkter}%
+ \crefname{enumv}{Punkt}{Punkter}%
+ \crefname{footnote}{Fodnote}{Fodnoter}%
+ \crefname{theorem}{Teorem}{Teoremer}%
+ \crefname{lemma}{Lemma}{Lemma}%
+ \crefname{corollary}{F\o lgeslutning}{F\o lgeslutninger}%
+ \crefname{proposition}{Udsagn}{Udsagn}%
+ \crefname{definition}{Definition}{Definitioner}%
+ \crefname{result}{Resultat}{Resultater}%
+ \crefname{example}{Eksempel}{Eksempler}%
+ \crefname{remark}{Bem\ae rkning}{Bem\ae rkninger}%
+ \crefname{note}{Note}{Noter}%
+ \crefname{algorithm}{Algoritme}{Algoritmer}%
+ \crefname{line}{Linje}{Linjer}%
%
- \else%
- \crefname{equation}{ligning}{ligninger}%
- \crefname{figure}{figur}{figurer}%
- \crefname{subfigure}{figur}{figurer}%
- \crefname{table}{tabel}{tabeller}%
- \crefname{subtable}{tabel}{tabeller}%
- \crefname{page}{side}{sider}%
- \crefname{part}{del}{dele}%
- \crefname{chapter}{kapitel}{kapitler}%
- \crefname{section}{afsnit}{afsnit}%
- \crefname{subsection}{afsnit}{afsnit}%
- \crefname{subsubsection}{afsnit}{afsnit}%
- \crefname{appendix}{appendiks}{appendiks}%
- \crefname{subappendix}{appendiks}{appendiks}%
- \crefname{subsubappendix}{appendiks}{appendiks}%
- \crefname{subsubsubappendix}{appendiks}{appendiks}%
- \crefname{enumi}{punkt}{punkter}%
- \crefname{enumii}{punkt}{punkter}%
- \crefname{enumiii}{punkt}{punkter}%
- \crefname{enumiv}{punkt}{punkter}%
- \crefname{enumv}{punkt}{punkter}%
- \crefname{footnote}{fodnote}{fodnoter}%
- \crefname{theorem}{teorem}{teoremer}%
- \crefname{lemma}{lemma}{lemma}%
- \crefname{corollary}{f\o lgeslutning}{f\o lgeslutninger}%
- \crefname{proposition}{udsagn}{udsagn}%
- \crefname{definition}{definition}{definitioner}%
- \crefname{result}{resultat}{resultater}%
- \crefname{example}{eksempel}{eksempler}%
- \crefname{remark}{bem\ae rkning}{bem\ae rkninger}%
- \crefname{note}{note}{noter}%
- \crefname{algorithm}{algoritme}{algoritmer}%
- \crefname{line}{linje}{linjer}%
+ \else%
+ \crefname{equation}{ligning}{ligninger}%
+ \crefname{figure}{figur}{figurer}%
+ \crefname{subfigure}{figur}{figurer}%
+ \crefname{table}{tabel}{tabeller}%
+ \crefname{subtable}{tabel}{tabeller}%
+ \crefname{page}{side}{sider}%
+ \crefname{part}{del}{dele}%
+ \crefname{chapter}{kapitel}{kapitler}%
+ \crefname{section}{afsnit}{afsnit}%
+ \crefname{subsection}{afsnit}{afsnit}%
+ \crefname{subsubsection}{afsnit}{afsnit}%
+ \crefname{appendix}{appendiks}{appendiks}%
+ \crefname{subappendix}{appendiks}{appendiks}%
+ \crefname{subsubappendix}{appendiks}{appendiks}%
+ \crefname{subsubsubappendix}{appendiks}{appendiks}%
+ \crefname{enumi}{punkt}{punkter}%
+ \crefname{enumii}{punkt}{punkter}%
+ \crefname{enumiii}{punkt}{punkter}%
+ \crefname{enumiv}{punkt}{punkter}%
+ \crefname{enumv}{punkt}{punkter}%
+ \crefname{footnote}{fodnote}{fodnoter}%
+ \crefname{theorem}{teorem}{teoremer}%
+ \crefname{lemma}{lemma}{lemma}%
+ \crefname{corollary}{f\o lgeslutning}{f\o lgeslutninger}%
+ \crefname{proposition}{udsagn}{udsagn}%
+ \crefname{definition}{definition}{definitioner}%
+ \crefname{result}{resultat}{resultater}%
+ \crefname{example}{eksempel}{eksempler}%
+ \crefname{remark}{bem\ae rkning}{bem\ae rkninger}%
+ \crefname{note}{note}{noter}%
+ \crefname{algorithm}{algoritme}{algoritmer}%
+ \crefname{line}{linje}{linjer}%
\fi%
}}}
% \end{macrocode}
%
%
+% \subsubsection{Esperanto}
+% \begin{macro}{esperanto}
+% Esperanto translations courtesy of Johannes Mueller.
+% \end{macro}
+% \begin{macrocode}
+\DeclareOption{esperanto}{%
+ \PackageInfo{cleveref}{loaded `esperanto' language definitions}
+ \AtBeginDocument{%
+ \def\crefrangeconjunction@preamble{ \^gis\nobreakspace}%
+ \def\crefrangepreconjunction@preamble{}%
+ \def\crefrangepostconjunction@preamble{}%
+ \def\crefpairconjunction@preamble{ kaj\nobreakspace}%
+ \def\crefmiddleconjunction@preamble{, }%
+ \def\creflastconjunction@preamble{ kaj\nobreakspace}%
+ \def\crefpairgroupconjunction@preamble{ kaj\nobreakspace}%
+ \def\crefmiddlegroupconjunction@preamble{, }%
+ \def\creflastgroupconjunction@preamble{ kaj\nobreakspace}%
+%
+ \Crefname@preamble{equation}{Ekvacio}{Ekvacioj}%
+ \Crefname@preamble{part}{Parto}{Partoj}%
+ \Crefname@preamble{chapter}{\^Capitro}{\^Capitroj}%
+ \Crefname@preamble{section}{Sekcio}{Sekcioj}%
+ \Crefname@preamble{appendix}{Aldono}{Aldonoj}%
+ \Crefname@preamble{enumi}{Punkto}{Punktoj}%
+ \Crefname@preamble{footnote}{Piednoto}{Piednotoj}%
+ \Crefname@preamble{figure}{Figuro}{Figuroj}%
+ \Crefname@preamble{table}{Tabelo}{Tabeloj}%
+ \Crefname@preamble{theorem}{Teoremo}{Teoremoj}%
+ \Crefname@preamble{lemma}{Lemo}{Lemoj}%
+ \Crefname@preamble{corollary}{Korolario}{Korolarioj}%
+ \Crefname@preamble{proposition}{Propozicio}{Propozicioj}%
+ \Crefname@preamble{definition}{Defino}{Definoj}%
+ \Crefname@preamble{result}{Rezulto}{Rezultoj}%
+ \Crefname@preamble{example}{Ekzemplo}{Ekzemploj}%
+ \Crefname@preamble{remark}{Rimarko}{Rimarkoj}%
+ \Crefname@preamble{note}{Noto}{Notoj}%
+ \Crefname@preamble{algorithm}{Algoritmo}{Algoritmoj}%
+ \Crefname@preamble{listing}{Listado}{Listadoj}%
+ \Crefname@preamble{line}{Linio}{Linioj}%
+%
+ \if@cref@capitalise%
+ \crefname@preamble{equation}{Ekvacio}{Ekvacioj}%
+ \crefname@preamble{part}{Parto}{Partoj}%
+ \crefname@preamble{chapter}{\^Capitro}{\^Capitroj}%
+ \crefname@preamble{section}{Sekcio}{Sekcioj}%
+ \crefname@preamble{appendix}{Aldono}{Aldonoj}%
+ \crefname@preamble{enumi}{Punkto}{Punktoj}%
+ \crefname@preamble{footnote}{Piednoto}{Piednotoj}%
+ \crefname@preamble{figure}{Figuro}{Figuroj}%
+ \crefname@preamble{table}{Tabelo}{Tabeloj}%
+ \crefname@preamble{theorem}{Teoremo}{Teoremoj}%
+ \crefname@preamble{lemma}{Lemo}{Lemoj}%
+ \crefname@preamble{corollary}{Korolario}{Korolarioj}%
+ \crefname@preamble{proposition}{Propozicio}{Propozicioj}%
+ \crefname@preamble{definition}{Defino}{Definoj}%
+ \crefname@preamble{result}{Rezulto}{Rezultoj}%
+ \crefname@preamble{example}{Ekzemplo}{Ekzemploj}%
+ \crefname@preamble{remark}{Rimarko}{Rimarkoj}%
+ \crefname@preamble{note}{Noto}{Notoj}%
+ \crefname@preamble{algorithm}{Algoritmo}{Algoritmoj}%
+ \crefname@preamble{listing}{Listado}{Listadoj}%
+ \crefname@preamble{line}{Linio}{Linioj}%
+%
+ \else%
+ \crefname@preamble{equation}{ekvacio}{ekvacioj}%
+ \crefname@preamble{part}{parto}{partoj}%
+ \crefname@preamble{chapter}{\^capitro}{\^capitroj}%
+ \crefname@preamble{section}{sekcio}{sekcioj}%
+ \crefname@preamble{appendix}{aldono}{aldonoj}%
+ \crefname@preamble{enumi}{punkto}{punktoj}%
+ \crefname@preamble{footnote}{piednoto}{piednotoj}%
+ \crefname@preamble{figure}{figuro}{figuroj}%
+ \crefname@preamble{table}{tabelo}{tabeloj}%
+ \crefname@preamble{theorem}{teoremo}{teoremoj}%
+ \crefname@preamble{lemma}{lemo}{lemoj}%
+ \crefname@preamble{corollary}{korolario}{korolarioj}%
+ \crefname@preamble{proposition}{propozicio}{propozicioj}%
+ \crefname@preamble{definition}{defino}{definoj}%
+ \crefname@preamble{result}{rezulto}{rezultoj}%
+ \crefname@preamble{example}{ekzemplo}{ekzemploj}%
+ \crefname@preamble{remark}{rimarko}{rimarkoj}%
+ \crefname@preamble{note}{noto}{notoj}%
+ \crefname@preamble{algorithm}{algoritmo}{algoritmoj}%
+ \crefname@preamble{listing}{listado}{listadoj}%
+ \crefname@preamble{line}{linio}{linioj}%
+ \fi%
+ \def\cref@language{esperanto}%
+%
+ \cref@addto\extrasesperanto{%
+ \renewcommand{\crefrangeconjunction}{ \^gis\nobreakspace}%
+ \renewcommand{\crefrangepreconjunction}{}%
+ \renewcommand{\crefrangepostconjunction}{}%
+ \renewcommand{\crefpairconjunction}{ kaj\nobreakspace}%
+ \renewcommand{\crefmiddleconjunction}{, }%
+ \renewcommand{\creflastconjunction}{ kaj\nobreakspace}%
+ \renewcommand{\crefpairgroupconjunction}{ kaj\nobreakspace}%
+ \renewcommand{\crefmiddlegroupconjunction}{, }%
+ \renewcommand{\creflastgroupconjunction}{ kaj\nobreakspace}%
+%
+ \Crefname{equation}{Ekvacio}{Ekvacioj}%
+ \Crefname{part}{Parto}{Partoj}%
+ \Crefname{chapter}{\^Capitro}{\^Capitroj}%
+ \Crefname{section}{Sekcio}{Sekcioj}%
+ \Crefname{appendix}{Aldono}{Aldonoj}%
+ \Crefname{enumi}{Punkto}{Punktoj}%
+ \Crefname{footnote}{Piednoto}{Piednotoj}%
+ \Crefname{figure}{Figuro}{Figuroj}%
+ \Crefname{table}{Tabelo}{Tabeloj}%
+ \Crefname{theorem}{Teoremo}{Teoremoj}%
+ \Crefname{lemma}{Lemo}{Lemoj}%
+ \Crefname{corollary}{Korolario}{Korolarioj}%
+ \Crefname{proposition}{Propozicio}{Propozicioj}%
+ \Crefname{definition}{Defino}{Definoj}%
+ \Crefname{result}{Rezulto}{Rezultoj}%
+ \Crefname{example}{Ekzemplo}{Ekzemploj}%
+ \Crefname{remark}{Rimarko}{Rimarkoj}%
+ \Crefname{note}{Noto}{Notoj}%
+ \Crefname{algorithm}{Algoritmo}{Algoritmoj}%
+ \Crefname{listing}{Listado}{Listadoj}%
+ \Crefname{line}{Linio}{Linioj}%
+%
+ \if@cref@capitalise%
+ \crefname{equation}{Ekvacio}{Ekvacioj}%
+ \crefname{part}{Parto}{Partoj}%
+ \crefname{chapter}{\^Capitro}{\^Capitroj}%
+ \crefname{section}{Sekcio}{Sekcioj}%
+ \crefname{appendix}{Aldono}{Aldonoj}%
+ \crefname{enumi}{Punkto}{Punktoj}%
+ \crefname{footnote}{Piednoto}{Piednotoj}%
+ \crefname{figure}{Figuro}{Figuroj}%
+ \crefname{table}{Tabelo}{Tabeloj}%
+ \crefname{theorem}{Teoremo}{Teoremoj}%
+ \crefname{lemma}{Lemo}{Lemoj}%
+ \crefname{corollary}{Korolario}{Korolarioj}%
+ \crefname{proposition}{Propozicio}{Propozicioj}%
+ \crefname{definition}{Defino}{Definoj}%
+ \crefname{result}{Rezulto}{Rezultoj}%
+ \crefname{example}{Ekzemplo}{Ekzemploj}%
+ \crefname{remark}{Rimarko}{Rimarkoj}%
+ \crefname{note}{Noto}{Notoj}%
+ \crefname{algorithm}{Algoritmo}{Algoritmoj}%
+ \crefname{listing}{Listado}{Listadoj}%
+ \crefname{line}{Linio}{Linioj}%
+%
+ \else%
+ \crefname{equation}{ekvacio}{ekvacioj}%
+ \crefname{part}{parto}{partoj}%
+ \crefname{chapter}{\^capitro}{\^capitroj}%
+ \crefname{section}{sekcio}{sekcioj}%
+ \crefname{appendix}{aldono}{aldonoj}%
+ \crefname{enumi}{punkto}{punktoj}%
+ \crefname{footnote}{piednoto}{piednotoj}%
+ \crefname{figure}{figuro}{figuroj}%
+ \crefname{table}{tabelo}{tabeloj}%
+ \crefname{theorem}{teoremo}{teoremoj}%
+ \crefname{lemma}{lemo}{lemoj}%
+ \crefname{corollary}{korolario}{korolarioj}%
+ \crefname{proposition}{propozicio}{propozicioj}%
+ \crefname{definition}{defino}{definoj}%
+ \crefname{result}{rezulto}{rezultoj}%
+ \crefname{example}{ekzemplo}{ekzemploj}%
+ \crefname{remark}{rimarko}{rimarkoj}%
+ \crefname{note}{noto}{notoj}%
+ \crefname{algorithm}{algoritmo}{algoritmoj}%
+ \crefname{listing}{listado}{listadoj}%
+ \crefname{line}{linio}{linioj}%
+ \fi%
+ }}}
+% \end{macrocode}
+%
+%
%
% \subsection{Default Cross-Reference Formats}
% \label{sec:code:default_formats}
@@ -11376,7 +11657,7 @@
% \begin{macro}{\creflabelformat}
% Define the default label formats, which don't depend on language. We
% override the default format for equations, to follow the near
-% universal convention of enclosing equation labels in brackets.
+% universal convention of enclosing equation labels in parentheses.
% However, if the \option{nameinlink} option is enabled, the end of the
% hyperlink must come outside the group or it will cause \LaTeX{}
% grouping errors, so we must define it differently in that case.
@@ -11393,7 +11674,7 @@
% \end{macro}
%
%
-% Setup the default English format definitions, then process options in
+% Set up the default English format definitions, then process options in
% the order they were supplied.
% \begin{macrocode}
\ExecuteOptions{english}