From: W. Trevor King Date: Thu, 14 Jan 2010 02:20:44 +0000 (-0500) Subject: Merged sawsim paper. X-Git-Tag: v1.0~467 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e5a708c2c8b4fd75075d60a37beeef9025f49e1;p=thesis.git Merged sawsim paper. --- diff --git a/tex/Makefile b/tex/Makefile index c5974aa..3462fa3 100644 --- a/tex/Makefile +++ b/tex/Makefile @@ -11,7 +11,7 @@ thesis.pdf : build .PHONY: build build : rsync -a src/ build - (cd ./build && make) + $(MAKE) --directory build all clean : rm -rf build thesis.pdf diff --git a/tex/src/Makefile b/tex/src/Makefile index 8e0b458..b40dbde 100644 --- a/tex/src/Makefile +++ b/tex/src/Makefile @@ -1,4 +1,4 @@ -SUBDIRS = cantilever_calib +SUBDIRS = packages sawsim cantilever_calib all : @for i in $(SUBDIRS); do \ diff --git a/tex/src/cantilever_calib/cantilever_calib.tex b/tex/src/cantilever_calib/cantilever_calib.tex index 5d9dd02..14cab7c 100644 --- a/tex/src/cantilever_calib/cantilever_calib.tex +++ b/tex/src/cantilever_calib/cantilever_calib.tex @@ -1,3 +1,4 @@ +\linenumbers \chapter{Cantilever Calibration} \input{cantilever_calib/overview} \input{cantilever_calib/setup_general} diff --git a/tex/src/local_cmmds.tex b/tex/src/local_cmmds.tex index 4b4debc..86d8846 100644 --- a/tex/src/local_cmmds.tex +++ b/tex/src/local_cmmds.tex @@ -58,3 +58,6 @@ \definecolor{purple}{rgb}{0.8, 0, 0.8} \newcommand{\colAB}[1]{\textcolor{purple}{#1}} \newcommand{\colC}[1]{\textcolor{green}{#1}} + +\newcommand{\ie}{\emph{i.e.}} % "id est" or "in other words" +\newcommand{\sawsim}{\texttt{sawsim}} diff --git a/tex/src/packages.tex b/tex/src/packages.tex index db15ad7..e7bed86 100644 --- a/tex/src/packages.tex +++ b/tex/src/packages.tex @@ -6,6 +6,8 @@ %\bibliographystyle{plain} % pick the bibliography style, includes dates \bibliographystyle{plainnat} +% Nicer references with \cref, \Cref, etc. +\usepackage[capitalize]{cleveref} % print labels in margins for debugging %\usepackage{showkeys} @@ -14,8 +16,20 @@ \usepackage{amsmath} % proof environment and extensions for the \newtheorem command \usepackage{amsthm} +%% The amssymb package provides various useful mathematical symbols +\usepackage{amssymb} % fonts like mathbb (blackboard) \usepackage{amsfonts} +\usepackage{subfig} +\usepackage{fr-subfig} + +\usepackage{xcolor} + +%% The lineno packages adds line numbers. Start line numbering with +%% \begin{linenumbers}, end it with \end{linenumbers}. Or switch it on +%% for the whole article with \linenumbers after \end{frontmatter}. +\usepackage{lineno} + \usepackage{wtk_cmmds} % common personal macros, in ~/texmf/tex/latex/ \input{local_cmmds} diff --git a/tex/src/packages/Makefile b/tex/src/packages/Makefile new file mode 100644 index 0000000..4fd17be --- /dev/null +++ b/tex/src/packages/Makefile @@ -0,0 +1,10 @@ +PACKAGES = $(shell ls *.sty) +TARGETS = $(PACKAGES:%=../%) + +all : $(TARGETS) + +../%.sty : %.sty + (cd ../ ; ln -s packages/$<) + +clean : + rm -f $(TARGETS) diff --git a/tex/src/packages/cleveref.sty b/tex/src/packages/cleveref.sty new file mode 100644 index 0000000..7775250 --- /dev/null +++ b/tex/src/packages/cleveref.sty @@ -0,0 +1,3988 @@ +%% +%% This is file `cleveref.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cleveref.dtx (with options: `package') +%% +%% LaTeX package for automatic cross-referencing text. +%% +%% Copyright (C) 2006 Toby Cubitt +%% See the files README and COPYING. +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.2 +%% of this license or (at your option) any later version. +%% The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{cleveref} + [2009/09/22 v0.14.2 Intelligent cross-referencing] +%% \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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\let\cref@old@refstepcounter\refstepcounter +\def\refstepcounter{% + \@ifnextchar[{\refstepcounter@optarg}{\refstepcounter@noarg}%] +} +\def\refstepcounter@noarg#1{% + \cref@old@refstepcounter{#1}% + \cref@constructprefix{#1}{\@result}% + \protected@edef\@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}} +\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}% + \@ifpackageloaded{amsmath}{% + \let\cref@label\label + \let\cref@old@label@in@display\label@in@display + \def\label@in@display{% + \@ifnextchar[\label@in@display@optarg\label@in@display@noarg}%] + \def\label@in@display@noarg#1{\cref@old@label@in@display{{#1}}} + \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@@ + \let\cref@old@subequations\subequations% + \let\cref@old@endsubequations\endsubequations% + \cref@resetby{equation}{\@result}% + \ifx\@result\relax\else% + \@addtoreset{parentequation}{\@result}% + \fi% + \renewenvironment{subequations}{% + \@addtoreset{equation}{parentequation}% + \cref@old@subequations% + }{% + \gdef\cl@parentequation{}% + \cref@old@endsubequations% + \setcounter{parentequation}{0}% + }% + \def\make@df@tag@@#1{% + \gdef\df@tag{\maketag@@@{#1}% + \def\@currentlabel{[equation][][]#1}}} + \def\make@df@tag@@@#1{% + \gdef\df@tag{\tagform@{#1}% + \toks@\@xp{\p@equation{#1}}% + \edef\@currentlabel{[equation][][]\the\toks@}}} + }{}% +} +\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}}% +} +\let\cref@old@appendix\appendix +\renewcommand\appendix{% + \cref@old@appendix% + \@ifundefined{chapter}{% + \gdef\refstepcounter@noarg##1{% + \cref@old@refstepcounter{##1}% + \cref@constructprefix{##1}{\@result}% + \edef\@result{{2147483647}\@result}% + \def\@tmpa{##1}% + \def\@tmpb{section}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [appendix][\arabic{##1}][\@result]\@currentlabel}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{subsection}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [subappendix][\arabic{##1}][\@result]\@currentlabel}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{subsubsection}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [subsubappendix][\arabic{##1}][\@result]% + \@currentlabel}% + \else% + \protected@edef\@currentlabel{% + [##1][\arabic{##1}][\@result]\@currentlabel}% + \fi% + \fi% + \fi}% + }{% + \def\refstepcounter@noarg##1{% + \cref@old@refstepcounter{##1}% + \cref@constructprefix{##1}{\@result}% + \edef\@result{{2147483647}\@result}% + \def\@tmpa{##1}% + \def\@tmpb{chapter}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [appendix][\arabic{##1}][\@result]\@currentlabel}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{section}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [subappendix][\arabic{##1}][\@result]\@currentlabel}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{subsection}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [subsubappendix][\arabic{##1}][\@result]% + \@currentlabel}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{subsubsection}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [subsubsubappendix][\arabic{##1}]% + [\@result]\@currentlabel}% + \else% + \protected@edef\@currentlabel{% + [##1][\arabic{##1}][\@result]\@currentlabel}% + \fi% + \fi% + \fi% + \fi}% + }% +} +\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\@firstoftwo\@tmpa}% + \expandafter\@cref@getlabel\@tmpa\@nil#2}% +\def\@cref@getlabel{\@ifnextchar[%] + \@@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\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\@firstoftwo\@tmpa}% + \expandafter\@cref@gettype\@tmpa\@nil#2}% +\def\@cref@gettype{\@ifnextchar[%] + \@@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\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\@firstoftwo\@tmpa}% + \expandafter\@cref@getcounter\@tmpa\@nil#2} +\def\@cref@getcounter{\@ifnextchar[%] + \@@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\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\@firstoftwo\@tmpa}% + \expandafter\@cref@getprefix\@tmpa\@nil#2} +\def\@cref@getprefix{\@ifnextchar[%] + \@@cref@getprefix{\@@cref@getprefix[][][]}} +\def\@@cref@getprefix[#1][#2][#3]#4\@nil#5{\def#5{#3}} +\def\cref@constructprefix#1#2{% + \cref@stack@init{\@tmpstack}% + \edef\@tmpa{\noexpand{#1\noexpand}}% + \expandafter\def\expandafter\@tmpa\expandafter{\@tmpa{#2}}% + \expandafter\@cref@constructprefix\@tmpa% + \cref@stack@to@list{\@tmpstack}{\@tmpa}% + \expandafter\def\expandafter#2\expandafter{\@tmpa}} +\def\@cref@constructprefix#1#2{% + \cref@resetby{#1}{#2}% + \ifx#2\relax% + \else% + \edef\@tmpa{\the\csname c@#2\endcsname}% + \expandafter\cref@stack@push\expandafter{\@tmpa}{\@tmpstack}% + \edef\@tmpa{{#2}}% + \expandafter\expandafter\expandafter\@cref@constructprefix% + \expandafter\@tmpa\expandafter{\expandafter#2\expandafter}% + \fi} +\def\cref@append@toks#1#2{\toks0={#2}% + \edef\act{\noexpand#1={\the#1\the\toks0}}% + \act}% +\def\cref@stack@init#1{\def#1{\@nil}} +\def\cref@stack@top#1{\expandafter\@cref@stack@top#1} +\def\@cref@stack@top#1,#2\@nil{#1} +\def\cref@stack@pop#1{\expandafter\@cref@stack@pop#1#1} +\def\@cref@stack@pop#1,#2\@nil#3{\def#3{#2\@nil}} +\def\cref@stack@push#1#2{% + \expandafter\@cref@stack@push\expandafter{#2}{#1}{#2}} +\def\@cref@stack@push#1#2#3{\def#3{#2,#1}} +\def\cref@stack@pull#1#2{\expandafter\@cref@stack@pull#2{#1}{#2}} +\def\@cref@stack@pull#1\@nil#2#3{\def#3{#1#2,\@nil}} +\def\cref@stack@to@list#1#2{% + \cref@isstackfull{#1}% + \if@cref@stackfull% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter\@cref@stack@to@list#1}% + \else% + \def#2{}% + \fi} +\def\@cref@stack@to@list#1,\@nil{#1} +\def\cref@stack@topandbottom#1#2#3{% + \def#2{}% + \def#3{}% + \cref@isstackfull{#1}% + \if@cref@stackfull% + \edef#2{\cref@stack@top{#1}}% + \cref@stack@pop{#1}% + \cref@isstackfull{#1}% + \@whilesw\if@cref@stackfull\fi{% + \edef#3{\cref@stack@top{#1}}% + \cref@stack@pop{#1}% + \cref@isstackfull{#1}}% + \fi} +\def\cref@stack@add#1#2{% + \begingroup% + \def\@arg1{#1}% + \let\@tmpstack#2% + \newif\if@notthere% + \@nottheretrue% + \cref@isstackfull{\@tmpstack}% + \@whilesw\if@cref@stackfull\fi{% + \edef\@tmpb{\cref@stack@top{\@tmpstack}}% + \def\@tmpa{#1}% + \ifx\@tmpa\@tmpb% + \@cref@stackfullfalse% + \@nottherefalse% + \else% + \cref@stack@pop{\@tmpstack}% + \cref@isstackfull{\@tmpstack}% + \fi + }% + \expandafter\endgroup% + \if@notthere\cref@stack@push{#1}{#2}\fi} +\newif\if@cref@stackempty +\newif\if@cref@stackfull +\def\cref@isstackempty#1{% + \def\@tmpa{\@nil}% + \ifx#1\@tmpa\@cref@stackemptytrue% + \else\@cref@stackemptyfalse\fi} +\def\cref@isstackfull#1{% + \def\@tmpa{\@nil}% + \ifx#1\@tmpa\@cref@stackfullfalse% + \else\@cref@stackfulltrue\fi} +\def\cref@stack@sort#1#2{% + \begingroup% + \cref@stack@init{\@sortstack}% + \edef\@element{\cref@stack@top{#1}}% + \expandafter\cref@stack@push\expandafter{\@element}{\@sortstack}% + \cref@stack@pop{#1}% + \cref@isstackfull{#1}% + \if@cref@stackfull% + \edef\@tmpa{\cref@stack@top{#1}}% + \@whilesw\ifx\@tmpa\@empty\fi{% + \cref@stack@pull{}{\@sortstack}% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \let\@tmpa\relax% + \else% + \edef\@tmpa{\cref@stack@top{#1}}% + \fi}% + \fi% + \cref@isstackfull{#1}% + \@whilesw\if@cref@stackfull\fi{% + \edef\@element{\cref@stack@top{#1}}% + \cref@stack@pop{#1}% + \def\@empties{}% + \cref@isstackfull{#1}% + \if@cref@stackfull% + \edef\@tmpa{\cref@stack@top{#1}}% + \@whilesw\ifx\@tmpa\@empty\fi{% + \edef\@empties{\@empties,}% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \let\@tmpa\relax% + \else% + \edef\@tmpa{\cref@stack@top{#1}}% + \fi}% + \fi% + \edef\@tmpa{{\expandafter\noexpand\@element}% + {\expandafter\noexpand\@empties}% + {\noexpand\@sortstack}{\noexpand#2}}% + \expandafter\cref@stack@insert\@tmpa% + \cref@isstackfull{#1}}% + \expandafter\endgroup\expandafter% + \def\expandafter#1\expandafter{\@sortstack}} +\def\cref@stack@insert#1#2#3#4{% + \let\@cmp#4% + \@cref@stack@insert{}{#1}{#2}{#3}% + \cref@stack@pop{#3}} +\def\@cref@stack@insert#1#2#3#4{% + \let\@iterate\relax% + \cref@isstackempty{#4}% + \if@cref@stackempty% + \cref@stack@push{#1,#2#3}{#4}% + \else% + \edef\@tmpa{\cref@stack@top{#4}}% + \expandafter\@cmp\expandafter{\@tmpa}{#2}{\@result}% + \ifnum\@result=2\relax% + \cref@stack@push{#1,#2#3}{#4}% + \else% + \cref@stack@pop{#4}% + \edef\@tmpa{{\noexpand#1,\@tmpa}{\noexpand#2}% + {\noexpand#3}{\noexpand#4}}% + \expandafter\def\expandafter\@iterate\expandafter% + {\expandafter\@cref@stack@insert\@tmpa}% + \fi% + \fi% + \@iterate} +\def\cref@counter@first#1#2\@nil{#1} +\def\cref@counter@rest#1#2\@nil{#2} +\def\cref@countercmp#1#2#3{% + \begingroup% + \def\@tmpa{#1}% + \ifx\@tmpa\@empty% + \def\@result{1}% + \else% + \def\@tmpa{#2}% + \ifx\@tmpa\@empty% + \def\@result{2}% + \else% + \expandafter\ifx\csname r@#1\endcsname\relax% + \def\@result{2}% + \else% + \expandafter\ifx\csname r@#2\endcsname\relax% + \def\@result{1}% + \else% + \cref@getcounter{#1}{\@countera}% + \cref@getprefix{#1}{\@prefixa}% + \cref@getcounter{#2}{\@counterb}% + \cref@getprefix{#2}{\@prefixb}% + \cref@stack@init{\@countstacka}% + \expandafter\cref@stack@push\expandafter% + {\@countera}{\@countstacka}% + \ifx\@prefixa\@empty% + \else% + \expandafter\cref@stack@push\expandafter% + {\@prefixa}{\@countstacka}% + \fi% + \cref@stack@init{\@countstackb}% + \expandafter\cref@stack@push\expandafter% + {\@counterb}{\@countstackb}% + \ifx\@prefixb\@empty% + \else% + \expandafter\cref@stack@push\expandafter% + {\@prefixb}{\@countstackb}% + \fi% + \@cref@countercmp% + \fi% + \fi% + \fi% + \fi% + \expandafter\endgroup\expandafter% + \chardef\expandafter#3\expandafter=\@result\relax} +\def\@cref@countercmp{% + \let\@iterate\relax% + \cref@isstackempty{\@countstacka}% + \if@cref@stackempty% + \cref@isstackempty{\@countstackb}% + \if@cref@stackempty% + \def\@result{0}% + \else% + \def\@result{1}% + \fi% + \else% + \cref@isstackempty{\@countstackb}% + \if@cref@stackempty% + \def\@result{2}% + \else% + \edef\@tmpa{\cref@stack@top{\@countstacka}}% + \cref@stack@pop{\@countstacka}% + \edef\@tmpb{\cref@stack@top{\@countstackb}}% + \cref@stack@pop{\@countstackb}% + \ifnum\@tmpa<\@tmpb\relax% + \def\@result{1}% + \else% + \ifnum\@tmpa>\@tmpb\relax% + \def\@result{2}% + \else% + \def\@iterate{\@cref@countercmp}% + \fi% + \fi% + \fi% + \fi% + \@iterate} +\newif\if@cref@inresetlist +\def\cref@isinresetlist#1#2{% + \begingroup% + \def\@counter{#1}% + \def\@elt##1{##1,}% + \expandafter\ifx\csname cl@#2\endcsname\relax% + \def\cref@resetstack{,\@nil}% + \else% + \edef\cref@resetstack{\csname cl@#2\endcsname\noexpand\@nil}% + \fi% + \let\@nextcounter\relax% + \cref@isstackfull{\cref@resetstack}% + \@whilesw\if@cref@stackfull\fi{% + \edef\@nextcounter{\cref@stack@top{\cref@resetstack}}% + \ifx\@nextcounter\@counter% + \@cref@stackfullfalse% + \else% + \let\@nextcounter\relax% + \cref@stack@pop{\cref@resetstack}% + \cref@isstackfull{\cref@resetstack}% + \fi}% + \ifx\@nextcounter\relax% + \def\@next{\@cref@inresetlistfalse}% + \else% + \def\@next{\@cref@inresetlisttrue}% + \fi% + \expandafter% + \endgroup% + \@next} +\def\cref@resetby#1#2{% + \let#2\relax% + \def\@tmpa{#1}% + \def\@tmpb{subfigure}% + \ifx\@tmpa\@tmpb% + \cref@isinresetlist{#1}{figure}% + \if@cref@inresetlist% + \def#2{figure}% + \fi% + \fi% + \def\@tmpa{#1}% + \def\@tmpb{subtable}% + \ifx\@tmpa\@tmpb% + \cref@isinresetlist{#1}{table}% + \if@cref@inresetlist% + \def#2{table}% + \fi% + \fi% + \@ifundefined{cl@parentequation}{}{% + \def\@tmpa{#1}% + \def\@tmpb{equation}% + \ifx\@tmpa\@tmpb% + \cref@isinresetlist{#1}{parentequation}% + \if@cref@inresetlist% + \expandafter\ifnum\c@parentequation=0\else% + \def#2{parentequation}% + \fi% + \fi% + \fi}% + \def\@tmpa{#1}% + \def\@tmpb{enumii}% + \ifx\@tmpa\@tmpb% + \def#2{enum}% + \fi% + \def\@tmpb{enumiii}% + \ifx\@tmpa\@tmpb% + \def#2{enum}% + \fi% + \def\@tmpb{enumiv}% + \ifx\@tmpa\@tmpb% + \def#2{enum}% + \fi% + \def\@tmpb{enumv}% + \ifx\@tmpa\@tmpb% + \def#2{enum}% + \fi% + \def\@tmpb{enum}% + \ifx#2\@tmpb% + \cref@isinresetlist{#1}{enumiv}% + \if@cref@inresetlist% + \def#2{enumiv}% + \else% + \cref@isinresetlist{#1}{enumiii}% + \if@cref@inresetlist% + \def#2{enumiii}% + \else% + \cref@isinresetlist{#1}{enumii}% + \if@cref@inresetlist% + \def#2{enumii}% + \else% + \cref@isinresetlist{#1}{enumi}% + \if@cref@inresetlist% + \def#2{enumi}% + \else% + \cref@isinresetlist{#1}{part}% + \if@cref@inresetlist% + \def#2{part}% + \else% + \let#2\relax% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \ifx#2\relax% + \cref@isinresetlist{#1}{table}% + \if@cref@inresetlist% + \def#2{table}% + \else% + \cref@isinresetlist{#1}{subsubsection}% + \if@cref@inresetlist% + \def#2{subsubsection}% + \else% + \cref@isinresetlist{#1}{subsection}% + \if@cref@inresetlist% + \def#2{subsection}% + \else% + \cref@isinresetlist{#1}{section}% + \if@cref@inresetlist% + \def#2{section}% + \else% + \cref@isinresetlist{#1}{chapter}% + \if@cref@inresetlist% + \def#2{chapter}% + \else% + \cref@isinresetlist{#1}{part}% + \if@cref@inresetlist% + \def#2{part}% + \else% + \let#2\relax% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi} +\newif\if@cref@refconsecutive% +\def\cref@isrefconsecutive#1#2{% + \begingroup% + \countdef\refa@counter=0% + \countdef\refb@counter=1% + \cref@getcounter{#1}{\@result}% + \refa@counter=\@result% + \cref@getcounter{#2}{\@result}% + \refb@counter=\@result% + \cref@getprefix{#1}{\refa@prefix}% + \cref@getprefix{#2}{\refb@prefix}% + \def\@after{\@cref@refconsecutivefalse}% + \ifx\refa@prefix\refb@prefix% + \ifnum\refa@counter=\refb@counter\relax% + \def\@after{\@cref@refconsecutivetrue}% + \else% + \advance\refa@counter 1\relax% + \ifnum\refa@counter=\refb@counter\relax% + \def\@after{\@cref@refconsecutivetrue}% + \fi% + \fi% + \fi% + \expandafter\endgroup\@after} +\def\cref@processgroup#1#2{% + \edef\@nextref{\cref@stack@top{#1}}% + \expandafter\ifx\csname r@\@nextref\endcsname\relax% + \def\@grouptype{\@undefined}% + \def\@groupformat{\@undefined}% + \else% + \expandafter\cref@gettype\expandafter{\@nextref}{\@grouptype}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@groupformat% + \expandafter\expandafter\expandafter{% + \csname cref@\@grouptype @format\endcsname% + {\@dummya}{\@dummyb}{\@dummyc}}% + \fi% + \let\@nexttype\@grouptype% + \let\@nextformat\@groupformat% + \@whilesw\ifx\@nextformat\@groupformat\fi{% + \expandafter\cref@stack@pull\expandafter{\@nextref}{#2}% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \let\@nexttype\relax% + \let\@nextformat\relax% + \else% + \edef\@nextref{\cref@stack@top{#1}}% + \ifx\@nextref\@empty% + \let\@nexttype\@grouptype% + \let\@nextforamt\@groupformat% + \else% + \expandafter\ifx\csname r@\@nextref\endcsname\relax% + \def\@nexttype{\@undefined}% + \def\@nextformat{\@undefined}% + \else% + \expandafter\cref@gettype\expandafter% + {\@nextref}{\@nexttype}% + \def\@tmpa{\@undefined}% + \ifx\@nexttype\@tmpa% + \def\@nextformat{\@undefined}% + \else% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@nextformat% + \expandafter\expandafter\expandafter{% + \csname cref@\@nexttype @format\endcsname% + {\@dummya}{\@dummyb}{\@dummyc}}% + \fi% + \fi% + \fi% + \fi}% +} +\def\cref@processgroupall#1#2{% + \cref@stack@init{\@tmpstack}% + \edef\@nextref{\cref@stack@top{#1}}% + \expandafter\ifx\csname r@\@nextref\endcsname\relax% + \def\@grouptype{\@undefined}% + \def\@groupformat{\@undefined}% + \else% + \expandafter\cref@gettype\expandafter{\@nextref}{\@grouptype}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@groupformat% + \expandafter\expandafter\expandafter{% + \csname cref@\@grouptype @format\endcsname% + {\@dummya}{\@dummyb}{\@dummyc}}% + \fi% + \let\@lasttype\@grouptype% + \let\@lastformat\@groupformat% + \cref@isstackfull{#1}% + \@whilesw\if@cref@stackfull\fi{% + \edef\@nextref{\cref@stack@top{#1}}% + \ifx\@nextref\@empty% + \ifx\@lastformat\@groupformat% + \let\@nexttype\@grouptype% + \let\@nextformat\@groupformat% + \else% + \let\@nexttype\relax% + \let\@nextformat\relax% + \fi% + \else% + \expandafter\ifx\csname r@\@nextref\endcsname\relax% + \def\@nexttype{\@undefined}% + \def\@nextformat{\@undefined}% + \else% + \expandafter\cref@gettype\expandafter% + {\@nextref}{\@nexttype}% + \def\@tmpa{\@undefined}% + \ifx\@nexttype\@tmpa% + \def\@nextformat{\@undefined}% + \else% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@nextformat% + \expandafter\expandafter\expandafter{% + \csname cref@\@nexttype @format\endcsname% + {\@dummya}{\@dummyb}{\@dummyc}}% + \fi% + \fi% + \fi% + \ifx\@nextformat\@groupformat% + \expandafter\cref@stack@pull\expandafter{\@nextref}{#2}% + \else% + \expandafter\cref@stack@pull\expandafter{\@nextref}{\@tmpstack}% + \fi% + \cref@stack@pop{#1}% + \let\@lasttype\@nexttype% + \let\@lastformat\@nextformat% + \cref@isstackfull{#1}}% + \let#1\@tmpstack} +\def\cref@processconsecutive#1#2#3#4{% + #4=0% + \edef\@nextref{\cref@stack@top{#1}}% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \edef#2{\@nextref}% + \let#3\relax% + #4=1\relax% + \else% + \edef#2{\@nextref}% + \let#3\relax% + \edef\@nextref{\cref@stack@top{#1}}% + #4=1\relax% + \expandafter\ifx\csname r@#2\endcsname\relax% + \@cref@refconsecutivefalse% + \else% + \ifx\@nextref\@empty% + \@cref@refconsecutivefalse% + \@whilesw\ifx\@nextref\@empty\fi{% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \let\@nextref\relax% + \else% + \edef\@nextref{\cref@stack@top{#1}}% + \fi}% + \else% + \expandafter\ifx\csname r@\@nextref\endcsname\relax% + \@cref@refconsecutivefalse% + \else% + \edef\@tmpa{{#2}{\@nextref}}% + \expandafter\cref@isrefconsecutive\@tmpa% + \fi% + \fi% + \fi% + \@whilesw\if@cref@refconsecutive\fi{% + \advance#4 1% + \let#3\@nextref% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \@cref@refconsecutivefalse% + \else% + \edef\@nextref{\cref@stack@top{#1}}% + \ifx\@nextref\@empty% + \@cref@refconsecutivefalse% + \@whilesw\ifx\@nextref\@empty\fi{% + \cref@stack@pop{#1}% + \cref@isstackempty{#1}% + \if@cref@stackempty% + \let\@nextref\relax% + \else% + \edef\@nextref{\cref@stack@top{#1}}% + \fi}% + \else% + \expandafter\ifx\csname r@\@nextref\endcsname\relax% + \@cref@refconsecutivefalse% + \else% + \edef\@tmpa{{#3}{\@nextref}}% + \expandafter\cref@isrefconsecutive\@tmpa% + \fi% + \fi% + \fi}% + \fi} +\DeclareRobustCommand{\cref}[1]{\@cref{cref}{#1}} +\DeclareRobustCommand{\Cref}[1]{\@cref{Cref}{#1}} +\DeclareRobustCommand{\crefrange}[2]{\@setcrefrange{#1}{#2}{cref}{}} +\DeclareRobustCommand{\Crefrange}[2]{\@setcrefrange{#1}{#2}{Cref}{}} +\def\@cref#1#2{% + \begingroup% + \countdef\count@consecutive=0% + \countdef\count@group=1% + \count@group=1% + \def\cref@variant{#1}% + \newif\if@secondref% + \cref@stack@init{\@refstack}% + \edef\@tmpa{#2}% + \expandafter\cref@stack@push\expandafter{\@tmpa}{\@refstack}% + \cref@isstackfull{\@refstack}% + \@whilesw\if@cref@stackfull\fi{% + \cref@stack@init{\@refsubstack}% + \if@cref@sort% + \cref@processgroupall{\@refstack}{\@refsubstack}% + \cref@stack@sort{\@refsubstack}{\cref@countercmp}% + \else% + \cref@processgroup{\@refstack}{\@refsubstack}% + \fi% + \ifnum\count@group=1\relax% + \advance\count@group 1% + \else% + \cref@isstackfull{\@refstack}% + \if@cref@stackfull% + \@setcref@middlegroupconjunction% + \else% + \ifnum\count@group=2\relax% + \@setcref@pairgroupconjunction% + \else% + \@setcref@lastgroupconjunction% + \fi% + \fi% + \advance\count@group 1% + \def\cref@variant{cref}% + \fi% + \if@cref@compress% + \cref@processconsecutive% + {\@refsubstack}{\@beginref}{\@endref}{\count@consecutive}% + \else% + \edef\@beginref{\cref@stack@top{\@refsubstack}}% + \cref@stack@pop{\@refsubstack}% + \@whilesw\ifx\@beginref\@empty\fi{% + \cref@stack@pop{\@refsubstack}% + \cref@isstackempty{\@refsubstack}% + \if@cref@stackempty% + \let\@beginref\relax% + \else% + \edef\@beginref{\cref@stack@top{\@refsubstack}}% + \fi}% + \let\@endref\relax% + \count@consecutive=1\relax% + \fi% + \ifnum\count@consecutive=1\relax% + \cref@isstackfull{\@refsubstack}% + \if@cref@stackfull% + \expandafter\@setcref% + \expandafter{\@beginref}{\cref@variant}{@first}% + \else% + \expandafter\@setcref% + \expandafter{\@beginref}{\cref@variant}{}% + \fi% + \else% + \ifnum\count@consecutive=2\relax% + \expandafter\@setcref% + \expandafter{\@beginref}{\cref@variant}{@first}% + \expandafter\cref@stack@push\expandafter% + {\@endref,}{\@refsubstack}% + \else% + \edef\@tmpa{{\@beginref}{\@endref}}% + \if@cref@stackempty% + \expandafter\@setcrefrange\@tmpa{\cref@variant}{}% + \else% + \expandafter\@setcrefrange\@tmpa{\cref@variant}{@first}% + \fi% + \fi% + \fi% + \@secondreftrue% + \cref@isstackfull{\@refsubstack}% + \@whilesw\if@cref@stackfull\fi{% + \if@cref@compress% + \cref@processconsecutive% + {\@refsubstack}{\@beginref}{\@endref}{\count@consecutive}% + \else% + \edef\@beginref{\cref@stack@top{\@refsubstack}}% + \cref@stack@pop{\@refsubstack}% + \@whilesw\ifx\@beginref\@empty\fi{% + \cref@stack@pop{\@refsubstack}% + \cref@isstackempty{\@refsubstack}% + \if@cref@stackempty% + \let\@beginref\relax% + \else% + \edef\@beginref{\cref@stack@top{\@refsubstack}}% + \fi}% + \let\@endref\relax% + \count@consecutive=1\relax% + \fi% + \cref@isstackempty{\@refsubstack}% + \if@cref@stackempty% + \if@secondref% + \def\@pos{@second}% + \else% + \def\@pos{@last}% + \fi% + \else% + \def\@pos{@middle}% + \fi% + \ifnum\count@consecutive=1\relax% + \edef\@tmpa{{\@beginref}{cref}{\@pos}}% + \expandafter\@setcref\@tmpa% + \else% + \ifnum\count@consecutive=2\relax% + \expandafter\@setcref\expandafter% + {\@beginref}{cref}{@middle}% + \expandafter\cref@stack@push\expandafter% + {\@endref}{\@refsubstack}% + \else% + \edef\@tmpa{{\@beginref}{\@endref}{cref}{\@pos}}% + \expandafter\@setcrefrange\@tmpa% + \fi% + \fi% + \@secondreffalse% + \cref@isstackfull{\@refsubstack}% + }% end loop over reference substack + \cref@isstackfull{\@refstack}% + }% end loop over main reference stack + \endgroup} +\def\@setcref#1#2#3{% + \expandafter\ifx\csname r@#1\endcsname\relax% + \protect\G@refundefinedtrue% + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#1' on page \thepage \space undefined}% + \else% + \cref@gettype{#1}{\@temptype}% puts label type in \@temptype + \cref@getlabel{#1}{\@templabel}% puts label in \@templabel + \expandafter\ifx\csname #2@\@temptype @format#3\endcsname\relax% + \protect\G@refundefinedtrue% + \nfss@text{\reset@font\bfseries ??}~\@templabel% + \@latex@warning{\string\Cref \space reference format for label + type `\@temptype' undefined}% + \else% + \expandafter\@@setcref\expandafter% + {\csname #2@\@temptype @format#3\endcsname}{#1}% + \fi% + \fi} +\def\@@setcref#1#2{\cref@getlabel{#2}{\@templabel}#1{\@templabel}{}{}} +\def\@setcrefrange#1#2#3#4{% + \begingroup% + \expandafter\ifx\csname r@#1\endcsname\relax% + \protect\G@refundefinedtrue% + \@latex@warning{Reference `#1' on page \thepage \space% + undefined}% + \expandafter\ifx\csname r@#2\endcsname\relax% + \nfss@text{\reset@font\bfseries ??}--% + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#2' on page \thepage \space% + undefined}% + \else% + \cref@getlabel{#2}{\@labelb}% + \nfss@text{\reset@font\bfseries ??}--\@labelb% + \fi% + \else% + \expandafter\ifx\csname r@#2\endcsname\relax% + \protect\G@refundefinedtrue% + \cref@getlabel{#1}{\@labela}% + \@labela--\nfss@text{\reset@font\bfseries ??}% + \@latex@warning{Reference `#2' on page \thepage % + \space undefined}% + \else% + \cref@gettype{#1}{\@typea}% + \cref@gettype{#2}{\@typeb}% + \cref@getlabel{#1}{\@labela}% + \cref@getlabel{#2}{\@labelb}% + \edef\@formata{\expandafter\noexpand% + \csname #3range@\@typea @format#4\endcsname}% + \edef\@formatb{\expandafter\noexpand% + \csname #3range@\@typeb @format#4\endcsname}% + \expandafter\ifx\@formata\relax% + \protect\G@refundefinedtrue% + \nfss@text{\reset@font\bfseries ??}~\@labela--\@labelb% + \@latex@warning{#3\space reference range format for label + type `\@typea' undefined}% + \else% + \ifx\formata\formatb% + \expandafter\@@setcrefrange\expandafter{\@formata}{#1}{#2}% + \else% + \protect\G@refundefinedtrue% + \nfss@text{\reset@font\bfseries ??}~\@labela--\@labelb% + \@latex@warning{Types inconsistent in reference range for + references `#1' and `#2' on page \thepage}% + \fi% + \fi% + \fi% + \fi% + \endgroup} +\def\@@setcrefrange#1#2#3{% + \cref@getlabel{#2}{\@labela}% + \cref@getlabel{#3}{\@labelb}% + #1{\@labela}{\@labelb}{}{}{}{}} +\def\@setcref@pairgroupconjunction{\crefpairgroupconjunction} +\def\@setcref@middlegroupconjunction{\crefmiddlegroupconjunction} +\def\@setcref@lastgroupconjunction{\creflastgroupconjunction} +\cref@stack@init{\cref@label@types} +\newcommand{\crefdefaultlabelformat}[1]{% + \def\cref@default@label##1##2##3{#1}} +\newcommand{\crefname}[3]{% + \@crefname{cref}{#1}{#2}{#3}{}} +\newcommand{\Crefname}[3]{% + \@crefname{Cref}{#1}{#2}{#3}{}} +\newcommand{\creflabelformat}[2]{% + \expandafter\def\csname cref@#1@label\endcsname##1##2##3{#2}% + \cref@stack@add{#1}{\cref@label@types}} +\newcommand{\crefrangelabelformat}[2]{% + \expandafter\def\csname cref@#1@rangelabel\endcsname% + ##1##2##3##4##5##6{#2}% + \cref@stack@add{#1}{\cref@label@types}} +\newcommand{\crefname@preamble}[3]{% + \@crefname{cref}{#1}{#2}{#3}{@preamble}} +\newcommand{\Crefname@preamble}[3]{% + \@crefname{Cref}{#1}{#2}{#3}{@preamble}} +\def\@crefname#1#2#3#4#5{% + \begingroup% + \expandafter\gdef\csname #1@#2@name#5\endcsname{#3}% + \expandafter\gdef\csname #1@#2@name@plural#5\endcsname{#4}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \def\@other{C##2}% + \def\@changecase{\expandafter\MakeUppercase}% + \else% + \def\@other{c##2}% + \if@cref@capitalise% + \def\@changecase{}% + \else% + \def\@changecase{\MakeLowercase}% + \fi% + \fi}% + \@tmpa#1\@nil% + \@ifundefined{\@other @#2@name#5}{% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \csname#1@#2@name\endcsname}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpb% + \expandafter\expandafter\expandafter{% + \csname#1@#2@name@plural\endcsname}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\@changecase\@tmpa}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpb% + \expandafter\expandafter\expandafter{% + \expandafter\@changecase\@tmpb}% + \toksdef\@toksa=0% + \@toksa={% + \expandafter\gdef\csname\@other @#2@name#5\endcsname}% + \expandafter\the\expandafter\@toksa\expandafter{\@tmpa}% + \@toksa={% + \expandafter\gdef\csname\@other @#2@name@plural#5\endcsname}% + \expandafter\the\expandafter\@toksa\expandafter{\@tmpb}% + }{}% + \endgroup% + \cref@stack@add{#2}{\cref@label@types}} +\def\@crefconstructcomponents#1{% + \@ifundefined{cref@#1@label}{% + \let\@tmplabel\cref@default@label% + }{% + \expandafter\let\expandafter\@tmplabel% + \csname cref@#1@label\endcsname% + }% + \@ifundefined{cref@#1@rangelabel}{% + \expandafter\def\expandafter\@tmpa\expandafter{% + \@tmplabel{####1}{####3}{####4}}% + \expandafter\def\expandafter\@tmpb\expandafter{% + \@tmplabel{####2}{####5}{####6}}% + \toksdef\@toksa=0% + \@toksa={\def\@tmprangelabel##1##2##3##4##5##6}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter\crefrangepreconjunction% + \expandafter\@tmpa\expandafter\crefrangeconjunction\@tmpb% + \crefrangepostconjunction}% + }{% + \expandafter\let\expandafter\@tmprangelabel% + \csname cref@#1@rangelabel\endcsname% + }% + \expandafter\def\expandafter\@tmplabel\expandafter{% + \@tmplabel{########1}{########2}{########3}}% + \expandafter\def\expandafter\@tmprangelabel\expandafter{% + \@tmprangelabel{########1}{########2}{########3}% + {########4}{########5}{########6}}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmpname% + % \expandafter\expandafter\expandafter{% + % \csname cref@#1@name\endcsname}% + \expandafter\def\expandafter\@tmpname\expandafter{% + \csname cref@#1@name\endcsname}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmpName% + % \expandafter\expandafter\expandafter{% + % \csname Cref@#1@name\endcsname}% + \expandafter\def\expandafter\@tmpName\expandafter{% + \csname Cref@#1@name\endcsname}% + \expandafter\def\expandafter\@tmpnameplural\expandafter{% + \csname cref@#1@name@plural\endcsname}% + \expandafter\def\expandafter\@tmpNameplural\expandafter{% + \csname Cref@#1@name@plural\endcsname}% +} +\def\@crefdefineformat#1{% + \begingroup% + \@crefconstructcomponents{#1}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpfirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpname\expandafter~\@tmplabel}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpFirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpName\expandafter~\@tmplabel}% + \toksdef\@toksa=0% + \@toksa={\crefformat{#1}}% + \expandafter\the\expandafter\@toksa\expandafter{\@tmpfirst}% + \@toksa={\Crefformat{#1}}% + \expandafter\the\expandafter\@toksa\expandafter{\@tmpFirst}% + \endgroup} +\def\@crefrangedefineformat#1{% + \begingroup% + \@crefconstructcomponents{#1}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpfirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpnameplural\expandafter~\@tmprangelabel}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpFirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpNameplural\expandafter~\@tmprangelabel}% + \toksdef\@toksa=0% + \@toksa={\crefrangeformat{#1}}% + \expandafter\the\expandafter\@toksa\expandafter{\@tmpfirst}% + \@toksa={\Crefrangeformat{#1}}% + \expandafter\the\expandafter\@toksa\expandafter{\@tmpFirst}% + \endgroup} +\def\@crefdefinemultiformat#1{% + \begingroup% + \@crefconstructcomponents{#1}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpfirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpnameplural\expandafter~\@tmplabel}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpFirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpNameplural\expandafter~\@tmplabel}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmpsecond% + % \expandafter\expandafter\expandafter{% + % \expandafter\crefpairconjunction\@tmplabel}% + \expandafter\def\expandafter\@tmpsecond\expandafter{% + \expandafter\crefpairconjunction\@tmplabel}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmpmiddle% + % \expandafter\expandafter\expandafter{% + % \expandafter\crefmiddleconjunction\@tmplabel}% + \expandafter\def\expandafter\@tmpmiddle\expandafter{% + \expandafter\crefmiddleconjunction\@tmplabel}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmplast% + % \expandafter\expandafter\expandafter{% + % \expandafter\creflastconjunction\@tmplabel}% + \expandafter\def\expandafter\@tmplast\expandafter{% + \expandafter\creflastconjunction\@tmplabel}% + \toksdef\@toksa=0% + \toksdef\@toksb=1% + \@toksb={}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpfirst}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpsecond}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpmiddle}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmplast}}% + \@toksa={\crefmultiformat{#1}}% + \expandafter\the\expandafter\@toksa\the\@toksb% + \@toksb={}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpFirst}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpsecond}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpmiddle}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmplast}}% + \@toksa={\Crefmultiformat{#1}}% + \expandafter\the\expandafter\@toksa\the\@toksb% + \endgroup} +\def\@crefrangedefinemultiformat#1{% + \begingroup% + \@crefconstructcomponents{#1}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpfirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpnameplural\expandafter~\@tmprangelabel}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpFirst% + \expandafter\expandafter\expandafter{% + \expandafter\@tmpNameplural\expandafter~\@tmprangelabel}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmpsecond% + % \expandafter\expandafter\expandafter{% + % \expandafter\crefpairconjunction\@tmprangelabel}% + \expandafter\def\expandafter\@tmpsecond\expandafter{% + \expandafter\crefpairconjunction\@tmprangelabel}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmpmiddle% + % \expandafter\expandafter\expandafter{% + % \expandafter\crefmiddleconjunction\@tmprangelabel}% + \expandafter\def\expandafter\@tmpmiddle\expandafter{% + \expandafter\crefmiddleconjunction\@tmprangelabel}% + % \expandafter\expandafter\expandafter\def% + % \expandafter\expandafter\expandafter\@tmplast% + % \expandafter\expandafter\expandafter{% + % \expandafter\creflastconjunction\@tmprangelabel}% + \expandafter\def\expandafter\@tmplast\expandafter{% + \expandafter\creflastconjunction\@tmprangelabel}% + \toksdef\@toksa=0% + \toksdef\@toksb=1% + \@toksb={}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpfirst}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpsecond}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpmiddle}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmplast}}% + \@toksa={\crefrangemultiformat{#1}}% + \expandafter\the\expandafter\@toksa\the\@toksb% + \@toksb={}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpFirst}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpsecond}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmpmiddle}}% + \expandafter\cref@append@toks\expandafter\@toksb\expandafter{% + \expandafter{\@tmplast}}% + \@toksa={\Crefrangemultiformat{#1}}% + \expandafter\the\expandafter\@toksa\the\@toksb% + \endgroup} +\def\@crefdefineallformats#1{% + \@crefdefineformat{#1}% + \@crefrangedefineformat{#1}% + \@crefdefinemultiformat{#1}% + \@crefrangedefinemultiformat{#1}} +\newcommand{\crefformat}[2]{\@crefformat{cref}{#1}{#2}} +\newcommand{\Crefformat}[2]{\@crefformat{Cref}{#1}{#2}} +\newcommand{\crefrangeformat}[2]{\@crefrangeformat{crefrange}{#1}{#2}} +\newcommand{\Crefrangeformat}[2]{\@crefrangeformat{Crefrange}{#1}{#2}} +\newcommand{\crefmultiformat}[5]{% + \@crefmultiformat{cref}{#1}{#2}{#3}{#4}{#5}} +\newcommand{\Crefmultiformat}[5]{% + \@crefmultiformat{Cref}{#1}{#2}{#3}{#4}{#5}} +\newcommand{\crefrangemultiformat}[5]{% + \@crefrangemultiformat{crefrange}{#1}{#2}{#3}{#4}{#5}} +\newcommand{\Crefrangemultiformat}[5]{% + \@crefrangemultiformat{Crefrange}{#1}{#2}{#3}{#4}{#5}} +\def\@crefformat#1#2#3{% + \begingroup% + \expandafter\gdef\csname #1@#2@format\endcsname##1##2##3{#3}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \def\@other{C##2}% + \def\@changecase{\expandafter\MakeUppercase}% + \else% + \def\@other{c##2}% + \if@cref@capitalise% + \def\@changecase{}% + \else% + \def\@changecase{\MakeLowercase}% + \fi% + \fi}% + \@tmpa#1\@nil% + \@ifundefined{\@other @#2@format}{% + \toksdef\@toksa=0% + \@toksa={\def\@tmpa##1##2##3}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \csname#1@#2@format\endcsname{##1}{##2}{##3}}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \expandafter\@changecase\@tmpa{##1}{##2}{##3}}% + \@toksa={% + \expandafter\gdef\csname\@other @#2@format\endcsname##1##2##3}% + \expandafter\the\expandafter\@toksa\expandafter{% + \@tmpa{##1}{##2}{##3}}% + }{}% + \endgroup} +\def\@crefrangeformat#1#2#3{% + \begingroup% + \expandafter\gdef\csname #1@#2@format\endcsname% + ##1##2##3##4##5##6{#3}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \def\@other{C##2}% + \def\@changecase{\expandafter\MakeUppercase}% + \else% + \def\@other{c##2}% + \if@cref@capitalise% + \def\@changecase{}% + \else% + \def\@changecase{\MakeLowercase}% + \fi% + \fi}% + \@tmpa#1\@nil% + \@ifundefined{\@other @#2@format}{% + \toksdef\@toksa=0% + \@toksa={\def\@tmpa##1##2##3##4##5##6}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \csname#1@#2@format\endcsname{##1}{##2}{##3}{##4}{##5}{##6}}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \expandafter\@changecase\@tmpa{##1}{##2}{##3}{##4}{##5}{##6}}% + \@toksa={\expandafter\gdef% + \csname\@other @#2@format\endcsname##1##2##3##4##5##6}% + \expandafter\the\expandafter\@toksa\expandafter{% + \@tmpa{##1}{##2}{##3}{##4}{##5}{##6}}% + }{}% + \endgroup} +\def\@crefmultiformat#1#2#3#4#5#6{% + \begingroup% + \expandafter\gdef\csname #1@#2@format@first\endcsname##1##2##3{#3}% + \expandafter\gdef\csname #1@#2@format@second\endcsname##1##2##3{#4}% + \expandafter\gdef\csname #1@#2@format@middle\endcsname##1##2##3{#5}% + \expandafter\gdef\csname #1@#2@format@last\endcsname##1##2##3{#6}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \def\@other{C##2}% + \def\@changecase{\expandafter\MakeUppercase}% + \else% + \def\@other{c##2}% + \if@cref@capitalise% + \def\@changecase{}% + \else% + \def\@changecase{\MakeLowercase}% + \fi% + \fi}% + \@tmpa#1\@nil% + \@ifundefined{\@other @#2@format@first}{% + \toksdef\@toksa=0% + \@toksa={\def\@tmpa##1##2##3}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \csname#1@#2@format@first\endcsname{##1}{##2}{##3}}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \expandafter\@changecase\@tmpa{##1}{##2}{##3}}% + \@toksa={% + \expandafter\gdef\csname\@other @#2@format@first\endcsname% + ##1##2##3}% + \expandafter\the\expandafter\@toksa\expandafter{% + \@tmpa{##1}{##2}{##3}}% + }{}% + \@ifundefined{\@other @#2@format@second}{% + \@toksa={% + \expandafter\global\expandafter\let% + \csname\@other @#2@format@second\endcsname}% + \expandafter\the\expandafter\@toksa% + \csname #1@#2@format@second\endcsname% + }{}% + \@ifundefined{\@other @#2@format@middle}{% + \@toksa={% + \expandafter\global\expandafter\let% + \csname\@other @#2@format@middle\endcsname}% + \expandafter\the\expandafter\@toksa% + \csname #1@#2@format@middle\endcsname% + }{}% + \@ifundefined{\@other @#2@format@last}{% + \@toksa={% + \expandafter\global\expandafter\let% + \csname\@other @#2@format@last\endcsname}% + \expandafter\the\expandafter\@toksa% + \csname #1@#2@format@last\endcsname% + }{}% + \endgroup} +\def\@crefrangemultiformat#1#2#3#4#5#6{% + \begingroup% + \expandafter\gdef\csname #1@#2@format@first\endcsname% + ##1##2##3##4##5##6{#3}% + \expandafter\gdef\csname #1@#2@format@second\endcsname% + ##1##2##3##4##5##6{#4}% + \expandafter\gdef\csname #1@#2@format@middle\endcsname% + ##1##2##3##4##5##6{#5}% + \expandafter\gdef\csname #1@#2@format@last\endcsname% + ##1##2##3##4##5##6{#6}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \def\@other{C##2}% + \def\@changecase{\expandafter\MakeUppercase}% + \else% + \def\@other{c##2}% + \if@cref@capitalise% + \def\@changecase{}% + \else% + \def\@changecase{\MakeLowercase}% + \fi% + \fi}% + \@tmpa#1\@nil% + \@ifundefined{\@other @#2@format@first}{% + \toksdef\@toksa=0% + \@toksa={\def\@tmpa##1##2##3##4##5##6}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \csname#1@#2@format@first\endcsname% + {##1}{##2}{##3}{##4}{##5}{##6}}% + \expandafter\expandafter\expandafter\the% + \expandafter\expandafter\expandafter\@toksa% + \expandafter\expandafter\expandafter{% + \expandafter\@changecase\@tmpa{##1}{##2}{##3}{##4}{##5}{##6}}% + \@toksa={% + \expandafter\gdef\csname\@other @#2@format@first\endcsname% + ##1##2##3##4##5##6}% + \expandafter\the\expandafter\@toksa\expandafter{% + \@tmpa{##1}{##2}{##3}{##4}{##5}{##6}}% + }{}% + \@ifundefined{\@other @#2@format@second}{% + \@toksa={% + \expandafter\global\expandafter\let% + \csname\@other @#2@format@second\endcsname}% + \expandafter\the\expandafter\@toksa% + \csname #1@#2@format@second\endcsname% + }{}% + \@ifundefined{\@other @#2@format@middle}{% + \@toksa={% + \expandafter\global\expandafter\let% + \csname\@other @#2@format@middle\endcsname}% + \expandafter\the\expandafter\@toksa% + \csname #1@#2@format@middle\endcsname% + }{}% + \@ifundefined{\@other @#2@format@last}{% + \@toksa={% + \expandafter\global\expandafter\let% + \csname\@other @#2@format@last\endcsname}% + \expandafter\the\expandafter\@toksa% + \csname #1@#2@format@last\endcsname% + }{}% + \endgroup} +\@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'}}{} + \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} + \def\H@refstepcounter#1{% + \stepcounter{#1}% + \cref@constructprefix{#1}{\@result}% + \protected@edef\@currentlabel{% + [#1][\arabic{#1}][\@result]% + \csname p@#1\endcsname\csname the#1\endcsname}} + \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}} + \renewcommand\appendix{% + \cref@old@appendix% + \@ifundefined{chapter}{% + \def\H@refstepcounter##1{% + \stepcounter{##1}% + \cref@constructprefix{##1}{\@result}% + \edef\@result{{2147483647}\@result}% + \def\@tmpa{##1}% + \def\@tmpb{section}% + \ifx\@tmpa\@tmpb% + \protected@edef\@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]% + \csname p@##1\endcsname\csname the##1\endcsname}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{subsubsection}% + \ifx\@tmpa\@tmpb% + \protected@edef\@currentlabel{% + [subsubappendix][\arabic{##1}][\@result]% + \csname p@##1\endcsname\csname the##1\endcsname}% + \else% + \protected@edef\@currentlabel{% + [##1][\arabic{##1}][\@result]% + \csname p@##1\endcsname\csname the##1\endcsname}% + \fi% + \fi% + \fi}% + }{% + \def\H@refstepcounter##1{% + \stepcounter{##1}% + \cref@constructprefix{##1}{\@result}% + \edef\@result{{2147483647}\@result}% + \def\@tmpa{##1}% + \def\@tmpb{chapter}% + \ifx\@tmpa\@tmpb% + \protected@edef\@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]% + \csname p@##1\endcsname\csname the##1\endcsname}% + \else% + \def\@tmpa{##1}% + \def\@tmpb{subsection}% + \ifx\@tmpa\@tmpb% + \protected@edef\@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{% + [subsubsubappendix][\arabic{##1}][\@result]% + \csname p@##1\endcsname\csname the##1\endcsname}% + \else% + \protected@edef\@currentlabel{% + [##1][\arabic{##1}][\@result]% + \csname p@##1\endcsname\csname the##1\endcsname}% + \fi% + \fi% + \fi% + \fi}% + }% + } + \newif\if@crefstarred + \DeclareRobustCommand{\cref}{% + \@ifstar{\@crefstar{cref}}{\@crefnostar{cref}}} + \DeclareRobustCommand{\Cref}{% + \@ifstar{\@crefstar{Cref}}{\@crefnostar{Cref}}} + \def\@crefnostar#1#2{\@cref{#1}{#2}} + \def\@crefstar#1#2{% + \@crefstarredtrue\@cref{#1}{#2}\@crefstarredfalse} + \DeclareRobustCommand{\crefrange}{% + \@ifstar{\@crefrangestar{cref}}{\@crefrangenostar{cref}}} + \DeclareRobustCommand{\Crefrange}{% + \@ifstar{\@crefrangestar{Cref}}{\@crefrangenostar{Cref}}} + \def\@crefrangenostar#1#2#3{\@setcrefrange{#2}{#3}{#1}{}} + \def\@crefrangestar#1#2#3{% + \@crefstarredtrue\@setcrefrange{#2}{#3}{#1}{}\@crefstarredfalse} + \def\@@setcref#1#2{% + \cref@getlabel{#2}{\@tmplabel}% + \if@crefstarred% + #1{\@tmplabel}{}{}% + \else% + \edef\@tmplink{\cref@hyperref{#2}}% + #1{\@tmplabel}{\hyper@linkstart{link}{\@tmplink}}{\hyper@linkend}% + \fi} + \def\@@setcrefrange#1#2#3{% + \cref@getlabel{#2}{\@labela}% + \cref@getlabel{#3}{\@labelb}% + \if@crefstarred% + #1{\@labela}{\@labelb}{}{}{}{}% + \else% + \edef\@linka{\cref@hyperref{#2}}% + \edef\@linkb{\cref@hyperref{#3}}% + #1{\@labela}{\@labelb}% + {\hyper@linkstart{link}{\@linka}}{\hyper@linkend}% + {\hyper@linkstart{link}{\@linkb}}{\hyper@linkend}% + \fi}% + \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} + \@ifpackageloaded{ntheorem}{% + \PackageInfo{cleveref}{`ntheorem' support loaded} + \@ifpackagewith{ntheorem}{thref}{% + \PackageWarning{cleveref}{`cleveref' supersedes `ntheorem's `thref' + option}% + \renewcommand{\thref}{\cref}}{} + \@ifundefined{theorem@prework}{\let\theorem@prework\relax}{} + \gdef\@thm#1#2#3{% + \if@thmmarks% + \stepcounter{end\InTheoType ctr}% + \fi% + \renewcommand{\InTheoType}{#1}% + \if@thmmarks% + \stepcounter{curr#1ctr}% + \setcounter{end#1ctr}{0}% + \fi% + \refstepcounter[#1]{#2}% <<<<< + \theorem@prework% + \thm@topsepadd \theorempostskipamount% + \ifvmode \advance\thm@topsepadd\partopsep\fi% + \trivlist% + \@topsep \theorempreskipamount% + \@topsepadd \thm@topsepadd% + \advance\linewidth -\theorem@indent% + \advance\@totalleftmargin \theorem@indent% + \parshape \@ne \@totalleftmargin \linewidth% + \@ifnextchar[{\@ythm{#1}{#2}{#3}}{\@xthm{#1}{#2}{#3}}%] + }}{}% end of \@ifpackageloaded +\@ifpackageloaded{varioref}{% + \PackageInfo{cleveref}{`varioref' support loaded} + \PackageInfo{cleveref}{`cleveref' supersedes `varioref's % + $\backslash$labelformat command, which will not work} + \AtBeginDocument{% + \def\cref@vref#1#2{% + \if@cref@legacyvarioref% + \leavevmode\unskip\vref@space + \fi% + \@cref{#1}{#2} % space here is deliberate + \begingroup% + \def\@tmpstack{#2,\@nil}% + \cref@stack@topandbottom{\@tmpstack}{\@firstref}{\@lastref}% + \ifx\@lastref\@empty% + \vpageref{#2}% + \else% + \edef\@tmpa{{\@firstref}{\@lastref}}% + \expandafter\vpagerefrange\@tmpa% + \fi% + \endgroup} + \def\cref@vrefrange#1#2#3{% + \@setcrefrange{#2}{#3}{#1}{} \vpagerefrange{#2}{#3}} + \def\cref@fullref#1#2{% + \@cref{#1}{#2} % space here is deliberate + \begingroup% + \def\@tmpstack{#2,\@nil}% + \cref@stack@topandbottom{\@tmpstack}{\@firstref}{\@lastref}% + \ifx\@lastref\@empty% + \reftextfaraway{#2}% + \else% + \expandafter\vrefpagenum\expandafter% + \@tmpa\expandafter{\@firstref}% + \expandafter\vrefpagenum\expandafter% + \@tmpb\expandafter{\@lastref}% + \ifx\@tmpa\@tmpb + \expandafter\reftextfaraway\expandafter{\@firstref}% + \else + \edef\@tmpa{{\@firstref}{\@lastref}}% + \expandafter\reftextpagerange\@tmpa% + \fi% + \fi% + \endgroup} + \if@cref@legacyvarioref% + \def\vr@f#1{\cref@vref{cref}{#1}} + \def\Vr@f#1{\cref@vref{Cref}{#1}} + \renewcommand\vrefrange[3][\reftextcurrent]{% + \crefrange{#2}{#3} \vpagerefrange{#2}{#3}} + \def\fullref#1{\cref@fullref{cref}{#1}} + \else% + \@ifpackageloaded{hyperref}{% + \DeclareRobustCommand{\vref}{% + \@ifstar{\cref@vrefstar{cref}}{\cref@vref{cref}}} + \DeclareRobustCommand{\Vref}{% + \@ifstar{\cref@vrefstar{Cref}}{\cref@vref{Cref}}} + \DeclareRobustCommand{\vrefrange}{% + \@ifstar{\cref@vrefrangestar{cref}}{\cref@vrefrange{cref}}} + \DeclareRobustCommand{\Vrefrange}{% + \@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} + \def\cref@vrefrangestar#1#2#3{% + \@crefstarredtrue% + \cref@vrefrange{#1}{#2}{#3}% + \@crefstarredfalse} + \def\cref@fullrefstar#1#2{% + \@crefstarredtrue% + \cref@fullref{#1}{#2}% + \@crefstarredfalse} + }{% + \DeclareRobustCommand{\vref}{\cref@vref{cref}} + \DeclareRobustCommand{\Vref}{\cref@vref{Cref}} + \DeclareRobustCommand{\vrefrange}{\cref@vrefrange{cref}} + \DeclareRobustCommand{\Vrefrange}{\cref@vrefrange{Cref}} + \DeclareRobustCommand{\fullref}{\cref@fullref{cref}} + \DeclareRobustCommand{\Fullref}{\cref@fullref{Cref}} + } + \fi% + }% end of \AtBeginDocument + }{}% end of \@ifpackageloaded +\let\if@cref@legacyvarioref\iffalse +\DeclareOption{legacyvarioref}{% + \PackageInfo{cleveref}{legacy `varioref' compatibility enabled} + \let\if@cref@legacyvarioref\iftrue} +\DeclareOption{poorman}{% + \PackageInfo{cleveref}{option `poorman' loaded} + \gdef\cref@poorman@text{} + \AtBeginDocument{% + \newwrite\@crefscript% + \immediate\openout\@crefscript=\jobname.sed} + \newif\if@cref@switched@language + \@ifpackageloaded{babel}{% + \AtBeginDocument{% + \let\cref@old@select@language\select@language + \def\select@language{% + \@cref@switched@languagetrue% + \cref@writelanguagerules% + \cref@old@select@language} + \let\cref@old@forreign@language\forreign@language + \def\forreign@language{% + \@cref@switched@languagetrue% + \cref@writelanguagerules% + \cref@old@forreign@language} + \edef\cref@inputlineno{\the\inputlineno}}% + }{} + \AtEndDocument{% + \let\select@language\cref@old@select@language% + \let\forreign@language\cref@old@forreign@language% + \cref@writelanguagerules} + \def\cref@writelanguagerules{% + \begingroup% + \if@cref@switched@language% + \edef\@address{\cref@inputlineno,\the\inputlineno}% + \else% + \def\@address{}% + \fi% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefrangeconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefrangeconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefrangepreconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefrangepreconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefrangepostconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefrangepostconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefpairconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefpairconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefmiddleconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefmiddleconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \creflastconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\creflastconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefpairgroupconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefpairgroupconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \crefmiddlegroupconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\crefmiddlegroupconjunction}} + \expandafter\cref@writescript\@tmpa% + \expandafter\def\expandafter\cref@poorman@text\expandafter{% + \creflastgroupconjunction}% + \expandafter\def\expandafter\@tmpa\expandafter{% + \expandafter{\@address}{\string\creflastgroupconjunction}} + \expandafter\cref@writescript\@tmpa% + \let\@tmpstack\cref@label@types% + \cref@isstackfull{\@tmpstack}% + \@whilesw\if@cref@stackfull\fi{% + \edef\@tmpa{\cref@stack@top{\@tmpstack}}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\cref@poorman@text% + \expandafter\expandafter\expandafter{% + \csname cref@\@tmpa @name\endcsname}% + \edef\@tmpa{% + \string\cref@\expandafter\noexpand\@tmpa @name\space}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \expandafter\@address\expandafter}% + \expandafter{\@tmpa}} + \expandafter\cref@writescript\@tmpa% + \edef\@tmpa{\cref@stack@top{\@tmpstack}}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\cref@poorman@text% + \expandafter\expandafter\expandafter{% + \csname cref@\@tmpa @name@plural\endcsname}% + \edef\@tmpa{% + \string\cref@\expandafter\noexpand\@tmpa% + @name@plural\space}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \expandafter\@address\expandafter}% + \expandafter{\@tmpa}} + \expandafter\cref@writescript\@tmpa% + \edef\@tmpa{\cref@stack@top{\@tmpstack}}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\cref@poorman@text% + \expandafter\expandafter\expandafter{% + \csname Cref@\@tmpa @name\endcsname}% + \edef\@tmpa{% + \string\Cref@\expandafter\noexpand\@tmpa @name\space}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter% + {\expandafter\@address\expandafter}% + \expandafter{\@tmpa}} + \expandafter\cref@writescript\@tmpa% + \edef\@tmpa{\cref@stack@top{\@tmpstack}}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\cref@poorman@text% + \expandafter\expandafter\expandafter{% + \csname Cref@\@tmpa @name@plural\endcsname}% + \edef\@tmpa{% + \string\Cref@\expandafter\noexpand\@tmpa% + @name@plural\space}% + \expandafter\expandafter\expandafter\def% + \expandafter\expandafter\expandafter\@tmpa% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter% + {\expandafter\@address\expandafter}% + \expandafter{\@tmpa}} + \expandafter\cref@writescript\@tmpa% + \cref@stack@pop{\@tmpstack}% + \cref@isstackfull{\@tmpstack}}% + \endgroup% + \edef\cref@inputlineno{\the\inputlineno}}% + \AtEndDocument{% + \immediate\closeout\@crefscript% + \newread\@crefscript% + \immediate\openin\@crefscript=\jobname.sed% + \begingroup% + \newif\if@not@eof% + \def\@eof{\par }% + \catcode`.=13 \catcode`*=13 + \catcode`[=13 \catcode`]=13 + \catcode`^=13 \catcode`$=13 %$ + \catcode`\=0 \catcode`<=1 \catcode`>=2 + \catcode`\\=13 \catcode`\{=12 \catcode`\}=12 \catcode`_=12 + \lccode`/=92 + \lccode`~=92\lowercase{\def~{\string/\string/}}% + \lccode`~=42\lowercase{\def~{\string/\string*}}% + \lccode`~=46\lowercase{\def~{\string/\string.}}% + \lccode`~=91\lowercase{\def~{\string/\string[}}% + \lccode`~=93\lowercase{\def~{\string/\string]}}% + \lccode`~=94\lowercase{\def~{\string/\string^}}% + \lccode`~=36\lowercase{\def~{\string/\string$}}% $ + \lccode`~=0 \lccode`/=0 \catcode`~=12 + \def\cref@poorman@text{}% + \immediate\read\@crefscript to \@tmpa% + \ifx\@tmpa\@eof% + \@not@eoffalse% + \else% + \@not@eoftrue% + \edef\@tmpa{\@tmpa}% + \fi% + \@whilesw\if@not@eof\fi{% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \immediate\read\@crefscript to \@tmpa% + \ifx\@tmpa\@eof% + \@not@eoffalse% + \else% + \@not@eoftrue% + \edef\@tmpa{\@tmpa}% + \fi}% + \endgroup% + \immediate\closein\@crefscript% + \begingroup% + \lccode`|=92 \lccode`<=123 \lccode`>=125 \lccode`C=67 + \lowercase{\def\@tmpa{%[ + s/||label|[[^]]*|]/||label/g}} + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||usepackage|(|[.*|]|)|?//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]refformat<.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]refrangeformat<.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]refmultiformat<.*><.*><.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||[cC]refrangemultiformat<.*><.*><.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]refname<.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]reflabelformat<.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]refrangelabelformat<.*><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||[cC]refdefaultlabelformat<.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||renewcommand<||crefpairconjunction><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||renewcommand<||crefpairgroupconjunction><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||renewcommand<||crefmiddleconjunction><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||renewcommand<||crefmiddlegroupconjunction><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||renewcommand<||creflastconjunction><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{% + s/||renewcommand<||creflastgroupconjunction><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||renewcommand<||[cC]ref><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \lowercase{\edef\@tmpa{s/||renewcommand<||[cC]refrange><.*>//g}}% + \expandafter\g@addto@macro\expandafter% + \cref@poorman@text\expandafter{\@tmpa^^J}% + \endgroup% + \newwrite\@crefscript% + \immediate\openout\@crefscript=\jobname.sed% + \immediate\write\@crefscript{\cref@poorman@text}% + \immediate\closeout\@crefscript% + } + \def\cref@getmeaning#1{\expandafter\@cref@getmeaning\meaning#1\@nil} + \def\@cref@getmeaning#1->#2\@nil{#2} + \def\cref@writescript#1#2{% + \edef\@tmpa{\cref@getmeaning{\cref@poorman@text}}% + \immediate\write\@crefscript{#1 s/#2/\@tmpa/g}} + \@ifpackageloaded{hyperref}{% + \def\@crefnostar#1#2{% + \gdef\cref@poorman@text{}% + \@cref{#1}{#2}% + \begingroup% + \lccode`|=92 \lccode`<=123 \lccode`>=125 \lccode`C=67 + \lowercase{\cref@writescript{}{|#1<#2>}}% + \endgroup} + \def\@crefstar#1#2{% + \gdef\cref@poorman@text{}% + \@crefstarredtrue\@cref{#1}{#2}\@crefstarredfalse% + \begingroup% + \lccode`|=92 \lccode`<=123 \lccode`>=125 \lccode`C=67 + \lowercase{\cref@writescript{}{|#1*<#2>}}% + \endgroup} + \def\@crefrangenostar#1#2#3{% + \gdef\cref@poorman@text{}% + \@setcrefrange{#2}{#3}{#1}{}% + \begingroup% + \lccode`|=92 \lccode`<=123 \lccode`>=125 \lccode`C=67 + \lowercase{\cref@writescript{}{|#1range<#2><#3>}}% + \endgroup} + \def\@crefrangestar#1#2#3{% + \gdef\cref@poorman@text{}% + \@crefstarredtrue\@setcrefrange{#2}{#3}{#1}{}\@crefstarredfalse% + \begingroup% + \lccode`|=92 \lccode`<=123 \lccode`>=125 \lccode`C=67 + \lowercase{\cref@writescript{}{|#1range*<#2><#3>}}% + \endgroup} + }{% + \DeclareRobustCommand{\cref}[1]{% + \edef\cref@poorman@text{}% + \@cref{cref}{#1}% + \cref@writescript{}{\string\cref\string{#1\string}}} + \DeclareRobustCommand{\Cref}[1]{% + \edef\cref@poorman@text{}% + \@cref{Cref}{#1}% + \cref@writescript{}{\string\Cref\string{#1\string}}} + \DeclareRobustCommand{\crefrange}[2]{% + \edef\cref@poorman@text{}% + \@setcrefrange{#1}{#2}{cref}{}% + \cref@writescript{}{% + \string\crefrange\string{#1\string}\string{#2\string}}} + \DeclareRobustCommand{\Crefrange}[2]{% + \edef\cref@poorman@text{}% + \@setcrefrange{#1}{#2}{Cref}{}% + \cref@writescript{}{% + \string\Crefrange\string{#1\string}\string{#2\string}}} + } + \@ifpackageloaded{varioref}{% + \AtBeginDocument{% + \if@cref@legacyvarioref% + \DeclareRobustCommand{\vref}{% + \@ifstar{\cref@vrefstar{cref}}{\cref@vref{cref}}} + \def\cref@vrefstar#1#2{% + \@crefstarredtrue\cref@vref{#1}{#2}\@crefstarredfalse} + \fi + \def\cref@vref#1#2{% + \gdef\cref@poorman@text{}% + \if@cref@legacyvarioref% + \leavevmode\unskip\vref@space + \fi% + \begingroup% + \let\if@tmp\if@crefstarred% + \if@cref@legacyvarioref\@crefstarredfalse\fi% + \@cref{#1}{#2} % space here is deliberate + \let\if@crefstarred\if@tmp% + \def\@tmpstack{#2,\@nil}% + \cref@stack@topandbottom{\@tmpstack}{\@firstref}{\@lastref}% + \ifx\@lastref\@empty% + \vpageref{#2}% + \g@addto@macro\cref@poorman@text{ \vpageref{#2}}% + \else% + \g@addto@macro\cref@poorman@text{ }% + \edef\@tmpa{{\@firstref}{\@lastref}}% + \expandafter\vpagerefrange\@tmpa% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{\expandafter\vpagerefrange\@tmpa}% + \fi% + \def\@tmpa##1##2\@nil{% + \if##1c% + \if@crefstarred% + \cref@writescript{}{\string\vref*\string{#2\string}}% + \else% + \cref@writescript{}{\string\vref\string{#2\string}}% + \fi% + \else% + \if@crefstarred% + \cref@writescript{}{\string\Vref*\string{#2\string}}% + \else% + \cref@writescript{}{\string\Vref\string{#2\string}}% + \fi% + \fi}% + \@tmpa#1\@nil% + \endgroup} + \def\cref@vrefrange#1#2#3{% + \gdef\cref@poorman@text{}% + \@setcrefrange{#2}{#3}{#1}{} \vpagerefrange{#2}{#3}% + \g@addto@macro\cref@poorman@text{ \vpagerefrange{#2}{#3}}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \if@crefstarred% + \cref@writescript{}{% + \string\vrefrange*\string{#2\string}\string{#3\string}}% + \else% + \cref@writescript{}{% + \string\vrefrange\string{#2\string}\string{#3\string}}% + \fi% + \else% + \if@crefstarred% + \cref@writescript{}{% + \string\Vrefrange*\string{#2\string}\string{#3\string}}% + \else% + \cref@writescript{}{% + \string\Vrefrange\string{#2\string}\string{#3\string}}% + \fi% + \fi}% + \@tmpa#1\@nil} + \def\cref@fullref#1#2{% + \gdef\cref@poorman@text{}% + \begingroup% + \@cref{#1}{#2} % space here is deliberate + \def\@tmpstack{#2,\@nil}% + \cref@stack@topandbottom{\@tmpstack}{\@firstref}{\@lastref}% + \ifx\@lastref\@empty% + \reftextfaraway{#2}% + \def\@pageref{\reftextfaraway{#1}}% + \else% + \expandafter\vrefpagenum\expandafter% + \@tmpa\expandafter{\@firstref}% + \expandafter\vrefpagenum\expandafter% + \@tmpb\expandafter{\@lastref}% + \ifx\@tmpa\@tmpb + \expandafter\reftextfaraway\expandafter{\@firstref}% + \expandafter\def\expandafter\@pageref\expandafter{% + \expandafter\reftextfaraway\expandafter{\@firstref}}% + \else + \edef\@tmpa{{\@firstref}{\@lastref}}% + \expandafter\reftextpagerange\@tmpa% + \expandafter\def\expandafter\@pageref\expandafter{% + \expandafter\reftextpagerange\@tmpa}% + \fi% + \fi% + \g@addto@macro\cref@poorman@text{ }% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{\@pageref}% + \def\@tmpa##1##2\@nil{% + \if##1c% + \if@crefstarred% + \cref@writescript{}{\string\fullref*\string{#2\string}}% + \else% + \cref@writescript{}{\string\fullref\string{#2\string}}% + \fi% + \else% + \if@crefstarred% + \cref@writescript{}{\string\Fullref*\string{#2\string}}% + \else% + \cref@writescript{}{\string\Fullref\string{#2\string}}% + \fi% + \fi}% + \@tmpa#1\@nil + \endgroup} + }% end of \AtBeginDocument + }{}% end of \@ifpackageloaded + \def\@setcref@pairgroupconjunction{% + \crefpairgroupconjunction% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{\crefpairgroupconjunction}} + \def\@setcref@middlegroupconjunction{% + \crefmiddlegroupconjunction% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{\crefmiddlegroupconjunction}} + \def\@setcref@lastgroupconjunction{% + \creflastgroupconjunction% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{\creflastgroupconjunction}} + \@ifpackageloaded{hyperref}{% + \def\@@setcref#1#2{% + \cref@getlabel{#2}{\@tmplabel}% + \if@crefstarred% + #1{\@tmplabel}{}{}% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{#1{\ref*{#2}}{}{}}% + \else% + \edef\@tmplink{\cref@hyperref{#2}}% + #1{\@tmplabel}{\hyper@linkstart{link}{\@tmplink}}% + {\hyper@linkend}% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{#1{\ref{#2}}{}{}}% + \fi} + \def\@@setcrefrange#1#2#3{% + \cref@getlabel{#2}{\@labela}% + \cref@getlabel{#3}{\@labelb}% + \if@crefstarred% + #1{\@labela}{\@labelb}{}{}{}{}% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{#1{\ref*{#2}}{\ref*{#3}}{}{}{}{}}% + \else% + \edef\@linka{\cref@hyperref{#2}}% + \edef\@linkb{\cref@hyperref{#3}}% + #1{\@labela}{\@labelb}% + {\hyper@linkstart{link}{\@linka}}{\hyper@linkend}% + {\hyper@linkstart{link}{\@linkb}}{\hyper@linkend}% + \expandafter\g@addto@macro\expandafter\cref@poorman@text% + \expandafter{#1{\ref{#2}}{\ref{#3}}{}{}{}{}}% + \fi} + }{% + \def\@@setcref#1#2{% + \old@@setcref{#1}{#2}% + \expandafter\g@addto@macro\expandafter{% + \expandafter\cref@poorman@text\expandafter}\expandafter{% + #1{\ref{#2}}{}{}}} + \def\@@setcrefrange#1#2#3{% + \old@@setcrefrange{#1}{#2}{#3}% + \expandafter\g@addto@macro% + \expandafter{\expandafter\cref@poorman@text\expandafter}% + \expandafter{#1{\ref{#2}}{\ref{#3}}{}{}{}{}}} + } +}% end of poorman option +\newif\if@cref@sort +\newif\if@cref@compress +\@cref@sorttrue +\@cref@compresstrue +\DeclareOption{sort}{% + \PackageInfo{cleveref}{sorting but not compressing references} + \@cref@sorttrue + \@cref@compressfalse} +\DeclareOption{compress}{% + \PackageInfo{cleveref}{compressing but not sorting references} + \@cref@sortfalse + \@cref@compresstrue} +\DeclareOption{sort&compress}{% + \PackageInfo{cleveref}{sorting and compressing references} + \@cref@sorttrue + \@cref@compresstrue} +\DeclareOption{nosort}{% + \PackageInfo{cleveref}{neither sorting nor compressing references} + \@cref@sortfalse + \@cref@compressfalse} +\newif\if@cref@capitalise +\@cref@capitalisefalse +\DeclareOption{capitalise}{% + \PackageInfo{cleveref}{always capitalise cross-reference names} + \@cref@capitalisetrue} +\DeclareOption{capitalize}{% + \PackageInfo{cleveref}{always capitalise cross-reference names} + \@cref@capitalisetrue} +\crefdefaultlabelformat{#2#1#3} +\creflabelformat{equation}{\textup{(#2#1#3)}} +\def\cref@addto#1#2{% + \@temptokena{#2}% + \ifx#1\undefined + \edef#1{\the\@temptokena}% + \else + \toks@\expandafter{#1}% + \edef#1{\the\toks@\the\@temptokena}% + \fi + \@temptokena{}\toks@\@temptokena% +} +\@onlypreamble\cref@addto +\DeclareOption{english}{% + \PackageInfo{cleveref}{loaded `english' language definitions} + \AtBeginDocument{% + \def\crefrangeconjunction@preamble{ to~}% + \def\crefrangepreconjunction@preamble{}% + \def\crefrangepostconjunction@preamble{}% + \def\crefpairconjunction@preamble{ and~}% + \def\crefmiddleconjunction@preamble{, }% + \def\creflastconjunction@preamble{ and~}% + \def\crefpairgroupconjunction@preamble{ and~}% + \def\crefmiddlegroupconjunction@preamble{, }% + \def\creflastgroupconjunction@preamble{, and~}% + \Crefname@preamble{equation}{Equation}{Equations}% + \Crefname@preamble{chapter}{Chapter}{Chapters}% + \Crefname@preamble{section}{Section}{Sections}% + \Crefname@preamble{appendix}{Appendix}{Appendices}% + \Crefname@preamble{figure}{Figure}{Figures}% + \Crefname@preamble{table}{Table}{Tables}% + \Crefname@preamble{enumi}{Item}{Items}% + \Crefname@preamble{lemma}{Lemma}{Lemmas}% + \Crefname@preamble{corollary}{Corollary}{Corollaries}% + \Crefname@preamble{proposition}{Proposition}{Propositions}% + \Crefname@preamble{definition}{Definition}{Definitions}% + \Crefname@preamble{result}{Result}{Results}% + \Crefname@preamble{example}{Example}{Examples}% + \Crefname@preamble{remark}{Remark}{Remarks}% + \Crefname@preamble{note}{Note}{Notes}% + \if@cref@capitalise% + \crefname@preamble{equation}{Eq.}{Eqs.}% + \crefname@preamble{chapter}{Chapter}{Chapters}% + \crefname@preamble{section}{Section}{Sections}% + \crefname@preamble{appendix}{Appendix}{Appendices}% + \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}% + \crefname@preamble{definition}{Definition}{Definitions}% + \crefname@preamble{result}{Result}{Results}% + \crefname@preamble{example}{Example}{Examples}% + \crefname@preamble{remark}{Remark}{Remarks}% + \crefname@preamble{note}{Note}{Notes}% + \else% + \crefname@preamble{equation}{eq.}{eqs.}% + \crefname@preamble{chapter}{chapter}{chapters}% + \crefname@preamble{section}{section}{sections}% + \crefname@preamble{appendix}{appendix}{appendices}% + \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}% + \crefname@preamble{definition}{definition}{definitions}% + \crefname@preamble{result}{result}{results}% + \crefname@preamble{example}{example}{examples}% + \crefname@preamble{remark}{remark}{remarks}% + \crefname@preamble{note}{note}{notes}% + \fi% + \def\cref@language{english}% + \cref@addto\extrasenglish{% + \renewcommand{\crefrangeconjunction}{ to~}% + \renewcommand\crefrangepreconjunction{}% + \renewcommand\crefrangepostconjunction{}% + \renewcommand{\crefpairconjunction}{ and~}% + \renewcommand{\crefmiddleconjunction}{, }% + \renewcommand{\creflastconjunction}{ and~}% + \renewcommand{\crefpairgroupconjunction}{ and~}% + \renewcommand{\crefmiddlegroupconjunction}{, }% + \renewcommand{\creflastgroupconjunction}{, and~}% + \Crefname{equation}{Equation}{Equations}% + \Crefname{chapter}{Chapter}{Chapters}% + \Crefname{section}{Section}{Sections}% + \Crefname{subsection}{Section}{Sections}% + \Crefname{subsubsection}{Section}{Sections}% + \Crefname{appendix}{Appendix}{Appendices}% + \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{lemma}{Lemma}{Lemmas}% + \Crefname{corollary}{Corollary}{Corollaries}% + \Crefname{proposition}{Proposition}{Propositions}% + \Crefname{definition}{Definition}{Definitions}% + \Crefname{result}{Result}{Results}% + \Crefname{example}{Example}{Examples}% + \Crefname{remark}{Remark}{Remarks}% + \Crefname{note}{Note}{Notes}% + \if@cref@capitalise% + \crefname{equation}{Eq.}{Eqs.}% + \crefname{chapter}{Chapter}{Chapters}% + \crefname{section}{Section}{Sections}% + \crefname{subsection}{Section}{Sections}% + \crefname{subsubsection}{Section}{Sections}% + \crefname{appendix}{Appendix}{Appendices}% + \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{lemma}{Lemma}{Lemmas}% + \crefname{corollary}{Corollary}{Corollaries}% + \crefname{proposition}{Proposition}{Propositions}% + \crefname{definition}{Definition}{Definitions}% + \crefname{result}{Result}{Results}% + \crefname{example}{Example}{Examples}% + \crefname{remark}{Remark}{Remarks}% + \crefname{note}{Note}{Notes}% + \else% + \crefname{equation}{eq.}{eqs.}% + \crefname{chapter}{chapter}{chapters}% + \crefname{section}{section}{sections}% + \crefname{subsection}{section}{sections}% + \crefname{subsubsection}{section}{sections}% + \crefname{appendix}{appendix}{appendices}% + \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{lemma}{lemma}{lemmas}% + \crefname{corollary}{corollary}{corollaries}% + \crefname{proposition}{proposition}{propositions}% + \crefname{definition}{definition}{definitions}% + \crefname{result}{result}{results}% + \crefname{example}{example}{examples}% + \crefname{remark}{remark}{remarks}% + \crefname{note}{note}{notes}% + \fi% + }}} +\DeclareOption{german}{% + \PackageInfo{cleveref}{loaded `german' language definitions} + \AtBeginDocument{% + \def\crefrangeconjunction@preamble{ bis~}% + \def\crefrangepreconjunction@preamble{}% + \def\crefrangepostconjunction@preamble{}% + \def\crefpairconjunction@preamble{ und~}% + \def\crefmiddleconjunction@preamble{, }% + \def\creflastconjunction@preamble{ und~}% + \def\crefpairgroupconjunction@preamble{ und~}% + \def\crefmiddlegroupconjunction@preamble{, }% + \def\creflastgroupconjunction@preamble{ und~}% + \Crefname@preamble{equation}{Gleichung}{Gleichungen}% + \Crefname@preamble{chapter}{Kapitel}{Kapitel}% + \Crefname@preamble{section}{Abschnitt}{Abschnitte}% + \Crefname@preamble{appendix}{Anhang}{Anh\"ange}% + \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}% + \Crefname@preamble{definition}{Definition}{Definitionen}% + \Crefname@preamble{result}{Ergebnis}{Ergebnisse}% + \Crefname@preamble{example}{Beispiel}{Beispiele}% + \Crefname@preamble{remark}{Bemerkung}{Bemerkungen}% + \Crefname@preamble{note}{Anmerkung}{Anmerkungen}% + \if@cref@capitalise% + \crefname@preamble{equation}{Gleichung}{Gleichungen}% + \crefname@preamble{chapter}{Kapitel}{Kapitel}% + \crefname@preamble{section}{Abschnitt}{Abschnitte}% + \crefname@preamble{appendix}{Anhang}{Anh\"ange}% + \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}% + \crefname@preamble{definition}{Definition}{Definitionen}% + \crefname@preamble{result}{Ergebnis}{Ergebnisse}% + \crefname@preamble{example}{Beispiel}{Beispiele}% + \crefname@preamble{remark}{Bemerkung}{Bemerkungen}% + \crefname@preamble{note}{Anmerkung}{Anmerkungen}% + \else% + \crefname@preamble{equation}{Gleichung}{Gleichungen}% + \crefname@preamble{chapter}{Kapitel}{Kapitel}% + \crefname@preamble{section}{Abschnitt}{Abschnitte}% + \crefname@preamble{appendix}{Anhang}{Anh\"ange}% + \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}% + \crefname@preamble{definition}{Definition}{Definitionen}% + \crefname@preamble{result}{Ergebnis}{Ergebnisse}% + \crefname@preamble{example}{Beispiel}{Beispiele}% + \crefname@preamble{remark}{Bemerkung}{Bemerkungen}% + \crefname@preamble{note}{Anmerkung}{Anmerkungen}% + \fi% + \def\cref@language{german}% + \cref@addto\extrasgerman{% + \renewcommand{\crefrangeconjunction}{ bis~}% + \renewcommand\crefrangepreconjunction{}% + \renewcommand\crefrangepostconjunction{}% + \renewcommand{\crefpairconjunction}{ und~}% + \renewcommand{\crefmiddleconjunction}{, }% + \renewcommand{\creflastconjunction}{ und~}% + \renewcommand{\crefpairgroupconjunction}{ und~}% + \renewcommand{\crefmiddlegroupconjunction}{, }% + \renewcommand{\creflastgroupconjunction}{ und~}% + \Crefname{equation}{Gleichung}{Gleichungen}% + \Crefname{chapter}{Kapitel}{Kapitel}% + \Crefname{section}{Abschnitt}{Abschnitte}% + \Crefname{subsection}{Abschnitt}{Abschnitte}% + \Crefname{subsubsection}{Abschnitt}{Abschnitte}% + \Crefname{appendix}{Anhang}{Anh\"ange}% + \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{lemma}{Lemma}{Lemmata}% + \Crefname{corollary}{Korollar}{Korollaren}% + \Crefname{proposition}{Satz}{S\"atze}% + \Crefname{definition}{Definition}{Definitionen}% + \Crefname{result}{Ergebnis}{Ergebnisse}% + \Crefname{example}{Beispiel}{Beispiele}% + \Crefname{remark}{Bemerkung}{Bemerkungen}% + \Crefname{note}{Anmerkung}{Anmerkungen}% + \if@cref@capitalise% + \crefname{equation}{Gleichung}{Gleichungen}% + \crefname{chapter}{Kapitel}{Kapitel}% + \crefname{section}{Abschnitt}{Abschnitte}% + \crefname{subsection}{Abschnitt}{Abschnitte}% + \crefname{subsubsection}{Abschnitt}{Abschnitte}% + \crefname{appendix}{Anhang}{Anh\"ange}% + \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{lemma}{Lemma}{Lemmata}% + \crefname{corollary}{Korollar}{Korollaren}% + \crefname{proposition}{Satz}{S\"atze}% + \crefname{definition}{Definition}{Definitionen}% + \crefname{result}{Ergebnis}{Ergebnisse}% + \crefname{example}{Beispiel}{Beispiele}% + \crefname{remark}{Bemerkung}{Bemerkungen}% + \crefname{note}{Anmerkung}{Anmerkungen}% + \else% + \crefname{equation}{Gleichung}{Gleichungen}% + \crefname{chapter}{Kapitel}{Kapitel}% + \crefname{section}{Abschnitt}{Abschnitte}% + \crefname{subsection}{Abschnitt}{Abschnitte}% + \crefname{subsubsection}{Abschnitt}{Abschnitte}% + \crefname{appendix}{Anhang}{Anh\"ange}% + \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{lemma}{Lemma}{Lemmata}% + \crefname{corollary}{Korollar}{Korollaren}% + \crefname{proposition}{Satz}{S\"atze}% + \crefname{definition}{Definition}{Definitionen}% + \crefname{result}{Ergebnis}{Ergebnisse}% + \crefname{example}{Beispiel}{Beispiele}% + \crefname{remark}{Bemerkung}{Bemerkungen}% + \crefname{note}{Anmerkung}{Anmerkungen}% + \fi% + }}} +\DeclareOption{ngerman}{% + \PackageInfo{cleveref}{loaded `ngerman' language definitions} + \ExecuteOptions{german} + \def\cref@language{ngerman} + \AtBeginDocument{% + \cref@addto\extrasngerman{% + \renewcommand{\crefrangeconjunction}{ bis~}% + \renewcommand\crefrangepreconjunction{}% + \renewcommand\crefrangepostconjunction{}% + \renewcommand{\crefpairconjunction}{ und~}% + \renewcommand{\crefmiddleconjunction}{, }% + \renewcommand{\creflastconjunction}{ und~}% + \renewcommand{\crefpairgroupconjunction}{ und~}% + \renewcommand{\crefmiddlegroupconjunction}{, }% + \renewcommand{\creflastgroupconjunction}{ und~}% + \Crefname{equation}{Gleichung}{Gleichungen}% + \Crefname{chapter}{Kapitel}{Kapitel}% + \Crefname{section}{Abschnitt}{Abschnitte}% + \Crefname{subsection}{Abschnitt}{Abschnitte}% + \Crefname{subsubsection}{Abschnitt}{Abschnitte}% + \Crefname{appendix}{Anhang}{Anh\"ange}% + \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{lemma}{Lemma}{Lemmata}% + \Crefname{corollary}{Korollar}{Korollaren}% + \Crefname{proposition}{Satz}{S\"atze}% + \Crefname{definition}{Definition}{Definitionen}% + \Crefname{result}{Ergebnis}{Ergebnisse}% + \Crefname{example}{Beispiel}{Beispiele}% + \Crefname{remark}{Bemerkung}{Bemerkungen}% + \Crefname{note}{Anmerkung}{Anmerkungen}% + \if@cref@capitalise% + \crefname{equation}{Gleichung}{Gleichungen}% + \crefname{chapter}{Kapitel}{Kapitel}% + \crefname{section}{Abschnitt}{Abschnitte}% + \crefname{subsection}{Abschnitt}{Abschnitte}% + \crefname{subsubsection}{Abschnitt}{Abschnitte}% + \crefname{appendix}{Anhang}{Anh\"ange}% + \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{lemma}{Lemma}{Lemmata}% + \crefname{corollary}{Korollar}{Korollaren}% + \crefname{proposition}{Satz}{S\"atze}% + \crefname{definition}{Definition}{Definitionen}% + \crefname{result}{Ergebnis}{Ergebnisse}% + \crefname{example}{Beispiel}{Beispiele}% + \crefname{remark}{Bemerkung}{Bemerkungen}% + \crefname{note}{Anmerkung}{Anmerkungen}% + \else% + \crefname{equation}{Gleichung}{Gleichungen}% + \crefname{chapter}{Kapitel}{Kapitel}% + \crefname{section}{Abschnitt}{Abschnitte}% + \crefname{subsection}{Abschnitt}{Abschnitte}% + \crefname{subsubsection}{Abschnitt}{Abschnitte}% + \crefname{appendix}{Anhang}{Anh\"ange}% + \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{lemma}{Lemma}{Lemmata}% + \crefname{corollary}{Korollar}{Korollaren}% + \crefname{proposition}{Satz}{S\"atze}% + \crefname{definition}{Definition}{Definitionen}% + \crefname{result}{Ergebnis}{Ergebnisse}% + \crefname{example}{Beispiel}{Beispiele}% + \crefname{remark}{Bemerkung}{Bemerkungen}% + \crefname{note}{Anmerkung}{Anmerkungen}% + \fi% + }}} +\DeclareOption{french}{% + \PackageInfo{cleveref}{loaded `french' language definitions} + \AtBeginDocument{% + \def\crefrangeconjunction@preamble{ \`a~}% + \def\crefrangepreconjunction@preamble{}% + \def\crefrangepostconjunction@preamble{}% + \def\crefpairconjunction@preamble{ et~}% + \def\crefmiddleconjunction@preamble{, }% + \def\creflastconjunction@preamble{ et~}% + \def\crefpairgroupconjunction@preamble{ et~}% + \def\crefmiddlegroupconjunction@preamble{, }% + \def\creflastgroupconjunction@preamble{, et~}% + \Crefname@preamble{equation}{{\'E}quation}{{\'E}quations}% + \Crefname@preamble{chapter}{Chapitre}{Chapitres}% + \Crefname@preamble{section}{Section}{Sections}% + \Crefname@preamble{appendix}{Appendice}{Appendices}% + \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}% + \Crefname@preamble{definition}{D\'efinition}{D\'efinitions}% + \Crefname@preamble{result}{R\'esultat}{R\'esultats}% + \Crefname@preamble{example}{Exemple}{Exemples}% + \Crefname@preamble{remark}{Remarque}{Remarques}% + \if@cref@capitalise% + \crefname@preamble{equation}{{\'E}quation}{{\'E}quations}% + \crefname@preamble{chapter}{Chapitre}{Chapitres}% + \crefname@preamble{section}{Section}{Sections}% + \crefname@preamble{appendix}{Appendice}{Appendices}% + \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}% + \crefname@preamble{definition}{D\'efinition}{D\'efinitions}% + \crefname@preamble{result}{R\'esultat}{R\'esultats}% + \crefname@preamble{example}{Exemple}{Exemples}% + \crefname@preamble{remark}{Remarque}{Remarques}% + \crefname@preamble{note}{Commentaire}{Commentaires}% + \else% + \crefname@preamble{equation}{{\'e}quation}{{\'e}quations}% + \crefname@preamble{chapter}{chapitre}{chapitres}% + \crefname@preamble{section}{section}{sections}% + \crefname@preamble{appendix}{appendice}{appendices}% + \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}% + \crefname@preamble{definition}{d\'efinition}{d\'efinitions}% + \crefname@preamble{result}{r\'esultat}{r\'esultats}% + \crefname@preamble{example}{exemple}{exemples}% + \crefname@preamble{remark}{remarque}{remarques}% + \crefname@preamble{note}{commentaire}{commentaires}% + \fi% + \def\cref@language{french}% + \cref@addto\extrasfrench{% + \renewcommand{\crefrangeconjunction}{ \`a~}% + \renewcommand\crefrangepreconjunction{}% + \renewcommand\crefrangepostconjunction{}% + \renewcommand{\crefpairconjunction}{ et~}% + \renewcommand{\crefmiddleconjunction}{, }% + \renewcommand{\creflastconjunction}{ et~}% + \renewcommand{\crefpairgroupconjunction}{ et~}% + \renewcommand{\crefmiddlegroupconjunction}{, }% + \renewcommand{\creflastgroupconjunction}{ et~}% + \Crefname{equation}{{\'E}quation}{{\'E}quations}% + \Crefname{chapter}{Chapitre}{Chapitres}% + \Crefname{section}{Section}{Sections}% + \Crefname{subsection}{Section}{Sections}% + \Crefname{subsubsection}{Section}{Sections}% + \Crefname{appendix}{Appendice}{Appendices}% + \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{lemma}{Lemme}{Lemmes}% + \Crefname{corollary}{Corollaire}{Corollaires}% + \Crefname{proposition}{Proposition}{Propositions}% + \Crefname{definition}{D\'efinition}{D\'efinitions}% + \Crefname{result}{R\'esultat}{R\'esultats}% + \Crefname{example}{Exemple}{Exemples}% + \Crefname{remark}{Remarque}{Remarques}% + \Crefname{note}{Commentaire}{Commentaires}% + \if@cref@capitalise% + \crefname{equation}{{\'E}quation}{{\'E}quations}% + \crefname{chapter}{Chapitre}{Chapitres}% + \crefname{section}{Section}{Sections}% + \crefname{subsection}{Section}{Sections}% + \crefname{subsubsection}{Section}{Sections}% + \crefname{appendix}{Appendice}{Appendices}% + \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{lemma}{Lemme}{Lemmes}% + \crefname{corollary}{Corollaire}{Corollaires}% + \crefname{proposition}{Proposition}{Propositions}% + \crefname{definition}{D\'efinition}{D\'efinitions}% + \crefname{result}{R\'esultat}{R\'esultats}% + \crefname{example}{Exemple}{Exemples}% + \crefname{remark}{Remarque}{Remarques}% + \crefname{note}{Commentaire}{Commentaires}% + \else% + \crefname{equation}{{\'e}quation}{{\'e}quations}% + \crefname{chapter}{chapitre}{chapitres}% + \crefname{section}{section}{sections}% + \crefname{subsection}{section}{sections}% + \crefname{subsubsection}{section}{sections}% + \crefname{appendix}{appendice}{appendices}% + \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{lemma}{lemme}{lemmes}% + \crefname{corollary}{corollaire}{corollaires}% + \crefname{proposition}{proposition}{propositions}% + \crefname{definition}{d\'efinition}{d\'efinitions}% + \crefname{result}{r\'esultat}{r\'esultats}% + \crefname{example}{exemple}{exemples}% + \crefname{remark}{remarque}{remarques}% + \crefname{note}{commentaire}{commentaires}% + \fi% + }}} +\DeclareOption{spanish}{% + \PackageInfo{cleveref}{loaded `spanish' language definitions} + \AtBeginDocument{% + \def\crefrangeconjunction@preamble{ a~}% + \def\crefrangepreconjunction@preamble{}% + \def\crefrangepostconjunction@preamble{}% + \def\crefpairconjunction@preamble{ y~}% + \def\crefmiddleconjunction@preamble{, }% + \def\creflastconjunction@preamble{ y~}% + \def\crefpairgroupconjunction@preamble{ y~}% + \def\crefmiddlegroupconjunction@preamble{, }% + \def\creflastgroupconjunction@preamble{ y~}% + \Crefname@preamble{equation}{Ecuaci\'on}{Ecuaciones}% + \Crefname@preamble{chapter}{Cap\'itulo}{Cap\'itulos}% + \Crefname@preamble{section}{Secci\'on}{Secciones}% + \Crefname@preamble{appendix}{Ap\'endice}{Ap\'endices}% + \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}% + \Crefname@preamble{definition}{Definici\'on}{Definiciones}% + \Crefname@preamble{result}{Resultado}{Resultados}% + \Crefname@preamble{example}{Ejemplo}{Ejemplos}% + \Crefname@preamble{remark}{Observaci\'on}{Observaciones}% + \Crefname@preamble{note}{Nota}{Notas}% + \if@cref@capitalise% + \crefname@preamble{equation}{Ecuaci\'on}{ecuaciones}% + \crefname@preamble{chapter}{Cap\'itulo}{cap\'itulos}% + \crefname@preamble{section}{Secci\'on}{secciones}% + \crefname@preamble{appendix}{Ap\'endice}{ap\'endices}% + \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}% + \crefname@preamble{definition}{Definici\'on}{definiciones}% + \crefname@preamble{result}{Resultado}{resultados}% + \crefname@preamble{example}{Ejemplo}{ejemplos}% + \crefname@preamble{remark}{Observaci\'on}{observaciones}% + \crefname@preamble{note}{Nota}{notas}% + \else% + \crefname@preamble{equation}{ecuaci\'on}{ecuaciones}% + \crefname@preamble{chapter}{cap\'itulo}{cap\'itulos}% + \crefname@preamble{section}{secci\'on}{secciones}% + \crefname@preamble{appendix}{ap\'endice}{ap\'endices}% + \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}% + \crefname@preamble{definition}{definici\'on}{definiciones}% + \crefname@preamble{result}{resultado}{resultados}% + \crefname@preamble{example}{ejemplo}{ejemplos}% + \crefname@preamble{remark}{observaci\'on}{observaciones}% + \crefname@preamble{note}{nota}{notas}% + \fi% + \def\cref@language{spanish}% + \cref@addto\extrasspanish{% + \renewcommand{\crefrangeconjunction}{ a~}% + \renewcommand{\crefrangepreconjunction}{}% + \renewcommand{\crefrangepostconjunction}{}% + \renewcommand{\crefpairconjunction}{ y~}% + \renewcommand{\crefmiddleconjunction}{, }% + \renewcommand{\creflastconjunction}{ y~}% + \renewcommand{\crefpairgroupconjunction}{ y~}% + \renewcommand{\crefmiddlegroupconjunction}{, }% + \renewcommand{\creflastgroupconjunction}{ y~}% + \Crefname{equation}{Ecuaci\'on}{Ecuaciones}% + \Crefname{chapter}{Cap\'itulo}{Cap\'itulos}% + \Crefname{section}{Secci\'on}{Secciones}% + \Crefname{subsection}{Secci\'on}{Secciones}% + \Crefname{subsubsection}{Secci\'on}{Secciones}% + \Crefname{appendix}{Ap\'endice}{Ap\'endices}% + \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{lemma}{Lema}{Lemas}% + \Crefname{corollary}{Corolario}{Corolarios}% + \Crefname{proposition}{Proposici\'on}{Proposiciones}% + \Crefname{definition}{Definici\'on}{Definiciones}% + \Crefname{result}{Resultado}{Resultados}% + \Crefname{example}{Ejemplo}{Ejemplos}% + \Crefname{remark}{Observaci\'on}{Observaci\'on}% + \Crefname{note}{Nota}{Notas}% + \if@cref@capitalise% + \crefname{equation}{Ecuaci\'on}{Ecuaciones}% + \crefname{chapter}{Cap\'itulo}{Cap\'itulos}% + \crefname{section}{Secci\'on}{Secciones}% + \crefname{subsection}{Secci\'on}{Secciones}% + \crefname{subsubsection}{Secci\'on}{Secciones}% + \crefname{appendix}{Ap\'endice}{Ap\'endices}% + \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{lemma}{Lema}{Lemas}% + \crefname{corollary}{Corolario}{Corolarios}% + \crefname{proposition}{Proposici\'on}{Proposiciones}% + \crefname{definition}{Definici\'on}{Definiciones}% + \crefname{result}{Resultado}{Resultados}% + \crefname{example}{Ejemplo}{Ejemplos}% + \crefname{remark}{Observaci\'on}{Observaci\'ones}% + \crefname{note}{Nota}{Notas}% + \else% + \crefname{equation}{ecuaci\'on}{ecuaciones}% + \crefname{chapter}{cap\'itulo}{cap\'itulos}% + \crefname{section}{secci\'on}{secciones}% + \crefname{subsection}{secci\'on}{secciones}% + \crefname{subsubsection}{secci\'on}{secciones}% + \crefname{appendix}{ap\'endice}{ap\'endices}% + \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{lemma}{lema}{lemas}% + \crefname{corollary}{corolario}{corolarios}% + \crefname{proposition}{proposici\'on}{proposiciones}% + \crefname{definition}{definici\'on}{definiciones}% + \crefname{result}{resultado}{resultados}% + \crefname{example}{ejemplo}{ejemplos}% + \crefname{remark}{observaci\'on}{observaci\'ones}% + \crefname{note}{nota}{notas}% + \fi% + }}} +\DeclareOption{italian}{% + \PackageInfo{cleveref}{loaded `italian' language definitions} + \AtBeginDocument{% + \def\crefrangeconjunction@preamble{ a~}% + \def\crefrangepreconjunction@preamble{da~}% + \def\crefrangepostconjunction@preamble{}% + \def\crefpairconjunction@preamble{ e~}% + \def\crefmiddleconjunction@preamble{, }% + \def\creflastconjunction@preamble{ e~}% + \def\crefpairgroupconjunction@preamble{ e~}% + \def\crefmiddlegroupconjunction@preamble{, }% + \def\creflastgroupconjunction@preamble{ e~}% + \Crefname@preamble{equation}{Equazione}{Equazioni}% + \Crefname@preamble{chapter}{Capitolo}{Capitoli}% + \Crefname@preamble{section}{Sezione}{Sezioni}% + \Crefname@preamble{appendix}{Appendice}{Appendici}% + \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}% + \Crefname@preamble{definition}{Definizioni}{Definizioni}% + \Crefname@preamble{result}{Risultato}{Risultati}% + \Crefname@preamble{example}{esempio}{esempi}% + \Crefname@preamble{remark}{Osservazione}{Osservazioni}% + \Crefname@preamble{note}{Nota}{Note}% + \if@cref@capitalise% + \crefname@preamble{equation}{Eq.}{Eq.}% + \crefname@preamble{chapter}{Capitolo}{Capitoli}% + \crefname@preamble{section}{Sezione}{Sezioni}% + \crefname@preamble{appendix}{Appendice}{Appendici}% + \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}% + \crefname@preamble{definition}{Definizione}{Definizioni}% + \crefname@preamble{result}{Risultato}{Risultati}% + \crefname@preamble{example}{Esempio}{Esempi}% + \crefname@preamble{remark}{Osservazione}{Osservazioni}% + \crefname@preamble{note}{Nota}{Note}% + \else% + \crefname@preamble{equation}{eq.}{eq.}% + \crefname@preamble{chapter}{capitolo}{capitoli}% + \crefname@preamble{section}{sezione}{sezioni}% + \crefname@preamble{appendix}{appendice}{appendici}% + \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}% + \crefname@preamble{definition}{definizione}{definizioni}% + \crefname@preamble{result}{risultato}{risultati}% + \crefname@preamble{example}{esempio}{esempi}% + \crefname@preamble{remark}{osservazione}{osservazioni}% + \crefname@preamble{note}{nota}{note}% + \fi% + \def\cref@language{italiano}% + \cref@addto\extrasenglish{% + \renewcommand{\crefrangeconjunction}{ a~}% + \renewcommand\crefrangepreconjunction{da~}% + \renewcommand\crefrangepostconjunction{}% + \renewcommand{\crefpairconjunction}{ e~}% + \renewcommand{\crefmiddleconjunction}{, }% + \renewcommand{\creflastconjunction}{ e~}% + \renewcommand{\crefpairgroupconjunction}{ e~}% + \renewcommand{\crefmiddlegroupconjunction}{, }% + \renewcommand{\creflastgroupconjunction}{ e~}% + \Crefname{equation}{Equazione}{Equazioni}% + \Crefname{chapter}{Capitolo}{Capitoli}% + \Crefname{section}{Sezione}{Sezioni}% + \Crefname{subsection}{Sezione}{Sezioni}% + \Crefname{subsubsection}{Sezione}{Sezioni}% + \Crefname{appendix}{Appendice}{Appendici}% + \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{lemma}{Lemma}{Lemmi}% + \Crefname{corollary}{Corollario}{Corollari}% + \Crefname{proposition}{Proposizione}{Proposizioni}% + \Crefname{definition}{Definizione}{Definizione}% + \Crefname{result}{Risultato}{Risultati}% + \Crefname{example}{esempio}{esempi}% + \Crefname{remark}{Osservazione}{Osservazioni}% + \Crefname{note}{Nota}{Note}% + \if@cref@capitalise% + \crefname{equation}{Eq.}{Eq.}% + \crefname{chapter}{Capitolo}{Capitoli}% + \crefname{section}{Sezione}{Sezioni}% + \crefname{subsection}{Sezione}{Sezioni}% + \crefname{subsubsection}{Sezione}{Sezioni}% + \crefname{appendix}{Appendice}{Appendici}% + \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{lemma}{Lemma}{Lemmi}% + \crefname{corollary}{Corollario}{Corollari}% + \crefname{proposition}{Proposizione}{Proposizioni}% + \crefname{definition}{Definizione}{Definizione}% + \crefname{result}{Risultato}{Risultati}% + \crefname{example}{Esempio}{Esempi}% + \crefname{remark}{Osservazione}{Osservazioni}% + \crefname{note}{Nota}{Note}% + \else% + \crefname{equation}{eq.}{eq.}% + \crefname{chapter}{capitolo}{capitoli}% + \crefname{section}{sezione}{sezioni}% + \crefname{subsection}{sezione}{sezioni}% + \crefname{subsubsection}{sezione}{sezioni}% + \crefname{appendix}{appendice}{appendici}% + \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{lemma}{lemma}{lemmi}% + \crefname{corollary}{corollario}{corollari}% + \crefname{proposition}{proposizione}{proposizioni}% + \crefname{definition}{definizione}{definizione}% + \crefname{result}{risultato}{risultati}% + \crefname{example}{esempio}{esempi}% + \crefname{remark}{osservazione}{osservazioni}% + \crefname{note}{nota}{note}% + \fi% + }}} +\edef\@curroptions{\@ptionlist{\@currname.\@currext}}% +\@expandtwoargs\in@{,capitalise,}{% + ,\@classoptionslist,\@curroptions,}% +\ifin@% + \ExecuteOptions{capitalise}% +\else% + \@expandtwoargs\in@{,capitalize,}{% + ,\@classoptionslist,\@curroptions,}% + \ifin@% + \ExecuteOptions{capitalise}% + \fi% +\fi% +\ExecuteOptions{english} +\ProcessOptions*\relax +\AtBeginDocument{% + \edef\@tmpa{% + \expandafter\noexpand\csname extras\cref@language\endcsname}% + \@ifundefined{crefrangeconjunction}{% + \let\crefrangeconjunction\crefrangeconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefrangeconjunction\expandafter}% + \expandafter{\crefrangeconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefrangepreconjunction}{% + \let\crefrangepreconjunction\crefrangepreconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefrangepreconjunction\expandafter}% + \expandafter{\crefrangepreconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefrangepostconjunction}{% + \let\crefrangepostconjunction\crefrangepostconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefrangepostconjunction\expandafter}% + \expandafter{\crefrangepostconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefpairconjunction}{% + \let\crefpairconjunction\crefpairconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefpairconjunction\expandafter}% + \expandafter{\crefpairconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefmiddleconjunction}{% + \let\crefmiddleconjunction\crefmiddleconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefmiddleconjunction\expandafter}% + \expandafter{\crefmiddleconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{creflastconjunction}{% + \let\creflastconjunction\creflastconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\creflastconjunction\expandafter}% + \expandafter{\creflastconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefpairgroupconjunction}{% + \let\crefpairgroupconjunction% + \crefpairgroupconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefpairgroupconjunction\expandafter}% + \expandafter{\crefpairgroupconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefmiddlegroupconjunction}{% + \let\crefmiddlegroupconjunction% + \crefmiddlegroupconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefpairmiddleconjunction\expandafter}% + \expandafter{\crefpairmiddleconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{creflastgroupconjunction}{% + \let\creflastgroupconjunction% + \creflastgroupconjunction@preamble% + }{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \expandafter\renewcommand\expandafter% + {\expandafter\crefpairlastconjunction\expandafter}% + \expandafter{\crefpairlastconjunction}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpa\expandafter{\@tmpb}% + }% + \@ifundefined{crefpairgroupconjunction}{% + \let\crefpairgroupconjunction\crefpairconjunction}{}% + \@ifundefined{crefmiddlegroupconjunction}{% + \let\crefmiddlegroupconjunction\crefmiddleconjunction}{}% + \@ifundefined{creflastgroupconjunction}{% + \edef\creflastgroupconjunction{, \creflastconjunction}}{}% + \let\@tmpstack\cref@label@types% + \cref@isstackfull{\@tmpstack}% + \@whilesw\if@cref@stackfull\fi{% + \edef\@tmpa{\cref@stack@top{\@tmpstack}}% + \@ifundefined{cref@\@tmpa @name}{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \csname cref@\@tmpa @name\endcsname}% + \expandafter\def\expandafter\@tmpc\expandafter{% + \csname cref@\@tmpa @name@preamble\endcsname}% + \expandafter\expandafter\expandafter\let\expandafter\@tmpb\@tmpc% + \expandafter\def\expandafter\@tmpb\expandafter{% + \csname cref@\@tmpa @name@plural\endcsname}% + \expandafter\def\expandafter\@tmpc\expandafter{% + \csname cref@\@tmpa @name@plural@preamble\endcsname}% + \expandafter\expandafter\expandafter\let\expandafter\@tmpb\@tmpc + }{% + \edef\@tmpb{% + \expandafter\noexpand\csname extras\cref@language\endcsname}% + \expandafter\def\expandafter\@tmpc\expandafter{% + \expandafter\crefname\expandafter{\@tmpa}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\expandafter\expandafter\@tmpc% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \csname cref@\@tmpa @name\endcsname}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\expandafter\expandafter\@tmpc% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \csname cref@\@tmpa @name@plural\endcsname}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpb\expandafter{\@tmpc}% + }% + \@ifundefined{Cref@\@tmpa @name}{% + \expandafter\def\expandafter\@tmpb\expandafter{% + \csname Cref@\@tmpa @name\endcsname}% + \expandafter\def\expandafter\@tmpc\expandafter{% + \csname Cref@\@tmpa @name@preamble\endcsname}% + \expandafter\expandafter\expandafter\let\expandafter\@tmpb\@tmpc% + \expandafter\def\expandafter\@tmpb\expandafter{% + \csname Cref@\@tmpa @name@plural\endcsname}% + \expandafter\def\expandafter\@tmpc\expandafter{% + \csname Cref@\@tmpa @name@plural@preamble\endcsname}% + \expandafter\expandafter\expandafter\let\expandafter\@tmpb\@tmpc + }{% + \edef\@tmpb{% + \expandafter\noexpand\csname extras\cref@language\endcsname}% + \expandafter\def\expandafter\@tmpc\expandafter{% + \expandafter\Crefname\expandafter{\@tmpa}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\expandafter\expandafter\@tmpc% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \csname Cref@\@tmpa @name\endcsname}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\expandafter\expandafter\@tmpc% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter{% + \csname Cref@\@tmpa @name@plural\endcsname}}% + \expandafter\expandafter\expandafter\cref@addto% + \expandafter\@tmpb\expandafter{\@tmpc}% + }% + \@ifundefined{cref@\@tmpa @format}{% + \expandafter\@crefdefineformat\expandafter{\@tmpa}}{}% + \@ifundefined{crefrange@\@tmpa @format}{% + \expandafter\@crefrangedefineformat\expandafter{\@tmpa}}{}% + \@ifundefined{cref@\@tmpa @format@first}{% + \expandafter\@crefdefinemultiformat\expandafter{\@tmpa}}{}% + \@ifundefined{crefrange@\@tmpa @format@first}{% + \expandafter\@crefrangedefinemultiformat\expandafter{\@tmpa}}{}% + \cref@stack@pop{\@tmpstack}% + \cref@isstackfull{\@tmpstack}}% + \@ifundefined{cref@subsection@format}{% + \let\cref@subsection@format% + \cref@section@format}{}% + \@ifundefined{Cref@subsection@format}{% + \let\Cref@subsection@format% + \Cref@section@format}{}% + \@ifundefined{crefrange@subsection@format}{% + \let\crefrange@subsection@format% + \crefrange@section@format}{}% + \@ifundefined{Crefrange@subsection@format}{% + \let\Crefrange@subsection@format% + \Crefrange@section@format}{}% + \@ifundefined{cref@subsection@format@first}{% + \let\cref@subsection@format@first% + \cref@section@format@first}{}% + \@ifundefined{Cref@subsection@format@first}{% + \let\Cref@subsection@format@first% + \Cref@section@format@first}{}% + \@ifundefined{cref@subsection@format@second}{% + \let\cref@subsection@format@second% + \cref@section@format@second}{}% + \@ifundefined{Cref@subsection@format@second}{% + \let\Cref@subsection@format@second% + \Cref@section@format@second}{}% + \@ifundefined{cref@subsection@format@middle}{% + \let\cref@subsection@format@middle% + \cref@section@format@middle}{}% + \@ifundefined{Cref@subsection@format@middle}{% + \let\Cref@subsection@format@middle% + \Cref@section@format@middle}{}% + \@ifundefined{cref@subsection@format@last}{% + \let\cref@subsection@format@last% + \cref@section@format@last}{}% + \@ifundefined{Cref@subsection@format@last}{% + \let\Cref@subsection@format@last% + \Cref@section@format@last}{}% + \@ifundefined{crefrange@subsection@format@first}{% + \let\crefrange@subsection@format@first% + \crefrange@section@format@first}{}% + \@ifundefined{Crefrange@subsection@format@first}{% + \let\Crefrange@subsection@format@first% + \Crefrange@section@format@first}{}% + \@ifundefined{crefrange@subsection@format@second}{% + \let\crefrange@subsection@format@second% + \crefrange@section@format@second}{}% + \@ifundefined{Crefrange@subsection@format@second}{% + \let\Crefrange@subsection@format@second% + \Crefrange@section@format@second}{}% + \@ifundefined{crefrange@subsection@format@middle}{% + \let\crefrange@subsection@format@middle% + \crefrange@section@format@middle}{}% + \@ifundefined{Crefrange@subsection@format@middle}{% + \let\Crefrange@subsection@format@middle% + \Crefrange@section@format@middle}{}% + \@ifundefined{crefrange@subsection@format@last}{% + \let\crefrange@subsection@format@last% + \crefrange@section@format@last}{}% + \@ifundefined{Crefrange@subsection@format@last}{% + \let\Crefrange@subsection@format@last% + \Crefrange@section@format@last}{}% + \@ifundefined{cref@subsubsection@format}{% + \let\cref@subsubsection@format% + \cref@subsection@format}{}% + \@ifundefined{Cref@subsubsection@format}{% + \let\Cref@subsubsection@format% + \Cref@subsection@format}{}% + \@ifundefined{crefrange@subsubsection@format}{% + \let\crefrange@subsubsection@format% + \crefrange@subsection@format}{}% + \@ifundefined{Crefrange@subsubsection@format}{% + \let\Crefrange@subsubsection@format% + \Crefrange@subsection@format}{}% + \@ifundefined{cref@subsubsection@format@first}{% + \let\cref@subsubsection@format@first% + \cref@subsection@format@first}{}% + \@ifundefined{Cref@subsubsection@format@first}{% + \let\Cref@subsubsection@format@first% + \Cref@subsection@format@first}{}% + \@ifundefined{cref@subsubsection@format@second}{% + \let\cref@subsubsection@format@second% + \cref@subsection@format@second}{}% + \@ifundefined{Cref@subsubsection@format@second}{% + \let\Cref@subsubsection@format@second% + \Cref@subsection@format@second}{}% + \@ifundefined{cref@subsubsection@format@middle}{% + \let\cref@subsubsection@format@middle% + \cref@subsection@format@middle}{}% + \@ifundefined{Cref@subsubsection@format@middle}{% + \let\Cref@subsubsection@format@middle% + \Cref@subsection@format@middle}{}% + \@ifundefined{cref@subsubsection@format@last}{% + \let\cref@subsubsection@format@last% + \cref@subsection@format@last}{}% + \@ifundefined{Cref@subsubsection@format@last}{% + \let\Cref@subsubsection@format@last% + \Cref@subsection@format@last}{}% + \@ifundefined{crefrange@subsubsection@format@first}{% + \let\crefrange@subsubsection@format@first% + \crefrange@subsection@format@first}{}% + \@ifundefined{Crefrange@subsubsection@format@first}{% + \let\Crefrange@subsubsection@format@first% + \Crefrange@subsection@format@first}{}% + \@ifundefined{crefrange@subsubsection@format@second}{% + \let\crefrange@subsubsection@format@second% + \crefrange@subsection@format@second}{}% + \@ifundefined{Crefrange@subsubsection@format@second}{% + \let\Crefrange@subsubsection@format@second% + \Crefrange@subsection@format@second}{}% + \@ifundefined{crefrange@subsubsection@format@middle}{% + \let\crefrange@subsubsection@format@middle% + \crefrange@subsection@format@middle}{}% + \@ifundefined{Crefrange@subsubsection@format@middle}{% + \let\Crefrange@subsubsection@format@middle% + \Crefrange@subsection@format@middle}{}% + \@ifundefined{crefrange@subsubsection@format@last}{% + \let\crefrange@subsubsection@format@last% + \crefrange@subsection@format@last}{}% + \@ifundefined{Crefrange@subsubsection@format@last}{% + \let\Crefrange@subsubsection@format@last% + \Crefrange@subsection@format@last}{}% + \@ifundefined{cref@subappendix@format}{% + \let\cref@subappendix@format% + \cref@appendix@format}{}% + \@ifundefined{Cref@subappendix@format}{% + \let\Cref@subappendix@format% + \Cref@appendix@format}{}% + \@ifundefined{crefrange@subappendix@format}{% + \let\crefrange@subappendix@format% + \crefrange@appendix@format}{}% + \@ifundefined{Crefrange@subappendix@format}{% + \let\Crefrange@subappendix@format% + \Crefrange@appendix@format}{}% + \@ifundefined{cref@subappendix@format@first}{% + \let\cref@subappendix@format@first% + \cref@appendix@format@first}{}% + \@ifundefined{Cref@subappendix@format@first}{% + \let\Cref@subappendix@format@first% + \Cref@appendix@format@first}{}% + \@ifundefined{cref@subappendix@format@second}{% + \let\cref@subappendix@format@second% + \cref@appendix@format@second}{}% + \@ifundefined{Cref@subappendix@format@second}{% + \let\Cref@subappendix@format@second% + \Cref@appendix@format@second}{}% + \@ifundefined{cref@subappendix@format@middle}{% + \let\cref@subappendix@format@middle% + \cref@appendix@format@middle}{}% + \@ifundefined{Cref@subappendix@format@middle}{% + \let\Cref@subappendix@format@middle% + \Cref@appendix@format@middle}{}% + \@ifundefined{cref@subappendix@format@last}{% + \let\cref@subappendix@format@last% + \cref@appendix@format@last}{}% + \@ifundefined{Cref@subappendix@format@last}{% + \let\Cref@subappendix@format@last% + \Cref@appendix@format@last}{}% + \@ifundefined{crefrange@subappendix@format@first}{% + \let\crefrange@subappendix@format@first% + \crefrange@appendix@format@first}{}% + \@ifundefined{Crefrange@subappendix@format@first}{% + \let\Crefrange@subappendix@format@first% + \Crefrange@appendix@format@first}{}% + \@ifundefined{crefrange@subappendix@format@second}{% + \let\crefrange@subappendix@format@second% + \crefrange@appendix@format@second}{}% + \@ifundefined{Crefrange@subappendix@format@second}{% + \let\Crefrange@subappendix@format@second% + \Crefrange@appendix@format@second}{}% + \@ifundefined{crefrange@subappendix@format@middle}{% + \let\crefrange@subappendix@format@middle% + \crefrange@appendix@format@middle}{}% + \@ifundefined{Crefrange@subappendix@format@middle}{% + \let\Crefrange@subappendix@format@middle% + \Crefrange@appendix@format@middle}{}% + \@ifundefined{crefrange@subappendix@format@last}{% + \let\crefrange@subappendix@format@last% + \crefrange@appendix@format@last}{}% + \@ifundefined{Crefrange@subappendix@format@last}{% + \let\Crefrange@subappendix@format@last% + \Crefrange@appendix@format@last}{}% + \@ifundefined{cref@subsubappendix@format}{% + \let\cref@subsubappendix@format% + \cref@subappendix@format}{}% + \@ifundefined{Cref@subsubappendix@format}{% + \let\Cref@subsubappendix@format% + \Cref@subappendix@format}{}% + \@ifundefined{crefrange@subsubappendix@format}{% + \let\crefrange@subsubappendix@format% + \crefrange@subappendix@format}{}% + \@ifundefined{Crefrange@subsubappendix@format}{% + \let\Crefrange@subsubappendix@format% + \Crefrange@subappendix@format}{}% + \@ifundefined{cref@subsubappendix@format@first}{% + \let\cref@subsubappendix@format@first% + \cref@subappendix@format@first}{}% + \@ifundefined{Cref@subsubappendix@format@first}{% + \let\Cref@subsubappendix@format@first% + \Cref@subappendix@format@first}{}% + \@ifundefined{cref@subsubappendix@format@second}{% + \let\cref@subsubappendix@format@second% + \cref@subappendix@format@second}{}% + \@ifundefined{Cref@subsubappendix@format@second}{% + \let\Cref@subsubappendix@format@second% + \Cref@subappendix@format@second}{}% + \@ifundefined{cref@subsubappendix@format@middle}{% + \let\cref@subsubappendix@format@middle% + \cref@subappendix@format@middle}{}% + \@ifundefined{Cref@subsubappendix@format@middle}{% + \let\Cref@subsubappendix@format@middle% + \Cref@subappendix@format@middle}{}% + \@ifundefined{cref@subsubappendix@format@last}{% + \let\cref@subsubappendix@format@last% + \cref@subappendix@format@last}{}% + \@ifundefined{Cref@subsubappendix@format@last}{% + \let\Cref@subsubappendix@format@last% + \Cref@subappendix@format@last}{}% + \@ifundefined{crefrange@subsubappendix@format@first}{% + \let\crefrange@subsubappendix@format@first% + \crefrange@subappendix@format@first}{}% + \@ifundefined{Crefrange@subsubappendix@format@first}{% + \let\Crefrange@subsubappendix@format@first% + \Crefrange@subappendix@format@first}{}% + \@ifundefined{crefrange@subsubappendix@format@second}{% + \let\crefrange@subsubappendix@format@second% + \crefrange@subappendix@format@second}{}% + \@ifundefined{Crefrange@subsubappendix@format@second}{% + \let\Crefrange@subsubappendix@format@second% + \Crefrange@subappendix@format@second}{}% + \@ifundefined{crefrange@subsubappendix@format@middle}{% + \let\crefrange@subsubappendix@format@middle% + \crefrange@subappendix@format@middle}{}% + \@ifundefined{Crefrange@subsubappendix@format@middle}{% + \let\Crefrange@subsubappendix@format@middle% + \Crefrange@subappendix@format@middle}{}% + \@ifundefined{crefrange@subsubappendix@format@last}{% + \let\crefrange@subsubappendix@format@last% + \crefrange@subappendix@format@last}{}% + \@ifundefined{Crefrange@subsubappendix@format@last}{% + \let\Crefrange@subsubappendix@format@last% + \Crefrange@subappendix@format@last}{}% + \@ifundefined{cref@subsubsubappendix@format}{% + \let\cref@subsubsubappendix@format% + \cref@subsubappendix@format}{}% + \@ifundefined{Cref@subsubsubappendix@format}{% + \let\Cref@subsubsubappendix@format% + \Cref@subsubappendix@format}{}% + \@ifundefined{crefrange@subsubsubappendix@format}{% + \let\crefrange@subsubsubappendix@format% + \crefrange@subsubappendix@format}{}% + \@ifundefined{Crefrange@subsubsubappendix@format}{% + \let\Crefrange@subsubsubappendix@format% + \Crefrange@subsubappendix@format}{}% + \@ifundefined{cref@subsubsubappendix@format@first}{% + \let\cref@subsubsubappendix@format@first% + \cref@subsubappendix@format@first}{}% + \@ifundefined{Cref@subsubsubappendix@format@first}{% + \let\Cref@subsubsubappendix@format@first% + \Cref@subsubappendix@format@first}{}% + \@ifundefined{cref@subsubsubappendix@format@second}{% + \let\cref@subsubsubappendix@format@second% + \cref@subsubappendix@format@second}{}% + \@ifundefined{Cref@subsubsubappendix@format@second}{% + \let\Cref@subsubsubappendix@format@second% + \Cref@subsubappendix@format@second}{}% + \@ifundefined{cref@subsubsubappendix@format@middle}{% + \let\cref@subsubsubappendix@format@middle% + \cref@subsubappendix@format@middle}{}% + \@ifundefined{Cref@subsubsubappendix@format@middle}{% + \let\Cref@subsubsubappendix@format@middle% + \Cref@subsubappendix@format@middle}{}% + \@ifundefined{cref@subsubsubappendix@format@last}{% + \let\cref@subsubsubappendix@format@last% + \cref@subsubappendix@format@last}{}% + \@ifundefined{Cref@subsubsubappendix@format@last}{% + \let\Cref@subsubsubappendix@format@last% + \Cref@subsubappendix@format@last}{}% + \@ifundefined{crefrange@subsubsubappendix@format@first}{% + \let\crefrange@subsubsubappendix@format@first% + \crefrange@subsubappendix@format@first}{}% + \@ifundefined{Crefrange@subsubsubappendix@format@first}{% + \let\Crefrange@subsubsubappendix@format@first% + \Crefrange@subsubappendix@format@first}{}% + \@ifundefined{crefrange@subsubsubappendix@format@second}{% + \let\crefrange@subsubsubappendix@format@second% + \crefrange@subsubappendix@format@second}{}% + \@ifundefined{Crefrange@subsubsubappendix@format@second}{% + \let\Crefrange@subsubsubappendix@format@second% + \Crefrange@subsubappendix@format@second}{}% + \@ifundefined{crefrange@subsubsubappendix@format@middle}{% + \let\crefrange@subsubsubappendix@format@middle% + \crefrange@subsubappendix@format@middle}{}% + \@ifundefined{Crefrange@subsubsubappendix@format@middle}{% + \let\Crefrange@subsubsubappendix@format@middle% + \Crefrange@subsubappendix@format@middle}{}% + \@ifundefined{crefrange@subsubsubappendix@format@last}{% + \let\crefrange@subsubsubappendix@format@last% + \crefrange@subsubappendix@format@last}{}% + \@ifundefined{Crefrange@subsubsubappendix@format@last}{% + \let\Crefrange@subsubsubappendix@format@last% + \Crefrange@subsubappendix@format@last}{}% + \@ifundefined{cref@subfigure@format}{% + \let\cref@subfigure@format% + \cref@figure@format}{}% + \@ifundefined{Cref@subfigure@format}{% + \let\Cref@subfigure@format% + \Cref@figure@format}{}% + \@ifundefined{crefrange@subfigure@format}{% + \let\crefrange@subfigure@format% + \crefrange@figure@format}{}% + \@ifundefined{Crefrange@subfigure@format}{% + \let\Crefrange@subfigure@format% + \Crefrange@figure@format}{}% + \@ifundefined{cref@subfigure@format@first}{% + \let\cref@subfigure@format@first% + \cref@figure@format@first}{}% + \@ifundefined{Cref@subfigure@format@first}{% + \let\Cref@subfigure@format@first% + \Cref@figure@format@first}{}% + \@ifundefined{cref@subfigure@format@second}{% + \let\cref@subfigure@format@second% + \cref@figure@format@second}{}% + \@ifundefined{Cref@subfigure@format@second}{% + \let\Cref@subfigure@format@second% + \Cref@figure@format@second}{}% + \@ifundefined{cref@subfigure@format@middle}{% + \let\cref@subfigure@format@middle% + \cref@figure@format@middle}{}% + \@ifundefined{Cref@subfigure@format@middle}{% + \let\Cref@subfigure@format@middle% + \Cref@figure@format@middle}{}% + \@ifundefined{cref@subfigure@format@last}{% + \let\cref@subfigure@format@last% + \cref@figure@format@last}{}% + \@ifundefined{Cref@subfigure@format@last}{% + \let\Cref@subfigure@format@last% + \Cref@figure@format@last}{}% + \@ifundefined{crefrange@subfigure@format@first}{% + \let\crefrange@subfigure@format@first% + \crefrange@figure@format@first}{}% + \@ifundefined{Crefrange@subfigure@format@first}{% + \let\Crefrange@subfigure@format@first% + \Crefrange@figure@format@first}{}% + \@ifundefined{crefrange@subfigure@format@second}{% + \let\crefrange@subfigure@format@second% + \crefrange@figure@format@second}{}% + \@ifundefined{Crefrange@subfigure@format@second}{% + \let\Crefrange@subfigure@format@second% + \Crefrange@figure@format@second}{}% + \@ifundefined{crefrange@subfigure@format@middle}{% + \let\crefrange@subfigure@format@middle% + \crefrange@figure@format@middle}{}% + \@ifundefined{Crefrange@subfigure@format@middle}{% + \let\Crefrange@subfigure@format@middle% + \Crefrange@figure@format@middle}{}% + \@ifundefined{crefrange@subfigure@format@last}{% + \let\crefrange@subfigure@format@last% + \crefrange@figure@format@last}{}% + \@ifundefined{Crefrange@subfigure@format@last}{% + \let\Crefrange@subfigure@format@last% + \Crefrange@figure@format@last}{}% + \@ifundefined{cref@subtable@format}{% + \let\cref@subtable@format% + \cref@table@format}{}% + \@ifundefined{Cref@subtable@format}{% + \let\Cref@subtable@format% + \Cref@table@format}{}% + \@ifundefined{crefrange@subtable@format}{% + \let\crefrange@subtable@format% + \crefrange@table@format}{}% + \@ifundefined{Crefrange@subtable@format}{% + \let\Crefrange@subtable@format% + \Crefrange@table@format}{}% + \@ifundefined{cref@subtable@format@first}{% + \let\cref@subtable@format@first% + \cref@table@format@first}{}% + \@ifundefined{Cref@subtable@format@first}{% + \let\Cref@subtable@format@first% + \Cref@table@format@first}{}% + \@ifundefined{cref@subtable@format@second}{% + \let\cref@subtable@format@second% + \cref@table@format@second}{}% + \@ifundefined{Cref@subtable@format@second}{% + \let\Cref@subtable@format@second% + \Cref@table@format@second}{}% + \@ifundefined{cref@subtable@format@middle}{% + \let\cref@subtable@format@middle% + \cref@table@format@middle}{}% + \@ifundefined{Cref@subtable@format@middle}{% + \let\Cref@subtable@format@middle% + \Cref@table@format@middle}{}% + \@ifundefined{cref@subtable@format@last}{% + \let\cref@subtable@format@last% + \cref@table@format@last}{}% + \@ifundefined{Cref@subtable@format@last}{% + \let\Cref@subtable@format@last% + \Cref@table@format@last}{}% + \@ifundefined{crefrange@subtable@format@first}{% + \let\crefrange@subtable@format@first% + \crefrange@table@format@first}{}% + \@ifundefined{Crefrange@subtable@format@first}{% + \let\Crefrange@subtable@format@first% + \Crefrange@table@format@first}{}% + \@ifundefined{crefrange@subtable@format@second}{% + \let\crefrange@subtable@format@second% + \crefrange@table@format@second}{}% + \@ifundefined{Crefrange@subtable@format@second}{% + \let\Crefrange@subtable@format@second% + \Crefrange@table@format@second}{}% + \@ifundefined{crefrange@subtable@format@middle}{% + \let\crefrange@subtable@format@middle% + \crefrange@table@format@middle}{}% + \@ifundefined{Crefrange@subtable@format@middle}{% + \let\Crefrange@subtable@format@middle% + \Crefrange@table@format@middle}{}% + \@ifundefined{crefrange@subtable@format@last}{% + \let\crefrange@subtable@format@last% + \crefrange@table@format@last}{}% + \@ifundefined{Crefrange@subtable@format@last}{% + \let\Crefrange@subtable@format@last% + \Crefrange@table@format@last}{}% + \@ifundefined{cref@enumii@format}{% + \let\cref@enumii@format% + \cref@enumi@format}{}% + \@ifundefined{Cref@enumii@format}{% + \let\Cref@enumii@format% + \Cref@enumi@format}{}% + \@ifundefined{crefrange@enumii@format}{% + \let\crefrange@enumii@format% + \crefrange@enumi@format}{}% + \@ifundefined{Crefrange@enumii@format}{% + \let\Crefrange@enumii@format% + \Crefrange@enumi@format}{}% + \@ifundefined{cref@enumii@format@first}{% + \let\cref@enumii@format@first% + \cref@enumi@format@first}{}% + \@ifundefined{Cref@enumii@format@first}{% + \let\Cref@enumii@format@first% + \Cref@enumi@format@first}{}% + \@ifundefined{cref@enumii@format@second}{% + \let\cref@enumii@format@second% + \cref@enumi@format@second}{}% + \@ifundefined{Cref@enumii@format@second}{% + \let\Cref@enumii@format@second% + \Cref@enumi@format@second}{}% + \@ifundefined{cref@enumii@format@middle}{% + \let\cref@enumii@format@middle% + \cref@enumi@format@middle}{}% + \@ifundefined{Cref@enumii@format@middle}{% + \let\Cref@enumii@format@middle% + \Cref@enumi@format@middle}{}% + \@ifundefined{cref@enumii@format@last}{% + \let\cref@enumii@format@last% + \cref@enumi@format@last}{}% + \@ifundefined{Cref@enumii@format@last}{% + \let\Cref@enumii@format@last% + \Cref@enumi@format@last}{}% + \@ifundefined{crefrange@enumii@format@first}{% + \let\crefrange@enumii@format@first% + \crefrange@enumi@format@first}{}% + \@ifundefined{Crefrange@enumii@format@first}{% + \let\Crefrange@enumii@format@first% + \Crefrange@enumi@format@first}{}% + \@ifundefined{crefrange@enumii@format@second}{% + \let\crefrange@enumii@format@second% + \crefrange@enumi@format@second}{}% + \@ifundefined{Crefrange@enumii@format@second}{% + \let\Crefrange@enumii@format@second% + \Crefrange@enumi@format@second}{}% + \@ifundefined{crefrange@enumii@format@middle}{% + \let\crefrange@enumii@format@middle% + \crefrange@enumi@format@middle}{}% + \@ifundefined{Crefrange@enumii@format@middle}{% + \let\Crefrange@enumii@format@middle% + \Crefrange@enumi@format@middle}{}% + \@ifundefined{crefrange@enumii@format@last}{% + \let\crefrange@enumii@format@last% + \crefrange@enumi@format@last}{}% + \@ifundefined{Crefrange@enumii@format@last}{% + \let\Crefrange@enumii@format@last% + \Crefrange@enumi@format@last}{}% + \@ifundefined{cref@enumiii@format}{% + \let\cref@enumiii@format% + \cref@enumii@format}{}% + \@ifundefined{Cref@enumiii@format}{% + \let\Cref@enumiii@format% + \Cref@enumii@format}{}% + \@ifundefined{crefrange@enumiii@format}{% + \let\crefrange@enumiii@format% + \crefrange@enumii@format}{}% + \@ifundefined{Crefrange@enumiii@format}{% + \let\Crefrange@enumiii@format% + \Crefrange@enumii@format}{}% + \@ifundefined{cref@enumiii@format@first}{% + \let\cref@enumiii@format@first% + \cref@enumii@format@first}{}% + \@ifundefined{Cref@enumiii@format@first}{% + \let\Cref@enumiii@format@first% + \Cref@enumii@format@first}{}% + \@ifundefined{cref@enumiii@format@second}{% + \let\cref@enumiii@format@second% + \cref@enumii@format@second}{}% + \@ifundefined{Cref@enumiii@format@second}{% + \let\Cref@enumiii@format@second% + \Cref@enumii@format@second}{}% + \@ifundefined{cref@enumiii@format@middle}{% + \let\cref@enumiii@format@middle% + \cref@enumii@format@middle}{}% + \@ifundefined{Cref@enumiii@format@middle}{% + \let\Cref@enumiii@format@middle% + \Cref@enumii@format@middle}{}% + \@ifundefined{cref@enumiii@format@last}{% + \let\cref@enumiii@format@last% + \cref@enumii@format@last}{}% + \@ifundefined{Cref@enumiii@format@last}{% + \let\Cref@enumiii@format@last% + \Cref@enumii@format@last}{}% + \@ifundefined{crefrange@enumiii@format@first}{% + \let\crefrange@enumiii@format@first% + \crefrange@enumii@format@first}{}% + \@ifundefined{Crefrange@enumiii@format@first}{% + \let\Crefrange@enumiii@format@first% + \Crefrange@enumii@format@first}{}% + \@ifundefined{crefrange@enumiii@format@second}{% + \let\crefrange@enumiii@format@second% + \crefrange@enumii@format@second}{}% + \@ifundefined{Crefrange@enumiii@format@second}{% + \let\Crefrange@enumiii@format@second% + \Crefrange@enumii@format@second}{}% + \@ifundefined{crefrange@enumiii@format@middle}{% + \let\crefrange@enumiii@format@middle% + \crefrange@enumii@format@middle}{}% + \@ifundefined{Crefrange@enumiii@format@middle}{% + \let\Crefrange@enumiii@format@middle% + \Crefrange@enumii@format@middle}{}% + \@ifundefined{crefrange@enumiii@format@last}{% + \let\crefrange@enumiii@format@last% + \crefrange@enumii@format@last}{}% + \@ifundefined{Crefrange@enumiii@format@last}{% + \let\Crefrange@enumiii@format@last% + \Crefrange@enumii@format@last}{}% + \@ifundefined{cref@enumiv@format}{% + \let\cref@enumiv@format% + \cref@enumiii@format}{}% + \@ifundefined{Cref@enumiv@format}{% + \let\Cref@enumiv@format% + \Cref@enumiii@format}{}% + \@ifundefined{crefrange@enumiv@format}{% + \let\crefrange@enumiv@format% + \crefrange@enumiii@format}{}% + \@ifundefined{Crefrange@enumiv@format}{% + \let\Crefrange@enumiv@format% + \Crefrange@enumiii@format}{}% + \@ifundefined{cref@enumiv@format@first}{% + \let\cref@enumiv@format@first% + \cref@enumiii@format@first}{}% + \@ifundefined{Cref@enumiv@format@first}{% + \let\Cref@enumiv@format@first% + \Cref@enumiii@format@first}{}% + \@ifundefined{cref@enumiv@format@second}{% + \let\cref@enumiv@format@second% + \cref@enumiii@format@second}{}% + \@ifundefined{Cref@enumiv@format@second}{% + \let\Cref@enumiv@format@second% + \Cref@enumiii@format@second}{}% + \@ifundefined{cref@enumiv@format@middle}{% + \let\cref@enumiv@format@middle% + \cref@enumiii@format@middle}{}% + \@ifundefined{Cref@enumiv@format@middle}{% + \let\Cref@enumiv@format@middle% + \Cref@enumiii@format@middle}{}% + \@ifundefined{cref@enumiv@format@last}{% + \let\cref@enumiv@format@last% + \cref@enumiii@format@last}{}% + \@ifundefined{Cref@enumiv@format@last}{% + \let\Cref@enumiv@format@last% + \Cref@enumiii@format@last}{}% + \@ifundefined{crefrange@enumiv@format@first}{% + \let\crefrange@enumiv@format@first% + \crefrange@enumiii@format@first}{}% + \@ifundefined{Crefrange@enumiv@format@first}{% + \let\Crefrange@enumiv@format@first% + \Crefrange@enumiii@format@first}{}% + \@ifundefined{crefrange@enumiv@format@second}{% + \let\crefrange@enumiv@format@second% + \crefrange@enumiii@format@second}{}% + \@ifundefined{Crefrange@enumiv@format@second}{% + \let\Crefrange@enumiv@format@second% + \Crefrange@enumiii@format@second}{}% + \@ifundefined{crefrange@enumiv@format@middle}{% + \let\crefrange@enumiv@format@middle% + \crefrange@enumiii@format@middle}{}% + \@ifundefined{Crefrange@enumiv@format@middle}{% + \let\Crefrange@enumiv@format@middle% + \Crefrange@enumiii@format@middle}{}% + \@ifundefined{crefrange@enumiv@format@last}{% + \let\crefrange@enumiv@format@last% + \crefrange@enumiii@format@last}{}% + \@ifundefined{Crefrange@enumiv@format@last}{% + \let\Crefrange@enumiv@format@last% + \Crefrange@enumiii@format@last}{}% + \@ifundefined{cref@enumv@format}{% + \let\cref@enumv@format% + \cref@enumiv@format}{}% + \@ifundefined{Cref@enumv@format}{% + \let\Cref@enumv@format% + \Cref@enumiv@format}{}% + \@ifundefined{crefrange@enumv@format}{% + \let\crefrange@enumv@format% + \crefrange@enumiv@format}{}% + \@ifundefined{Crefrange@enumv@format}{% + \let\Crefrange@enumv@format% + \Crefrange@enumiv@format}{}% + \@ifundefined{cref@enumv@format@first}{% + \let\cref@enumv@format@first% + \cref@enumiv@format@first}{}% + \@ifundefined{Cref@enumv@format@first}{% + \let\Cref@enumv@format@first% + \Cref@enumiv@format@first}{}% + \@ifundefined{cref@enumv@format@second}{% + \let\cref@enumv@format@second% + \cref@enumiv@format@second}{}% + \@ifundefined{Cref@enumv@format@second}{% + \let\Cref@enumv@format@second% + \Cref@enumiv@format@second}{}% + \@ifundefined{cref@enumv@format@middle}{% + \let\cref@enumv@format@middle% + \cref@enumiv@format@middle}{}% + \@ifundefined{Cref@enumv@format@middle}{% + \let\Cref@enumv@format@middle% + \Cref@enumiv@format@middle}{}% + \@ifundefined{cref@enumv@format@last}{% + \let\cref@enumv@format@last% + \cref@enumiv@format@last}{}% + \@ifundefined{Cref@enumv@format@last}{% + \let\Cref@enumv@format@last% + \Cref@enumiv@format@last}{}% + \@ifundefined{crefrange@enumv@format@first}{% + \let\crefrange@enumv@format@first% + \crefrange@enumiv@format@first}{}% + \@ifundefined{Crefrange@enumv@format@first}{% + \let\Crefrange@enumv@format@first% + \Crefrange@enumiv@format@first}{}% + \@ifundefined{crefrange@enumv@format@second}{% + \let\crefrange@enumv@format@second% + \crefrange@enumiv@format@second}{}% + \@ifundefined{Crefrange@enumv@format@second}{% + \let\Crefrange@enumv@format@second% + \Crefrange@enumiv@format@second}{}% + \@ifundefined{crefrange@enumv@format@middle}{% + \let\crefrange@enumv@format@middle% + \crefrange@enumiv@format@middle}{}% + \@ifundefined{Crefrange@enumv@format@middle}{% + \let\Crefrange@enumv@format@middle% + \Crefrange@enumiv@format@middle}{}% + \@ifundefined{crefrange@enumv@format@last}{% + \let\crefrange@enumv@format@last% + \crefrange@enumiv@format@last}{}% + \@ifundefined{Crefrange@enumv@format@last}{% + \let\Crefrange@enumv@format@last% + \Crefrange@enumiv@format@last}{}% + \let\cref@language\relax% +} +\endinput +%% +%% End of file `cleveref.sty'. diff --git a/tex/src/packages/fr-subfig.sty b/tex/src/packages/fr-subfig.sty new file mode 100644 index 0000000..56452ba --- /dev/null +++ b/tex/src/packages/fr-subfig.sty @@ -0,0 +1,275 @@ +%% +%% This is file `fr-subfig.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% floatrow.dtx (with options: `frforsubfig') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from fr-subfig.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file floatrow.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +\NeedsTeXFormat{LaTeX2e}[1995/06/01] +\ProvidesPackage{fr-subfig} + [2007/12/24 v0.1g (beta) floatrow: additions for subfig] +%%^^A|\newcommand\CenterFloatBoxes{\CADJfalse\OADJfalse| +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +%%^^A +\def\@tempb{2005/06/28 ver: 1.3 subfig package} +\expandafter\let\csname @tempa\expandafter\endcsname + \csname ver@subfig.\@pkgextension\endcsname +\ifx\@tempa\@tempb\else + \PackageWarning{fr-subfig}{The additions cooperated with \MessageBreak + version `2005/06/28 ver: 1.3' of package subfig,\MessageBreak + but only version\MessageBreak + \csname ver@subfig.\@pkgextension\endcsname'\MessageBreak + is available}\relax + \fi +\newlength\FBsc@max +\newlength\FBso@max +\@ifdefinable\FBsubcheight{\let\FBsubcheight\relax} +\@ifdefinable\FBsuboheight{\let\FBsuboheight\relax} +\newcommand\adjustsubfloats{\@tempswafalse + \ifCADJ\@tempswatrue\fi\ifOADJ\@tempswatrue\fi + \if@tempswa\FB@writeaux{% + \string\global\string\c@FBcnt\thepage + \ifCADJ\string\edef\string\FBsubcheight{\the\FBsc@max}\fi + \ifOADJ\string\edef\string\FBsuboheight{\the\FBso@max}\fi + }\fi + \global\let\FBsubcheight\relax\global\let\FBsuboheight\relax + \global\FBso@max\z@\global\FBsc@max\z@} +\long\def\sf@@@subfloat#1[#2][#3]#4{% + \@ifundefined{FBsc@max}{}% + {\FB@readaux{\let\FBsuboheight\relax}}% + \@tempcnta=\@ne + \if@minipage + \@tempcnta=\z@ + \else\ifdim \lastskip=\z@ \else + \@tempcnta=\tw@ + \fi\fi + \ifmaincaptiontop + \sf@top=\sf@nearskip + \sf@bottom=\sf@farskip + \else + \sf@top=\sf@farskip + \sf@bottom=\sf@nearskip + \fi + \leavevmode + \setbox\@tempboxa \hbox{#4}% + \ifdim\wd\@tempboxa=\z@\ht\@tempboxa\z@\dp\@tempboxa\z@ + \setbox\z@\hbox{{\caption@@@make + {\caption@lfmt{\@nameuse{sub\@captype name}}% + {\@nameuse{thesub\@captype}}\relax}{}}}\@tempdima=\wd\z@ + \sf@top=\z@ + \sf@bottom=\z@ + \sf@capskip\z@ + \sf@captopadj\z@ + \let\sf@ifpositiontop\@firstoftwo + \else + \@tempdima=\wd\@tempboxa + \@ifundefined{FBsc@max}{}% + {\global\advance\Xhsize-\wd\@tempboxa + \dimen@=\ht\@tempboxa + \advance\dimen@\dp\@tempboxa + \ifdim\dimen@>\FBso@max + \global\FBso@max\dimen@ + \fi}% + \fi + \vtop\bgroup + \vbox\bgroup + \ifcase\@tempcnta + \@minipagefalse + \or + \vskip\sf@top + \or + \ifdim \lastskip=\z@ \else + \@tempskipb\sf@top\relax\@xaddvskip + \fi + \fi + \sf@ifpositiontop{% + \ifx \@empty#3\relax \else + \sf@subcaption{#1}{#2}{#3}% + \vskip\sf@capskip + \vskip\sf@captopadj + \fi\egroup + \hrule width0pt height0pt depth0pt + \box\@tempboxa + }{% + \@ifundefined{FBsc@max}% + {\box\@tempboxa}% + {\ifx\FBsuboheight\relax + \box\@tempboxa + \else + \vbox to \FBsuboheight{\FBafil\box\@tempboxa\FBbfil}% + \fi}% + \egroup + \ifx \@empty#3\relax \else + \vskip\sf@capskip + \hrule width0pt height0pt depth0pt + \sf@subcaption{#1}{#2}{#3}% + \fi + }% + \vskip\sf@bottom + \egroup + \@ifundefined{FBsc@max}{}% + {\addtocounter{FRobj}{-1}% + \ifnum\c@FRobj>0% bugfix + \subfloatrowsep + \fi}% + \ifmaincaptiontop\else + \global\advance\@nameuse{c@\@captype}\m@ne + \fi + \endgroup\ignorespaces} +\DeclareFROpt{subcapbesideposition}{\flrow@SFbesidealign{#1}} +\newcommand*\flrow@SFbesidealign[1]{% + \caption@ifinlist{#1}{t,top}{% + \let\flrow@SFBalign\TopFloatBoxes + }{\caption@ifinlist{#1}{b,bottom,default}{% + \let\flrow@SFBalign\BottomFloatBoxes + }{\caption@ifinlist{#1}{c,center}{% + \let\flrow@SFBalign\CenterFloatBoxes + }{\PackageError{floatrow}% + {Undefined sublabel position `#1'}{\flrow@eh}% + }}}} +\newcommand\flrow@SFBalign{\BottomFloatBoxes} +\newcommand\sidesubfloat{% + \ifx\@captype\@undefined + \@latex@error{\noexpand\subfloat outside float}\@ehd + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {\flrow@sidesubfloat}} +\def\flrow@sidesubfloat{\flrow@SFBalign + \begingroup + \@ifundefined{caption@setfloattype}% + \caption@settype + \caption@setfloattype + \@captype + \sf@ifpositiontop{% + \maincaptiontoptrue + }{% + \maincaptiontopfalse + }% + \caption@setoptions{subfloat}% + \caption@setoptions{sub\@captype}% + \let\sf@oldlabel=\label + \let\label=\subfloat@label + \ifmaincaptiontop\else + \advance\@nameuse{c@\@captype}\@ne + \fi + \refstepcounter{sub\@captype}% + \setcounter{sub\@captype @save}{\value{sub\@captype}}% + \@ifnextchar [% %] match left bracket + {\flrow@@sidesubfloat}% + {\flrow@@sidesubfloat[\@empty]}} +\long\def\flrow@@sidesubfloat[#1]{% + \@ifnextchar [% %] match left bracket + {\flrow@@@sidesubfloat{sub\@captype}[{#1}]}% + {\flrow@@@sidesubfloat{sub\@captype}[\@empty{#1}][{#1}]}} +\long\def\flrow@@@sidesubfloat#1[#2][#3]#4{% + \@ifundefined{FBsc@max}{}% + {\FB@readaux{\let\FBsuboheight\relax}}% + \@tempcnta=\@ne + \if@minipage + \@tempcnta=\z@ + \else\ifdim \lastskip=\z@ \else + \@tempcnta=\tw@ + \fi\fi + \sf@bottom=\z@ + \sf@top=\z@ + \leavevmode + \setbox\@tempboxa \hbox{#2}% + \@tempdima\wd\@tempboxa + \setbox\@tempboxa \hbox{#4}% + \advance\@tempdima\wd\@tempboxa + \advance\@tempdima\labelsep + \@ifundefined{FBsc@max}{}% + {\global\advance\Xhsize-\wd\@tempboxa + \dimen@=\ht\@tempboxa + \advance\dimen@\dp\@tempboxa + \ifdim\dimen@>\FBso@max + \global\FBso@max\dimen@ + \fi}% + \begin@FBBOX + \ifcase\@tempcnta + \@minipagefalse + \or + \vskip\sf@top + \or + \ifdim \lastskip=\z@ \else + \@tempskipb\sf@top\relax\@xaddvskip + \fi + \fi + \hbox{% + \begin@FBBOX + \ifx \@empty#3\relax \else + \hbox{\caption@@@make + {\caption@lfmt{\@nameuse{sub\@captype name}}% + {\@nameuse{thesub\@captype}}\relax}{}}% + \fi + \end@FBBOX\hskip\labelsep\ignorespaces + \begin@FBBOX + \box\@tempboxa + \end@FBBOX + }% + \vskip\sf@bottom + \end@FBBOX + \@ifundefined{FBsc@max}{}% + {\addtocounter{FRobj}{-1}% + \ifnum\c@FRobj>0 + \subfloatrowsep + \fi}% + \ifmaincaptiontop\else + \global\advance\@nameuse{c@\@captype}\m@ne + \fi + \endgroup\ignorespaces} +\newcommand\subfloatlabel{\@ifnextchar[%] + {\flrow@subfloatlabel}{\subfloat[]{}}} +\@ifdefinable\flrow@subfloatlabel{} +\def\flrow@subfloatlabel[#1]{% + \ifx\@captype\@undefined + \@latex@error{\noexpand\subfloat outside float}\@ehd + \fi + \begingroup + \count@#1\advance\count@\m@ne + \csname c@sub\@captype\endcsname\count@\relax + \@ifnextchar[%] + {\flrow@@subfloatlabel[#1]}% + {\subfloat[]{}\endgroup}} +\@ifdefinable\flrow@@subfloatlabel{} +\@ifundefined{newseparatedlabel}\@tempswatrue\@tempswafalse +\if@tempswa + \def\FRsf@Flabel{\label} +\else + \newseparatedlabel\FRsf@Flabel{\@captype}{sub\@captype} +\fi +\def\flrow@@subfloatlabel[#1][#2]{% + \subfloat[]{\FRsf@Flabel{#2}}\endgroup} +\endinput +%% +%% End of file `fr-subfig.sty'. diff --git a/tex/src/packages/lineno.sty b/tex/src/packages/lineno.sty new file mode 100644 index 0000000..53a7b52 --- /dev/null +++ b/tex/src/packages/lineno.sty @@ -0,0 +1,3484 @@ + \iffalse; awk '/S[H]ELL1/' lineno.sty|sh;exit; + ... see bottom for .tex documentation ... + +Macro file lineno.sty for LaTeX: attach line numbers, refer to them. + \fi +\def\fileversion{v4.41} \def\filedate{2005/11/02} %VERSION + +%%% Copyright 1995--2003 Stephan I. B"ottcher ; +%%% Copyright 2002--2005 Uwe L"uck, http://www.contact-ednotes.sty.de.vu +%%% for version 4 and code from former Ednotes bundle +%%% --author-maintained. +%%% +%%% This file can be redistributed and/or modified under +%%% the terms of the LaTeX Project Public License; either +%%% version 1.3a of the License, or any later version. +%%% The latest version of this license is in +%%% http://www.latex-project.org/lppl.txt +%%% We did our best to help you, but there is NO WARRANTY. +% +%%% $Id: lineno.sty,v 3.14.2.2 2004/09/13 19:30:39 stephan Exp $ %% was v4.00. +% \title{\texttt{\itshape +%% %% (UL 2004/10/09:) Italic TT is evil +%% %% ... or nice front page layout!? +%% +% lineno.sty \ \fileversion\ \filedate +% \unskip}\\\ \\ +% A \LaTeX\ package to attach +% \\ line numbers to paragraphs +% \unskip}\author{% +% Stephan I. B\"ottcher +% \\ Uwe L\"uck +% \unskip}\date{% +% boettcher@physik.uni-kiel.de +% \\ http://contact-ednotes.sty.de.vu +%% \\ stephan@nevis.columbia.edu +%% \\ Stephan.Boettcher@cern.ch +% \\} +% +% \documentclass[a4paper,12pt]{article}%D +% \usepackage{lineno}%D +%% %% (New v4.00) +% \catcode`\_\active\let_~ +%% %% Beware math!? (/New v4.00) +% \def~{\verb~} +% \let\lessthan< +% \catcode`\<\active +% \def<#1>{$\langle${\itshape#1}\/$\rangle$} +% \catcode`\|\active +%% (New v4.1: \tt star; in box anyway.) +% \def|#1{\ttfamily\string#1} +%% \def|#1{{\ttfamily\string#1}} +%% (/New v4.1) +% \newenvironment{code} +% {\par\runninglinenumbers +% \modulolinenumbers[1]% +% \linenumbersep.3em +% \footnotesize +% \def\linenumberfont +% {\normalfont\tiny\itshape}} +% {} +%% %% (New v4.00) +% {\makeatletter \gdef\scs#1{\texttt +% {\protect\@backslashchar#1}}} +% \def\old{\par\footnotesize} +%% %% (/New v4.00) +%% %% (New v4.1) +% {\catcode`\/\active +% \gdef\path{\begingroup\catcode`\/\active +% \let/\slash\dopath} +% \gdef\dopath#1{\slash\unpenalty#1\endgroup}} +%% %% (/New v4.1) +% +% \begin{document}%D +%% \DocInput{lineno}%D +% \pagewiselinenumbers +% \maketitle +% \pagestyle{headings} +% \tableofcontents +% \sloppy +% +%% %% New v4.00: `...section{%' + \unskip +% \section{% +% Introductions +%% %% New v4.00: `s' +% \unskip} +% +% (New v4.00) Parts of former first section +% have been rendered separate subsections for package +% version_v4.00. (/New v4.00) +% +% \subsection{% +% Introduction to versions $\textrm{v}\lessthan4$ +% \unskip} +% +% This package provides line numbers on paragraphs. +% After \TeX\ has broken a paragraph into lines there will +% be line numbers attached to them, with the possibility to +% make references through the \LaTeX\ ~\ref~, ~\pageref~ +% cross reference mechanism. This includes four issues: +% \begin{itemize} +% \item attach a line number on each line, +% \item create references to a line number, +% \item control line numbering mode, +% \item count the lines and print the numbers. +% \end{itemize} +% The first two points are implemented through patches to +% the output routine. The third by redefining ~\par~, ~\@par~ +% and ~\@@par~. The counting is easy, as long as you want +% the line numbers run through the text. If they shall +% start over at the top of each page, the aux-file as well +% as \TeX s memory have to carry a load for each counted line. +% +% I wrote this package for my wife Petra, who needs it for +% transcriptions of interviews. This allows her to +% precisely refer to passages in the text. It works well +% together with ~\marginpar~s, but not too well with displaymath. +% ~\footnote~s are a problem, especially when they +% are split, but we may get there. +% (New v4.00 UL) Version v4.00 overcomes the problem, I believe. +% (/UL /New v4.00) +% +% lineno.sty works +% surprisingly well with other packages, for +% example, ~wrapfig.sty~. So please try if it +% works with whatever you need, and if it does, +% please tell me, and if it does not, tell me as +% well, so I can try to fix it. +% +% \subsection{% +% Introduction to versions v4.00ff. (UL) +% \unskip} +% +% ~lineno.sty~ has been maintained by Stephan until version_v3.14. +% From version_v4.00 onwards, maintenance is shifting towards +% Uwe L\"uck (UL), who is the author of v4\dots code and of v4\dots +% changes in documentation. This came about as follows. +% +% Since late 2002, Christian Tapp and Uwe L\"uck have employed +% ~lineno.sty~ for their ~ednotes.sty~, a package supporting +% critical editions---cf. +% \[\mbox{\tt +% http://ednotes.sty.de.vu +% \unskip}\] +% ---while you find ~ednotes.sty~ and surrounding files in +% CTAN folder \path{macros/latex/contrib/ednotes}. +% +% Soon, some weaknesses of ~lineno.sty~ showed up, mainly since +% Christian's critical editions (using ~ednotes.sty~) needed lots +% of ~\linelabel~s and footnotes. (These weaknesses are due to +% weaknesses of \LaTeX's ~\marginpar~ mechanism that Stephan +% used for ~\linelabel~.) So we changed some ~lineno.sty~ +% definitions in some extra files, which moreover offered new +% features. We sent these files to Stephan, hoping he would take +% the changes into ~lineno.sty~. However, he was too short of time. +% +% Writing a TUGboat article on Ednotes in 2004, we hoped to +% reduce the number of files in the Ednotes bundle and so asked +% Stephan again. Now he generously offered maintenance to me, so +% I could execute the changes on my own. +% +% The improvements are as follows: +% \begin{itemize}\item +% [(i)] Footnotes placement approaches intentions better +% (footnotes formerly liked to pile up at late pages). +% \item +% [(ii)] The number of ~\linelabel~s in one paragraph is no longer +% limited to 18. +% \item +% [(iii)] ~\pagebreak~, ~\nopagebreak~, ~\vspace~, and the star +% and optional versions of ~\\~ work as one would expect +% (section_\ref{s:MVadj}). %% Added for v4.1 +% \item +% [(iv)] A command is offered which chooses the first line number +% to be printed in the margin +% (subsection_\ref{ss:Mod}). %% Added for v4.1 +% \item +% [(v)] (New v4.1) \LaTeX\ tabular environments (optionally) +% get line numbers as well, and you can refer to them in the +% usual automatic way. (It may be considered a shortcoming that, +% precisely, \emph{rows} are numbered, not lines.---See +% subsection_\ref{ss:Tab}.) +% \item +% [(vi)] We are moving towards referring to math items +% (subsection_\ref{ss:MathRef} and the hooks in +% subsection_\ref{ss:LL}). +% (/New v4.1) +% \end{itemize} +% (Thanks to Stephan for making this possible!) +% +%% Unpublish: +%% You may trace the earlier developments of these changes by +%% requesting our files ~linenox0.sty~, ~linenox1.sty~, and +%% ~lnopatch.sty~. Most of our changes have been in ~linenox0.sty~. +%% Our ~linenox1.sty~ has extended ~linenox0.sty~ for one single +%% purpose in a not very stable way. +%%% (See ~\linenumberpar~ below). +%% ~lnopatch.sty~ has done the first line number thing referred +%% to in case_(iv) up to now. +%% (New v4.1) +%% Case_(v) earlier was provided by our ~edtab02.sty~---now +%% called ~edtable.sty~. +%% (/New v4.1) +% +% Ednotes moreover profits from Stephan's offer with regard +% to the documentation of our code which yielded these +% improvements formerly. This documentation now becomes +% printable, being part of the ~lineno.sty~ documentation. +% +% Of course, Stephan's previous ~lineno.sty~ versions were a great +% and ingenious work and exhibit greatest \TeX pertise. I never +% could have done this. I learnt a lot in studying the code when +% Christian pointed out strange output results and error +% messages, and there are still large portions of ~lineno.sty~ +% which I don't understand (consider only pagewise numbering of +% lines). Fortunately, Stephan has offered future help if +% needed.---My code for attaching line numbers to \emph{tabular +% environments} (as mentioned above, now still in +% ~edtable.sty~) %% %% TODO +% developed from macros which Stephan and Christian experimented +% with in December 2002. Stephan built the basics. +% (However, I then became too proud to follow his advice only to +% use and modify ~longtable.sty~.) +% +% There are some issues concerning use of counters on which I +% don't agree with Stephan and where I would like to change the +% code if ~lineno.sty~ is ``mine'' as Stephan offered. However, +% Stephan is afraid of compatibility problems from which, in +% particular, his wife could suffer in the near future. So he +% demanded that I change as little as possible for my first +% version. Instead of executing changes that I plan I just offer +% my opinions at the single occasions. I hope to get in touch +% this way with users who consider subtle features vital which I +% consider strange. +% +% On the other hand, the sections on improvements of the +% implementation have been blown up very much and may be tiring +% and litte understandable for mere \emph{users}. These users +% may profit from the present presentation just by jumping to +% sections_\ref{s:Opts} and_\ref{s:UserCmds}. There is a user's +% guide ulineno.tex which may be even more helpful, but it has +% not been updated for a while. %% TODO +% +% \subsection{% +% Availability +% \unskip} +% +% In case you have found the present file otherwise than from +% CTAN: A recent version and documentation of this package +% should be available from CTAN folder +% \path{macros/latex/contrib/lineno}. +% Or mail to one of the addresses at top of file. +% +% \subsection{% +% Introductory code +% \unskip} +% +% This style option is written for \LaTeXe, November 1994 or later, +% since we need the ~\protected@write~ macro. +% +% (New v4.00) And we use ~\newcommand*~ for +% controlling length of user macro arguments, which has been +% available since December 1994. +%% + +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +%% [1994/11/04] +\ProvidesPackage{lineno} + [\filedate\space line numbers on paragraphs \fileversion] +% (/New v4.00) +%% +%% History of versions: +%% v1.00 1995/03/31 SIB: first release for Petra's interview transcriptions +%% v1.01 1995/10/28 SIB: added ~pagewise~ mode +%% v1.02 1995/11/15 SIB: added ~modulo~ option +%% v1.03 1995/12/05 SIB: pagewise: try to reduce the hash-size requirements +%% v2.00 1995/12/06 SIB: .. it works, new user interface +%% v2.01 1996/09/17 SIB: put into CVS +%% v2.02 1997/03/17 SIB: add: \@reinserts, for footnotes +%% v2.04 1998/03/09 SIB: add: linenomath environment +%% v2.05 1998/04/26 SIB: add: prevgraf test +%% v2.06 1999/03/02 SIB: LPPL added +%% v3.00 1999/06/11 SiB: include the extension in the main file +%% v3.01 1999/08/28 SiB: \@reinserts -> \holdinginserts +%% v3.02 2000/03/10 SiB: \@LN@output +%% v3.03 2000/07/01 SiB: \@LN@ExtraLabelItems, hyperref +%% v3.04 2000/12/17 SiB: longtable compatibility. +%% v3.05 2001/01/02 SiB: [fleqn] detection. +%% v3.05a 2001/01/04 SiB: [fleqn] detection reverted for eqnarray. +%% v3.06 2001/01/17 SiB: [twocolumn] mode support. +%% v3.07 2001/07/30 SiB: [hyperref] option obsoleted. +%% v3.08 2001/08/02 SiB: linenomath wrapping for \[ \] +%% v3.08a 2001/08/04 SiB: linenomath wrapping for \[ \] fixed +%% v3.08b 2002/01/27 SiB: enquotation typo fix +%% v3.09 2003/01/14 SIB: hyperref detection fix +%% v3.10 2003/04/15 FMi: \MakeLineNo fix for deep boxes +%% v3.10a 2003/11/12 Uwe Lück: \lineref typo fix +%% v4.00 2004/09/02 UL: included linenox0, linenox1, lnopatch code with +%% documentation, usually indicated by `New v4.00'; +%% discussions of old code, indicated by `UL'; +%% LPPL v.1 -> LPPL v1.3, `program' -> `file'; +%% first lines with \filedate and \fileversion, +%% according nawk lines; `November 1994 or later', +%% some earlier documentation typos (including a few +%% bad minus signs), { -> {% and } -> \unskip} at +%% line ends (so, e.g., alignment in TOC works); \scs. +%% 2004/09/03 UL: removed everything which indicated that the +%% present file were named `lineno4.sty'. +%% v4.1 2004/09/19 UL: Inserted Stephan's identification line, removed +%% some TODOs and remarks from v4.00. +%% 2004/10/04 UL: Added acknowledgement for Daniel Doherty; +%% `(New v4.00)' with [|\firstlinenumber]; changed +%% TODOs; Refining -> Redefining (\vadjust). +%% 2004/10/05 UL: ednmath0 -> mathrefs; \catcode`\~ -> \active; +%% \path; refined section on options `mathrefs'; +%% changes in introduction. +%% 2004/10/06 UL: Changed/removed TODOs, e.g., for edtable.sty. +%% 2004/10/11 UL: Reminders: linenox0/1/lnopatch.sty obsolete; +%% \tt star in list of commands. +%% 2004/10/12 UL: Corrected blank lines in lineno.tex. +%% 2004/10/19 UL: Fixed minor typos; remark on \if@LN@edtable. +%% v4.1a 2004/11/07 UL: LPPL v1.3a. +%% v4.1b 2004/11/13 UL: Comment on \outputpenalty values. +%% v4.1c 2005/01/10 UL: Contact via http. +%% v4.11 2005/02/20 UL: Error message with \linelabel when not numbering. +%% 2005/03/07 UL: Removed \linelabel from ss:Tab heading, consider +%% marginal line numbers as well, revised ss:Tab. +%% Added a few lines on missing explanations to +%% s:UserCmds. Corrected some code alignments. +%% 2005/03/08 UL: Require recent edtable.sty. +%% + +%% v4.2 2005/03/21 UL: "Physical page" counter works with \include. +%% 2005/04/17 UL: Raised options section above extensions section +%% (v4.00 disabled `displaymath' option); +%% third arg for \@ifundefined{mathindent}; +%% "bunch of options"; +%% 2005/04/24 UL: compatibility with tamefloats; vplref.sty. +%% 2005/04/25 UL: \number -> \the; wondered -> $$; subsec. appbas; +%% CrtlLN sec -> subsec.; \newcommand* wherever ...; +%% doc. on `other output routines' and `addpageno' +%% (this changed from `varioref'). +%% 2005/04/27 UL: =1\relax -> =\@ne, 0\relax ..., \hb@xt@, +%% \ifx\@@par\@@@par -> \ifLineNumbers, typos, +%% \pagestyle{headings}, LaTeX -> \LaTeX. +%% v4.21 2005/04/28 UL: linenomath section: removed wrong \else's, +%% \holding...: \thr@@, \@LN@outer@holdins, \global. +%% v4.22 2005/05/01 UL: \unvbox\@outputbox; \@LN@col without #1, +%% 2005/05/08 UL: global/local \internall..., \resetl... global, +%% shortened discussions of this and of \newcounter. +%% 2005/05/09 UL: corr.: doc. typo, version history, bad lines; +%% percent; \chardef for modulo, +%% \value{firstlinenumber}. +%% v4.3 2005/05/10 UL: \@backslashchar -> \char`\\ in \scs. +%% 2005/05/11 UL: \linenumbers sets ...outer@holdins; tidied up +%% documentation regarding earlier versions. +%% 2005/05/12 UL: `linenomath' without spurious number above; +%% `displaymath' default; edmac homepage -> +%% ednotes.sty.de.vu, \endlinenomath without +%% numbers: no change of \holdinginserts; +%% \linelabel doesn't go to .aux or mark, +%% hyperref detected; undone 2005/05/10 (bad mark). +%% 2005/05/13 UL: Reworked hyperref detection (new subsec.). +%% 2005/05/15 UL: More typo fixes, corrected terrible confusions in +%% the discussion (v4.22/v4.3) of \new/\stepcounter; +%% new subsec. in `Line number ...'; another +%% implementation of `hyperref' detection. +%% 2005/05/16 UL: Final minor changes. +%% v4.31b /06/14 UL: Extended explanation of \firstlinenumbers +%% and package options; \@LN@ifgreat@critical; +%% \modulolinenumbers*. Sent to Ednotes.news only. +%% v4.31 2005/06/15 UL: \modulolinenumbers* with \firstlinenumber{1}; +%% " -> ``/''; more doc. on \firstlinenumber . +%% 2005/06/20 UL: Typo fix. +%% 2005/10/01 UL: Warning about \mod...* with pagewise mode. +%% v4.31a /10/02 UL: Minor changes of appearance of doc., e.g., +%% \[ for $$. +%% v4.32b /10/15 UL: Support for \addvspace; removed comments that +%% had been invisible already for some time; +%% made clear with which environments the +%% linenomath environment is not needed. +%% v4.32ab /10/15 UL: Observe \if@nobreak with support for \addvspace. +%% v4.32 2005/10/17 UL: Just made it official and sent it to CTAN. +%% v4.33b /10/23 UL: \if@nobreak\nobreak\fi -> \nobreak . +%% v4.33ab /10/24 UL: \LineNoLaTeXOutput without \@tempswafalse; +%% undid v4.22: \[unv]box\@outputbox (space is OK, +%% \unvbox pushes short columns down); \@LN@kern@z@ . +%% v4.4b 2005/10/24 UL: Another tidying-up of the discussion of +%% \stepcounter{linenumber}; \@LN@screenoff@pen +%% replaces \@LN@kern@z@, \@LN@depthbox . +%% v4.4 2005/10/27 UL: Just made official for CTAN. +%% v4.4a 2005/10/29 UL: Undid change of discussion of +%% \stepcounter{linenumber} (confusion again). +%% v4.41 2005/11/02 UL: Raised \CheckCommand*. +%% +%% Acknowledgements: +%% v3.06: Donald Arseneau, pointed to mparhack.sty. +%% v3.07+: Frank Mittelbach, points out inconsistencies in the +%% user interface. +%% v3.10: Frank Mittelbach \MakeLineNo fix for deep boxes +%% v4.00: Daniel Doherty points out clash of \pagewise... with resetting +%% page number. +%% v4.21: Much testing work by Erik Luijten. +%% v4.3: `displaymath' default by Erik Luijten's suggestion. +%% v4.31: \modulolinenumbers* is an idea of Hillel Chayim Yisraeli's. +%% v4.32: Support for \addvspace due to Saravanan M.'s observation. +%% v4.33: Different support for \addvspace due to bug reports by +%% Saravanan M.'s and David Josef Dev. +%% v4.4: David Josef Dev points out that \kern\z@ after a paragraph +%% tends to place its final baseline wrongly. +% +% +% \section{% +% Put the line numbers to the lines +% \unskip} +% +% (New v4.00) This section contained the most +% basic package code previously. For various purposes of +% version_4\dots, much of these basics have been to be modified. +% Much of my (UL's) reasoning on these modifications has been to +% be reported. Sorry, the present section has been blown up +% awfully thus and contains ramifications that may be difficult +% to trace. We add some ~\subsection~ commands in order to cope +% with the new situation. (/New v4.00) +% +% \subsection{% +% Basic code of \texttt{lineno.sty} \scs{output} +% \unskip}\label{ss:output} +% +% The line numbers have to be attached by the output +% routine. We simply set the ~\interlinepenalty~ to $-100000$. +% The output routine will be called after each line in the +% paragraph, except the last, where we trigger by ~\par~. +% The ~\linenopenalty~ is small enough to compensate a bunch of +% penalties (e.g., with ~\samepage~). +% +% (New v3.04) Longtable uses +% ~\penalty~$-30000$. The lineno penalty range was +% shrunk to $-188000 \dots -32000$. (/New v3.04) +% (New v4.00) New values are listed below (11111f.). (/New v4.00) + +\newcount\linenopenalty\linenopenalty=-100000 + +%% TODO v4.4+: +% (UL) Hm. It is never needed below +% that this is a counter. ~\def\linenopenalty{-100000\relax}~ +% would do. (I guess this consumes more memory, but it +% is more important to save counters than to save memory.) +% I was frightened by ~-\linenopenalty~ below, but indeed +% \TeX\ interprets the string ~--100000~ as 100000. +% Has any user or extension package writer ever called +% ~\linenopenalty=xxx~, or could I really change this?---The +% counter is somewhat faster than the macro. Together with the +% compatibility question this seems to support keeping the +% counter. (???) +%% Note that Stephan chose ~\mathchardef~ below, +%% so his choice above seems to have been deliberate. +%% <- no point, \mathchardef token is fast. +% (/UL) + +\mathchardef\linenopenaltypar=32000 + +% So let's make a hook to ~\output~, the direct way. The \LaTeX\ +% macro ~\@reinserts~ puts the footnotes back on the page. +% +% (New v3.01) ~\@reinserts~ badly +% screws up split footnotes. The bottom part is +% still on the recent contributions list, and the +% top part will be put back there after the bottom +% part. Thus, since lineno.sty does not play well +% with ~\inserts~ anyway, we can safely experiment +% with ~\holdinginserts~, without making things +% much worse. +% +% Or that's what I thought, but: Just activating +% ~\holdinginserts~ while doing the ~\par~ will +% not do the trick: The ~\output~ routine may be +% called for a real page break before all line +% numbers are done, and how can we get control +% over ~\holdinginserts~ at that point? +% +% Let's try this: When the ~\output~ routine is +% run with ~\holdinginserts=3~ for a real page +% break, then we reset ~\holdinginserts~ and +% restart ~\output~. +% +% Then, again, how do we keep the remaining +% ~\inserts~ while doing further line numbers? +% +% If we find ~\holdinginserts~=$-3$ we activate it again +% after doing ~\output~. (/New v3.01) +% +% (New v3.02) To work with +% multicol.sty, the original output routine is now +% called indirectly, instead of being replaced. +% When multicol.sty changes ~\output~, it is a +% toks register, not the real thing. (/New v3.02) +% +% (New v4.00) Two further complications are added. +%% +%% TODO v4.3+: Or three, ~\@nobreakfalse~ after ~\MakeLineNo~ +%% for getting rid of ~\@LN@nopagebreak~. +% \begin{itemize}\item +% [(i)] Problems with footnotes formerly resulted from +% \LaTeX's ~\@reinserts~ in ~\@specialoutput~ which Stephan's +% ~\linelabel~ called via the ~\marginpar~ mechanism. +% \item +% [(ii)] \LaTeX\ commands using ~\vadjust~ formerly didn't work +% as one would have hoped. The problem is as follows: +% Printing the line number results from +% a box that the output routine inserts at the place of the +% ~\interlinepenalty~. ~\vadjust~ items appear \emph{above} the +% ~\interlinepenalty~ (\TeX book p._105). So ~\pagebreak~, e.g., +% formerly sent the line number to the next page, while the +% penalty from ~\nopagebreak~ could not tie the following line, +% since it was screened off by the line number box.---Our trick +% is putting the ~\vadjust~ items into a list macro from which +% the output routine transfers them into the vertical list, +% below the line number box. +% \end{itemize} +% In this case_(ii), like in case_(i), footnotes would suffer +% if ~\holdinginserts~ were non-positive. Indeed, in both +% cases_(i) and_(ii) we tackle the footnote problem by extending +% that part of Stephan's output routine that is active when +% ~\holdinginserts~ is positive. This extension writes the line +% number ~\newlabel~ to the .aux file (which was formerly done +% under $~\holdinginserts~=-3$) and handles the ~\vadjust~ +% items.---To trigger ~\output~ and its ~\linelabel~ or, resp., +% ~\vadjust~ part, the list of signal penalties started +% immediately before is increased here (first for ~\linelabel~, +% second for postponed ~\vadjust~ items): + +\mathchardef\@Mllbcodepen=11111 +\mathchardef\@Mppvacodepen=11112 + +% (/New v4.00) (New v4.2) David Kastrup urges to use a private +% name instead of ~\the\output~ (LaTeX-L-list). Otherwise an +% ~\output~ routine loaded later and using ~\newtoks\output~ +% again may get lost entirely. So we change use of ~\@LN@output~, +% using it for the former purpose. Reference to what appeared +% with the name of ~\output~ here lasts for a few lines and then +% is given away. + +\let\@tempa\output +\newtoks\output +\let\@LN@output\output +\output=\expandafter{\the\@tempa} + +% Now we add two cases to Stephan's output routine. (New v4.00) + +\@tempa={% +% (/New 4.2) + \LineNoTest + \if@tempswa +%% +%% (UL) Learnt that even in def.s blank line means ~\par~. +%% to leave visual space in present file with having a +%% blank line neither in present nor in .tex file, +%% use double comment mark (`%%'). (/UL) +%% +% (New v4.00) +% We insert recognition of waiting ~\linelabel~ items--- +%% + \ifnum\outputpenalty=-\@Mllbcodepen + \WriteLineNo +%% +% ---and of waiting ~\vadjust~ items: +%% + \else + \ifnum\outputpenalty=-\@Mppvacodepen + \PassVadjustList + \else +%% +%% Now we give control back to Stephan. +% (/New v4.00) (New v4.2) Outsource ``Standard'' output +% ---which occurs so rarely---to subsection_\ref{ss:LLO}: +%% + \LineNoLaTeXOutput +% (/New v4.2) (New v4.00) +% Two new ~\fi~s for the ~\linelabel~ and ~\vadjust~ tests--- +%% + \fi + \fi +%% +% ---and the remaining is +%%%next three lines are +% Stephan's code again: +% (/New v4.00) +%% + \else + \MakeLineNo + \fi + } + +% (New v4.00) Our new macros +% ~\WriteLineNo~ and ~\PassVadjustList~ will be dealt with in +% sections_\ref{s:LNref} and_\ref{ss:PVadj}. (/New v4.00) +% +% \subsection{% +% \scs{LineNoTest} +% \unskip} +% +% The float mechanism inserts ~\interlinepenalty~s during +% ~\output~. So carefully reset it before going on. Else +% we get doubled line numbers on every float placed in +% horizontal mode, e.g, from ~\linelabel~. +% +% Sorry, neither a ~\linelabel~ nor a ~\marginpar~ should +% insert a penalty, else the following linenumber +% could go to the next page. Nor should any other +% float. So let us suppress the ~\interlinepenalty~ +% altogether with the ~\@nobreak~ switch. +% +% Since (ltspace.dtx, v1.2p)[1996/07/26], the ~\@nobreaktrue~ does +% it's job globally. We need to do it locally here. + +\def\LineNoTest{% + \let\@@par\@@@par + \ifnum\interlinepenalty<-\linenopenaltypar + \advance\interlinepenalty-\linenopenalty + \@LN@nobreaktrue + \fi + \@tempswatrue + \ifnum\outputpenalty>-\linenopenaltypar\else + \ifnum\outputpenalty>-188000\relax + \@tempswafalse + \fi + \fi + } + +\def\@LN@nobreaktrue{\let\if@nobreak\iftrue} % renamed v4.33 + +% (UL) I thought here were +% another case of the save stack problem explained in \TeX book, +% p._301, namely through both local and global changing +% ~\if@nobreak~. However, ~\@LN@nobreak~ is called during +% ~\@LN@output~ only, while ~\@nobreaktrue~ is called by \LaTeX's +% ~\@startsection~ only. The latter never happens during +% ~\@LN@output~. So there is no local value of ~\if@nobreak~ on +% save stack when ~\@nobreaktrue~ acts, since ~\the\@LN@output~ +% (where ~\@LN@output~ is a new name for the original ~\output~) +% is executed within a group (\TeX book p._21). +%% +%% 2004/09/19 Removed nonsense here according to Stephan 2004/09/04. +%% +% (/UL) +% +% \subsection{% +% Other output routines (v4.2) +% \unskip}\label{ss:LLO} +% +% I had thought of dealing with bad interference of footnotes +% (and ~\enlargethispage~) with (real) ~\marginpar~s and floats +% \emph{here}. Yet this is done in +% \[ +% ~http://~\mbox{[CTAN]} +% ~/macros/latex/contrib/tamefloats/tameflts.sty~ +% \] +% now, and I prefer striving for compatibility with the latter. +% (See there for expanding on the problem.) +% This requires returning the special absolute value of +% ~\holdinginserts~ that ~lineno.sty~ finds at the end of a newly +% typeset paragraph---now done in subsection_\ref{ss:calls} +% (~\linenumberpar~). +% The former ~\LineNoHoldInsertsTest~ has been filled into here. +%% ---`3' is replaced by ~\thr@@~ for a while. ~\thr@@~ is +%% useful practice since plain \TeX, but Stephan may have been +%% wise in suspecting that \LaTeX\ once could forsake ~\thr@@~. +%% The same holds for ~\@M=10000~. +% Note: when the following code is invoked, we have +% ~\if@tempswa~_ =_~\iftrue~. +% WARNING: I am still not sure whether the present code is good +% for cooperating with other packages that use ~\holdinginserts~. + +\def\LineNoLaTeXOutput{% + \ifnum \holdinginserts=\thr@@ % v4.33 without \@tempswafalse + \global\holdinginserts-\thr@@ + \unvbox\@cclv + \ifnum \outputpenalty=\@M \else \penalty\outputpenalty \fi + \else + \if@twocolumn \let\@makecol\@LN@makecol \fi + \the\@LN@output % finally following David Kastrup's advice. + \ifnum \holdinginserts=-\thr@@ + \global\holdinginserts\thr@@ \fi + \fi +} + +% \textit{More on dealing with output routines from other +% packages:} +% Since ~lineno.sty~'s output routine is called at least once +% for each output line, I think it should be in \TeX's +% original ~\output~, while output routines dealing with +% building pages and with floats etc.\ should be filled into +% registers addressed by ~\output~ after ~\newtoks\output~. +% Therefore \begin{enumerate} +% \item +% ~tameflts.sty~ should be loaded \emph{after} ~lineno.sty~; +% \item +% if a class changes ~\output~ (APS journal class revtex4, +% e.g.), ~lineno.sty~ should be loaded by ~\RequirePackage~ +% [here presumably following some options in +% brackets]~{lineno}~ \emph{preceding} ~\documentclass~. +% \item +% If you actually maintain such a class, please consider +% loading ~lineno.sty~ on some draft option. The bunch of +% lineno's package options may be a problem, but perhaps the +% purpose of your class is offering only very few of lineno's +% options anyway, maybe just one. +% \end{enumerate} +% The latter may also be needed with classes that don't follow +% David Kastrup's rule on changing ~\output~. +% +% \subsection{% +% \scs{MakeLineNo}: Actually attach line number +% \unskip}\label{ss:MLN} +% +% We have to return all the page to the current page, and +% add a box with the line number, without adding +% breakpoints, glue or space. The depth of our line number +% should be equal to the previous depth of the page, in +% case the page breaks here, and the box has to be moved up +% by that depth. +% +% The ~\interlinepenalty~ comes after the ~\vadjust~ from a +% ~\linelabel~, so we increment the line number \emph{after} +% printing it. The macro ~\makeLineNumber~ produces the +% text of the line number, see section \ref{appearance}. +% +% (UL) I needed a while to understand +% the sentence on incrementing. Correctly: writing the +% ~\newlabel~ to the .aux file is triggered by the signal +% penalty that ~\end@float~ inserts via ~\vadjust~. +% However, this could be changed by our new ~\PostponeVadjust~. +% After ~\c@linenumber~ has been introduced as a \LaTeX\ +% counter, it might be preferable that it behaved like standard +% \LaTeX\ counters which are incremented shortly before printing. +% But this may be of little practical relevance in this case, +% as ~\c@linenumber~ is driven in a very non-standard +% way.---However still, this behaviour of ~\c@linenumber~ +% generates a problem with our ~edtable.sty~. +%% \unskip---Before, +%% I thought that Stephan had reported his reasoning incorrectly +%% and rather did this because of his ~\resetlinenumber~ which +%% initializes ~\c@linenumber~ to 1 instead of 0---the latter is +%% usual with \LaTeX\ counters. Cf._additional comment at +%% ~\resetlinenumber~. +% (/UL). +% +% Finally we put in the natural ~\interlinepenalty~, except +% after the last line. +% +% (New v3.10) Frank Mittelbach points out that box255 may be +% less deep than the last box inside, so he proposes to +% measure the page depth with ~\boxmaxdepth=\maxdimen~. +% (/New v3.10) +% +% (UL, New v4.00) We also resume the matter of +% ~\vadjust~ items that was started in section_\ref{ss:output}. +% +% \TeX\ puts only nonzero interline +% penalties into the vertical list (\TeX book p._105), while +% ~lineno.sty~ formerly replaced the signal interline penalty by +% something closing with an explicit penalty of the value that +% the interline penalty would have without ~lineno.sty~. +% This is usually 0. Now, explicit vertical penalties can be +% very nasty with respect to ~\nopagebreak~, e.g., a low (even +% positive) ~\widowpenalty~ may force a widow where you +% explicitly tried to forbid it by ~\nopagebreak~ +% (see explanation soon below). +% The ~\nopagebreak~ we create here would never work if all +% those zero penalties were present.---On +% the other hand, we cannot just omit Stephan's zero penalties, +% because \TeX\ puts a penalty of 10000 after what ~lineno.sty~ +% inserts (\TeX book p._125). This penalty must be overridden +% to allow page breaks between ordinary lines. To revive +% ~\nopagebreak~, we therefore replace those zero (or low) +% penalties by penalties that the user demanded by +% ~\nopagebreak~.---This mechanism is not perfect and does not +% exactly restore the original \LaTeX\ working of ~\pagebreak~ +% and ~\nopagebreak~. Viz., if there are several vertical +% penalties after a line which were produced by closely sitting +% ~\[no]pagebreak~s, without ~lineno.sty~ the lowest penalty would +% be effective (cf._\TeX book exercise_14.10). Our mechanism, by +% contrast, chooses the \emph{last} user-set penalty of the line +% as the effective one. It would not be very difficult to come +% more close to the original mechanism, but until someone urges +% us we will cling to the present simple way. You may consider an +% advantage of the difference between our mechanism and the +% original one that the user here can actually override low +% penalties by ~\nopagebreak~, which may be what a lay \LaTeX\ +% user would expect. +%% ---Zero glue would do instead of zero +%% penalty! This could make things easier. Maybe next time. +%% <- v4.4: No, problem with column depth. +% (/UL, /New v4.00) + +\def\MakeLineNo{% + \@LN@maybe@normalLineNumber % v4.31 + \boxmaxdepth\maxdimen\setbox\z@\vbox{\unvbox\@cclv}% + \@tempdima\dp\z@ \unvbox\z@ + \sbox\@tempboxa{\hb@xt@\z@{\makeLineNumber}}% +%% +% (New v4.00) Previously, +% \begin{old}\begin{verbatim} +% % \stepcounter{linenumber}% +% \end{verbatim} +% \end{old} +%% %% TODO: Still first `\begin{old}'? +% followed. (Of course, there was no +% comment mark; I put it there to make +% reading the actual code easy.) +% +% (New v4.22: improved) Why not just +% \[~\global\advance\c@linenumber\@ne~?\] +% ~\stepcounter~ additionally resets ``subordinate'' +% counters, but which could these (usefully) be? +% Again, may be column counters with ~edtable.sty~!? +% +% But then, our ~edtable.sty~ and its ~longtable~ option +% should use it as well. So use a shorthand supporting +% uniformity. You can even use it as a hook for choosing +% ~\global\advance\c@linenumber\@ne~ instead of our choice. +% (/New v4.22) +%% + \stepLineNumber +%% +% (New v4.4) Now +%% + \ht\@tempboxa\z@ \@LN@depthbox +%% +% appends the box containing the line number without changing +% ~\prevdepth~---see end of section. +% Now is the time for inserting the $\dots$ (/New v4.4) +%% The line number has now been placed (it may be invisible +%% depending on the modulo feature), so +%% we can insert the +% ~\vadjust~ items. We cannot do this much later, because +% their right place is above the artificial interline +% penalty which Stephan's code will soon insert +% (cf._\TeX book p._105). The next command is just ~\relax~ +% if no ~\vadjust~ items have been accumulated for the +% current line. Otherwise it is a list macro inserting +% the ~\vadjust~ items and finally resetting itself. +% (This is made in section_\ref{ss:PVadj} below.) +% If the final item is a penalty, it is stored so it can +% compete with other things about page breaking. +%% + \@LN@do@vadjusts + \count@\lastpenalty +%% +% At this place, +% \begin{old}\begin{verbatim} +% % \ifnum\outputpenalty=-\linenopenaltypar\else +% \end{verbatim} +% \end{old} +% originally followed. We need something \emph{before} the +% ~\else~: +%% + \ifnum\outputpenalty=-\linenopenaltypar + \ifnum\count@=\z@ \else +%% +% So final ~\pagebreak[0]~ or ~\nopagebreak[0]~ has no +% effect---but this will make a difference after headings only, +% where nobody should place such a thing anyway. +%% + \xdef\@LN@parpgbrk{% + \penalty\the\count@ + \global\let\noexpand\@LN@parpgbrk + \noexpand\@LN@screenoff@pen}% v4.4 +%% +% That penalty will replace former ~\kern\z@~ in +% ~\linenumberpar~, see subsection_\ref{ss:calls}.---A +% few days earlier, I tried to send just a penalty value. +% However, the ~\kern\z@~ in ~\linenumberpar~ is crucial, +% as I then found out. See below.---The final penalty is +% repeated, but this does no harm. (It would not be very +% difficult to avoid the repeating, but it may even be +% less efficient.) It may be repeated due to the previous +% ~\xdef~, but it may be repeated as well below in the +% present macro where artificial interline penalty is to +% be overridden. +%% + \fi + \else +%% +% (/New v4.00) +%% Corrected code alignment with v4.11. + \@tempcnta\outputpenalty + \advance\@tempcnta -\linenopenalty +%% +% (New v4.00) +% \begin{old}\begin{verbatim} +% % \penalty\@tempcnta +% \end{verbatim} +% \end{old} +% followed previously. To give ~\nopagebreak~ a chance, +% we do +%% Corrected code alignment with v4.11. + \penalty \ifnum\count@<\@tempcnta \@tempcnta \else \count@ \fi +%% +% instead.---In ~linenox0.sty~, the ~\else~ thing once was omitted. +% Sergei Mariev's complaint (thanks!) showed that it is vital +% (see comment before ~\MakeLineNo~). +% The remaining ~\fi~ from previous package version closes the +% ~\ifnum\outputpenalty~\dots +% (/New v4.00) +%% + \fi + } + +% (New v4.00) + +\newcommand\stepLineNumber{\stepcounter{linenumber}} + +% For reason, see use above. (/New v4.00) +%% %% TODO v4.4+: ~\newcommand~ more often!? +% +% (New v4.4) The depth preserving trick is drawn here from +% ~\MakeLineNo~ because it will be used again in +% section_\ref{ss:calls}. + +\def\@LN@depthbox{% + \dp\@tempboxa=\@tempdima + \nointerlineskip \kern-\@tempdima \box\@tempboxa} + +% (/New v4.4) +% +% \section{% +% Control line numbering +% \unskip} +% \subsection{% +% Inserting \scs{output} calls %% own subsec. v4.4. +% \unskip}\label{ss:calls} +% The line numbering is controlled via ~\par~. \LaTeX\ +% saved the \TeX-primitive ~\par~ in ~\@@par~. We push it +% one level further out, and redefine ~\@@par~ to insert +% the ~\interlinepenalty~ needed to trigger the +% line numbering. And we need to allow pagebreaks after a +% paragraph. +% +% New (2.05beta): the prevgraf test. A paragraph that ends with a +% displayed equation, a ~\noindent\par~ or ~wrapfig.sty~ produce empty +% paragraphs. These should not get a spurious line number via +% ~\linenopenaltypar~. + +\let\@@@par\@@par +\newcount\linenoprevgraf + +% (UL) And needs ~\linenoprevgraf~ +% to be a counter? Perhaps there may be a paragraph having +% thousands of lines, so ~\mathchardef~ doesn't suffice (really??). +%% +%% %% TODO: limitations of lines per paragraph elsewhere? +%% %% Signal penalties, e.g.!? ~\deadcycles~!? +%% +% A macro ending on ~\relax~ might suffice, but would be +% somewhat slow. I think I will use ~\mathchardef~ next time. +% Or has any user used ~\linenoprevgraf~? (/UL) + +%% v4.33: changed code alignment for better understanding. +\def\linenumberpar{% + \ifvmode \@@@par \else + \ifinner \@@@par \else + \xdef\@LN@outer@holdins{\the\holdinginserts}% v4.2 + \advance \interlinepenalty \linenopenalty + \linenoprevgraf \prevgraf + \global \holdinginserts \thr@@ + \@@@par + \ifnum\prevgraf>\linenoprevgraf + \penalty-\linenopenaltypar + \fi +%% +% (New v4.00) +% \begin{old}\begin{verbatim} +% % \kern\z@ +% \end{verbatim} +% \end{old} +% was here previously. What for? +% According to \TeX book p._125, Stephan's +% interline penalty is changed into 10000. At the end of a +% paragraph, the ~\parskip~ would follow that penalty of 10000, +% so there could be a page break neither at the +% ~\parskip~ nor at the ~\baselineskip~ (\TeX book p._110)---so +% there could never be a page break between two paragraphs. +% So something must screen off the 10000 penalty. +% Indeed, the ~\kern~ is a place to break. +% (Stephan once knew this: see `allow pagebreaks' above.) +% +% Formerly, I tried to replace ~\kern\z@~ by +% \begin{old}\begin{verbatim} +% % \penalty\@LN@parpgpen\relax +% \end{verbatim} +% \end{old} +% ---but this allows a page break after heading. So: +%% + \@LN@parpgbrk +%% +%% After heading, ~\kern\z@~ resulting from previous line +%% (see below) is followed by ~\write~ or ~\penalty10000~, +%% so causes no page break. +% +% These and similar changes were formerly done by ~linenox1.sty~. +% (/New v4.00) +% +% (New v4.4) +% A ~\belowdisplayskip~ may precede the previous when the paragraph +% ends on a display-math; or there may be a ~\topsep~ from a list, etc. +% ~\addvspace~ couldn't take account for it with ~\kern\z@~ +% here. v4.32 therefore moved the space down -- with at least two +% bad consequences. +% Moreover, David Josef Dev observes that ~\kern\z@~ may +% inappropriately yield column depth 0pt. +% For these reasons, we introduce ~\@LN@screenoff@pen~ below. +% (/New v4.4) +%% + \global\holdinginserts\@LN@outer@holdins % v4.2 + \advance\interlinepenalty -\linenopenalty + \fi % from \ifinner ... \else + \fi} % from \ifvmode ... \else + +% (New v4.00, v4.4) Initialize ~\@LN@parpgbrk~, accounting +% for earlier space and for appropriate columndepth. +% We use former ~\MakeLineNo~'s depth-preverving trick +% ~\@LN@depthbox~ again: + +\def\@LN@screenoff@pen{% + \ifdim\lastskip=\z@ + \@tempdima\prevdepth \setbox\@tempboxa\null + \@LN@depthbox \fi} + +\global\let\@LN@parpgbrk\@LN@screenoff@pen + +% (/New v4.4, v4.00) +% \subsection{% +% Turning on/off %% own subsec. v4.4. +% \unskip}\label{ss:OnOff} +% The basic commands to enable and disable line numbers. +% ~\@par~ and ~\par~ are only touched, when they are ~\let~ +% to ~\@@@par~/~\linenumberpar~. The line number may be +% reset to 1 with the star-form, or set by an optional +% argument ~[~~]~. +% +% (New v4.00) We add ~\ifLineNumbers~ etc.\ since +% a number of our new adjustments need to know whether +% linenumbering is active. This just provides a kind of +% shorthand for ~\ifx\@@par\linenumberpar~; moreover it is +% more stable: who knows what may happen to ~\@@par~?---A +% caveat: ~\ifLineNumbers~ may be wrong. E.g., it may be +% ~\iffalse~ where it acts, while a ~\linenumbers~ a few +% lines below---in the same paragraph---brings about that +% the line where the ~\ifLineNumbers~ appears gets a +% marginal number. +%% Better implementation suggested below. +%% +% (New v4.3) Just noticed: Such tricks have been +% disallowed with v4.11, see subsections_\ref{ss:LL} +% and_\ref{ss:OnOff}.---Moreover, the switching between +% meanings of ~\linelabel~ for a possible error message +% as of v4.11 is removed. Speed is difficult to esteem +% and also depends on applications. Just use the most +% simple code you find. (/New v4.3) + +\newif\ifLineNumbers \LineNumbersfalse + +% (/New v4.00) + +\def\linenumbers{% + \LineNumberstrue % v4.00 + \xdef\@LN@outer@holdins{\the\holdinginserts}% v4.3 +%% +% (New v4.3) The previous line is for ~{linenomath}~ +% in a first numbered paragraph. (/New v4.3) +%% + \let\@@par\linenumberpar + % \let\linelabel\@LN@linelabel % v4.11, removed v4.3 + \ifx\@par\@@@par\let\@par\linenumberpar\fi + \ifx\par\@@@par\let\par\linenumberpar\fi + \@LN@maybe@moduloresume % v4.31 + \@ifnextchar[{\resetlinenumber}%] + {\@ifstar{\resetlinenumber}{}}% + } + +\def\nolinenumbers{% + \LineNumbersfalse % v4.00 + \let\@@par\@@@par + % \let\linelabel\@LN@LLerror % v4.11, removed v4.3 + \ifx\@par\linenumberpar\let\@par\@@@par\fi + \ifx\par\linenumberpar\let\par\@@@par\fi + } + +% (New v4.00) Moreover, it is useful to switch to +% ~\nolinenumbers~ in ~\@arrayparboxrestore~. We postpone this +% to section_\ref{ss:ReDef} where we'll have an appending macro +% for doing this. (/New v4.00) +% +% What happens with a display math? Since ~\par~ is not executed, +% when breaking the lines before a display, they will not get +% line numbers. Sorry, but I do not dare to change +% ~\interlinepenalty~ globally, nor do I want to redefine +% the display math environments here. +% \begin{displaymath} +% display \ math +% \end{displaymath} +% See the subsection below, for a wrapper environment to make +% it work. But that requires to wrap each and every display +% in your \LaTeX\ source %%. +%% v4.3: +% (see option ~displaymath~ in subsections_\ref{ss:v3opts} +% and_\ref{ss:display} for some relief [UL]). +% +% The next two commands are provided to turn on line +% numbering in a specific mode. Please note the difference: +% for pagewise numbering, ~\linenumbers~ comes first to +% inhibit it from seeing optional arguments, since +% re-/presetting the counter is useless. + +\def\pagewiselinenumbers{\linenumbers\setpagewiselinenumbers} +\def\runninglinenumbers{\setrunninglinenumbers\linenumbers} + +% Finally, it is a \LaTeX\ style, so we provide for the use +% of environments, including the suppression of the +% following paragraph's indentation. +% +%% TODO: v4.4+: +% (UL) I am drawing the following +% private thoughts of Stephan's to publicity so that others may +% think about them---or to remind myself of them in an efficient +% way. (/UL) +%% UL changed `%%%' to `% %' below. +%% TODO: add \par to \linenumbers, if called from an environment. %% v4.3 +%% ToDO: add an \@endpe hack if \linenumbers are turned on +% \begin{old}\begin{verbatim} +% % TO DO: add \par to \linenumbers, if called from an environment. +% % To DO: add an \@endpe hack if \linenumbers are turned on +% % in horizontal mode. {\par\parskip\z@\noindent} or +% % something. +% \end{verbatim} +% \end{old} +% (UL) However, I rather think that ~\linenumbers~ and %% v4.31 +% ~\nolinenumbers~ should execute a ~\par~ already. (Then the +% ~\par~s in the following definitions should be removed.) (/UL) + +\@namedef{linenumbers*}{\par\linenumbers*} +\@namedef{runninglinenumbers*}{\par\runninglinenumbers*} + +\def\endlinenumbers{\par\@endpetrue} +\let\endrunninglinenumbers\endlinenumbers +\let\endpagewiselinenumbers\endlinenumbers +\expandafter\let\csname endlinenumbers*\endcsname\endlinenumbers +\expandafter\let\csname endrunninglinenumbers*\endcsname\endlinenumbers +\let\endnolinenumbers\endlinenumbers + +% +% \subsection{% +% Display math +% \unskip}\label{ss:DM} +% +% Now we tackle the problem to get display math working. +% There are different options. +% \begin{enumerate}\item[ +% 1.] Precede every display math with a ~\par~. +% Not too good. +% \item[ +% 2.] Change ~\interlinepenalty~ and associates globally. +% Unstable. +% \item[ +% 3.] Wrap each display math with a ~{linenomath}~ +% environment. +% \end{enumerate} +% We'll go for option 3. See if it works: +% \begin{linenomath} +% \begin{equation} +% display \ math +% \end{equation} +% \end{linenomath} +% The star form ~{linenomath*}~ should also number the lines +% of the display itself, +% \begin{linenomath*} +% \begin{eqnarray} +% multi && line \\ +% display && math \\ +% & +% \begin{array}{c} +% with \\ +% array +% \end{array} +% & +% \end{eqnarray} +% \end{linenomath*} +% including multline displays. +% +% First, here are two macros to turn +% on linenumbering on paragraphs preceeding displays, with +% numbering the lines of the display itself, or without. +% The ~\ifx..~ tests if line numbering is turned on. It +% does not harm to add these wrappers in sections that are +% not numbered. Nor does it harm to wrap a display +% twice, e.q, in case you have some ~{equation}~s wrapped +% explicitely, and later you redefine ~\equation~ to do it +% automatically. +% +% (New v4.3) To avoid the spurious line number above a +% display in vmode, I insert ~\ifhmode~. (/New v4.3) + +\newcommand\linenomathNonumbers{% + \ifLineNumbers +%% \ifx\@@par\@@@par\else + \ifnum\interlinepenalty>-\linenopenaltypar + \global\holdinginserts\thr@@ + \advance\interlinepenalty \linenopenalty + \ifhmode % v4.3 + \advance\predisplaypenalty \linenopenalty + \fi + \fi + \fi + \ignorespaces + } + +\newcommand\linenomathWithnumbers{% + \ifLineNumbers +%% \ifx\@@par\@@@par\else + \ifnum\interlinepenalty>-\linenopenaltypar + \global\holdinginserts\thr@@ + \advance\interlinepenalty \linenopenalty + \ifhmode % v4.3 + \advance\predisplaypenalty \linenopenalty + \fi + \advance\postdisplaypenalty \linenopenalty + \advance\interdisplaylinepenalty \linenopenalty + \fi + \fi + \ignorespaces + } + +% The ~{linenomath}~ environment has two forms, with and +% without a star. The following two macros define the +% environment, where the stared/non-stared form does/doesn't number the +% lines of the display or vice versa. + +\newcommand\linenumberdisplaymath{% + \def\linenomath{\linenomathWithnumbers}% + \@namedef{linenomath*}{\linenomathNonumbers}% + } + +\newcommand\nolinenumberdisplaymath{% + \def\linenomath{\linenomathNonumbers}% + \@namedef{linenomath*}{\linenomathWithnumbers}% + } + +\def\endlinenomath{% + \ifLineNumbers % v4.3 + \global\holdinginserts\@LN@outer@holdins % v4.21 + \fi + \global % v4.21 support for LaTeX2e earlier than 1996/07/26. + \@ignoretrue +} +\expandafter\let\csname endlinenomath*\endcsname\endlinenomath + +% The default is not to number the lines of a display. But +% the package option ~mathlines~ may be used to switch +% that behavior. + +\nolinenumberdisplaymath + +% +% \section{% +% Line number references +% \unskip}\label{s:LNref} +% \subsection{% +% Internals %% New subsec. v4.3. +% \unskip} +% The only way to get a label to a line number in a +% paragraph is to ask the output routine to mark it. +% +% (New v4.00) The following two paragraphs don't hold any +% longer, see below. (/New v4.00) +% \begin{old}\begin{verbatim} +% % We use the marginpar mechanism to hook to ~\output~ for a +% % second time. Marginpars are floats with number $-1$, we +% % fake marginpars with No $-2$. Originally, every negative +% % numbered float was considered to be a marginpar. +% % +% % The float box number ~\@currbox~ is used to transfer the +% % label name in a macro called ~\@LNL@~. +% \end{verbatim} +% \end{old} +% A ~\newlabel~ is written to the aux-file. The reference +% is to ~\theLineNumber~, \emph{not} ~\thelinenumber~. +% This allows to hook in, as done below for pagewise line +% numbering. +% +% (New v3.03) The ~\@LN@ExtraLabelItems~ are added for a hook +% to keep packages like ~{hyperref}~ happy. (/New v3.03) +% +% (New v4.00) +% We fire the ~\marginpar~ mechanism, so we leave \LaTeX's +% ~\@addmarginpar~ untouched. +% \begin{old}\begin{verbatim} +% % \let\@LN@addmarginpar\@addmarginpar +% % \def\@addmarginpar{% +% % \ifnum\count\@currbox>-2\relax +% % \expandafter\@LN@addmarginpar +% % \else +% % \@cons\@freelist\@currbox +% % \protected@write\@auxout{}{% +% % \string\newlabel +% % {\csname @LNL@\the\@currbox\endcsname}% +% % {{\theLineNumber}{\thepage}\@LN@ExtraLabelItems}}% +% % \fi} +% \end{verbatim} +% \end{old} +% OK, we keep Stephan's ~\@LN@ExtraLabelItems~: +% (/New v4.00) + +\let\@LN@ExtraLabelItems\@empty + +% (New v4.00) +% We imitate the ~\marginpar~ mechanism without using the +% ~\@freelist~ boxes. ~\linelabel~ will indeed place a signal +% penalty (~\@Mllbcodepen~, new), and it will put a label into +% some list macro ~\@LN@labellist~. A new part of the output +% routine will take the labels from the list and will write +% ~\newlabel~s to the .aux file. +% +% The following is a version of \LaTeX's ~\@xnext~. + +\def\@LN@xnext#1\@lt#2\@@#3#4{\def#3{#1}\gdef#4{#2}} + +% This takes an item ~#1~ from a list ~#4~ into ~#3~; +% to be used as ~\expandafter\@LN@xnext#4\@@#3#4~. +% Our lists use ~\@lt~ after each item for separating. +% Indeed, there will be another list macro which can +% appear as argument ~#4~, this will be used for moving +% ~\vadjust~ items (section_\ref{ss:PVadj}). +% The list for ~\linelabel~s is the following: + +\global\let\@LN@labellist\@empty + +% The next is the new part of the output routine writing the +% ~\newlabel~ to the .aux file. Since it is no real page output, +% the page is put back to top of the main vertical list. + +\def\WriteLineNo{% + \unvbox\@cclv + \expandafter \@LN@xnext \@LN@labellist \@@ + \@LN@label \@LN@labellist + \protected@write\@auxout{}{\string\newlabel{\@LN@label}% + {{\theLineNumber}{\thepage}\@LN@ExtraLabelItems}}% +} + +% (/New v4.00) +% +% \subsection{% +% The \scs{linelabel} command +% \unskip}\label{ss:LL} +% To refer to a place in line ~\ref{~~}~ at page +% ~\pageref{~~}~ you place a ~\linelabel{~~}~ at +% that place. +% +% \linelabel{demo} +% \marginpar{\tiny\raggedright +% See if it works: This paragraph +% starts on page \pageref{demo}, line +% \ref{demo}. +% \unskip}% +% (New v4.11) +% \begin{old}\begin{verbatim} +% % If you use this command outside a ~\linenumbers~ +% % paragraph, you will get references to some bogus +% % line numbers, sorry. But we don't disable the command, +% % because only the ~\par~ at the end of a paragraph may +% % decide whether to print line numbers on this paragraph +% % or not. A ~\linelabel~ may legally appear earlier than +% % ~\linenumbers~. +% \end{verbatim} +% \end{old} +% This trick is better not allowed---see subsections_\ref{ss:LL} +% and_\ref{ss:OnOff}. +% (/New v4.11) +% +% ~\linelabel~ +% \begin{old}\begin{verbatim} +% %, via a fake float number $-2$, %% new mechanism v4.00 +% \end{verbatim} +% \end{old} +% puts a +% ~\penalty~ into a ~\vadjust~, which triggers the +% pagebuilder after putting the current line to the main +% vertical list. A ~\write~ is placed on the main vertical +% list, which prints a reference to the current value of +% ~\thelinenumber~ and ~\thepage~ at the time of the +% ~\shipout~. +% +% A ~\linelabel~ is allowed only in outer horizontal mode. +% In outer vertical mode we start a paragraph, and ignore +% trailing spaces (by fooling ~\@esphack~). +% +% (New v4.00) We aim at relaxing the previous condition. +% We insert a hook ~\@LN@mathhook~ and a shorthand +% ~\@LN@postlabel~ to support the ~mathrefs~ option which +% allows ~\linelabel~ in math mode. +% +% The next paragraph is no longer valid. +% \begin{old}\begin{verbatim} +% % The argument of ~\linelabel~ is put into a macro with a +% % name derived from the number of the allocated float box. +% % Much of the rest is dummy float setup. +% \end{verbatim} +% \end{old} +% (/New v4.00) +% +% (New v4.11) +% \begin{old}\begin{verbatim} +% % \def\linelabel#1{% +% \end{verbatim} +% \end{old} +% I forgot ~\linenumbers~ today, costed me hours or so. + +\def\@LN@LLerror{\PackageError{lineno}{% + \string\linelabel\space without \string\linenumbers}{% + Just see documentation. (New feature v4.11)}\@gobble} + +% (New v4.3) Here some things have changed for v4.3. +% The previous ~#1~ has been replaced by ~\@gobble~. +% Ensuing, the ~\linelabel~ error message is re-implemented. +% I find it difficult to compare efficiency of slight +% alternatives---so choose an easy one. Explicit switching +% in ~\linenumbers~ and ~\nolinenumbers~ is an additional +% command that may better be avoided. + +\newcommand\linelabel{% + \ifLineNumbers \expandafter \@LN@linelabel + \else \expandafter \@LN@LLerror \fi} +%%\let\linelabel\@LN@LLerror + +\gdef\@LN@linelabel#1{% +%% +% ~\gdef~ for hyperref ``symbolically''. (/New v4.11) +%% + \ifx\protect\@typeset@protect +%% +% $\gets$ And a ~\linelabel~ should never be replicated in a +% mark or a TOC entry. (/New v4.3) +%% + \ifvmode + \ifinner \else + \leavevmode \@bsphack \@savsk\p@ + \fi + \else + \@bsphack + \fi + \ifhmode + \ifinner + \@parmoderr + \else +%% +% (New v4.00) +%% + \@LN@postlabel{#1}% +% \begin{old}\begin{verbatim} +% % \@floatpenalty -\@Mii +% % \@next\@currbox\@freelist +% % {\global\count\@currbox-2% +% % \expandafter\gdef\csname @LNL@\the\@currbox\endcsname{#1}}% +% % {\@floatpenalty\z@ \@fltovf \def\@currbox{\@tempboxa}}% +% % \begingroup +% % \setbox\@currbox \color@vbox \vbox \bgroup \end@float +% % \endgroup +% % \@ignorefalse \@esphack +% \end{verbatim} +% \end{old} +% (/New v4.00) +%% + \@esphack +%% +% (New v4.00) +% The ~\@ignorefalse~ was appropriate before because the +% ~\@Esphack~ in ~\end@float~ set ~\@ignoretrue~. Cf._\LaTeX's +% ~\@xympar~. (/New v4.00) +%% + \fi + \else +%% +% (New v4.00) +%% + \@LN@mathhook{#1}% +% \begin{old}\begin{verbatim} +% % \@parmoderr +% \end{verbatim} +% \end{old} +% Instead of complaining, you may just do your job. +% (/New v4.00) +%% + \fi + \fi + } + +% (New v4.00) The shorthand just does what happened +% with ~linenox0.sty~ before ~ednmath0.sty~ (New v4.1: +% now ~mathrefs~ option) appeared, and +% the hook is initialized to serve the same purpose. +% So errors come just where Stephan had built them in, +% and this is just the \LaTeX\ ~\marginpar~ behaviour. + +\def\@LN@postlabel#1{\g@addto@macro\@LN@labellist{#1\@lt}% + \vadjust{\penalty-\@Mllbcodepen}} +\def\@LN@mathhook#1{\@parmoderr} + +% (/New v4.00) +% +% \modulolinenumbers[3] +% \firstlinenumber{1} +% \section{% +% The appearance of the line numbers +% \unskip}\label{appearance} +% \subsection{% +% Basic code %% own subsec. v4.2. +% \unskip} +% +% The line numbers are set as ~\tiny\sffamily\arabic{linenumber}~, +% $10pt$ left of the text. With options to place it +% right of the text, or . . . +% +% . . . here are the hooks: + +\def\makeLineNumberLeft{% + \hss\linenumberfont\LineNumber\hskip\linenumbersep} + +\def\makeLineNumberRight{% + \linenumberfont\hskip\linenumbersep\hskip\columnwidth + \hb@xt@\linenumberwidth{\hss\LineNumber}\hss} + +\def\linenumberfont{\normalfont\tiny\sffamily} + +\newdimen\linenumbersep +\newdimen\linenumberwidth + +\linenumberwidth=10pt +\linenumbersep=10pt + +% Margin switching requires ~pagewise~ numbering mode, but +% choosing the left or right margin for the numbers always +% works. + +\def\switchlinenumbers{\@ifstar + {\let\makeLineNumberOdd\makeLineNumberRight + \let\makeLineNumberEven\makeLineNumberLeft}% + {\let\makeLineNumberOdd\makeLineNumberLeft + \let\makeLineNumberEven\makeLineNumberRight}% + } + +\def\setmakelinenumbers#1{\@ifstar + {\let\makeLineNumberRunning#1% + \let\makeLineNumberOdd#1% + \let\makeLineNumberEven#1}% + {\ifx\c@linenumber\c@runninglinenumber + \let\makeLineNumberRunning#1% + \else + \let\makeLineNumberOdd#1% + \let\makeLineNumberEven#1% + \fi}% + } + +\def\leftlinenumbers{\setmakelinenumbers\makeLineNumberLeft} +\def\rightlinenumbers{\setmakelinenumbers\makeLineNumberRight} + +\leftlinenumbers* + +% ~\LineNumber~ is a hook which is used for the modulo stuff. +% It is the command to use for the line number, when you +% customize ~\makeLineNumber~. Use ~\thelinenumber~ to +% change the outfit of the digits. +% +% +% We will implement two modes of operation: +% \begin{itemize} +% \item numbers ~running~ through (parts of) the text +% \item ~pagewise~ numbers starting over with one on top of +% each page. +% \end{itemize} +% Both modes have their own count register, but only one is +% allocated as a \LaTeX\ counter, with the attached +% facilities serving both. + +\newcounter{linenumber} +\newcount\c@pagewiselinenumber +\let\c@runninglinenumber\c@linenumber + +% Only the running mode counter may be reset, or preset, +% for individual paragraphs. The pagewise counter must +% give a unique anonymous number for each line. +% +% (New v4.3) ~\newcounter{linenumber}~ +% was the only ~\newcounter~ in the whole package, and +% formerly I was near using ~\newcount~ instead. Yet +% ~\newcounter~ may be quite useful for ~\includeonly~. +% It also supports resetting ``subcounters'', but what +% could these be? Well, ~edtable~ might introduce a +% subcounter for columns. +% (Note that \LaTeX's setting commands would work with +% ~\newcount\c@linenumber~ already, apart from this. +% And perhaps sometimes ~\refstepcounter{linenumber}~ +% wouldn't work---cf._my discussion of ~\stepcounter~ in +% subsection_\ref{ss:MLN}, similarly ~\refstep...~ would +% be quite useless. +% Even the usual redefinitions of ~\thelinenumber~ would +% work. It is nice, on the other hand, that +% ~\thelinenumber~ is predefined here. \LaTeX's +% initialization of the value perhaps just serves making +% clear \LaTeX\ counters should always be changed +% globally.---Shortened and improved the discussion here.) +% (/New v4.3) +% +% (New v4.22) +% ~\c@linenumber~ usually is---globally---incremented by +% ~\stepcounter~ (at present), so resetting it locally would +% raise the save stack problem of \TeX book p._301, moreover +% it would be is useless, there is no hope of keeping the +% values local (but see subsection_\ref{ss:ILN}). So I insert +% ~\global~: (/New v4.22) + +\newcommand*\resetlinenumber[1][\@ne]{% + \global % v4.22 + \c@runninglinenumber#1\relax} + +% (New v4.00) +% \begin{old}\begin{verbatim} +% % \newcommand\resetlinenumber[1][1]{\c@runninglinenumber#1} +% \end{verbatim} +% \end{old} +% Added ~\relax~, being quite sure that this does no harm +% and is quite important, as with ~\setcounter~ etc. +% I consider this a bug fix (although perhaps no user has +% ever had a problem with this). (/New v4.00) +% +% (v4.22: I had made much fuss about resetting subordinate +% counters here---removed, somewhat postponed.) +% +%% TODO v4.4+: +%% \newcommand*\resetlinenumber[1][\@ne]{% +%% \ifx\c@linenumber\c@runninglinenumber +%% \global\c@linenumber#1\relax +%% \global\advance\c@linenumber\m@ne +%% \stepLineNumber +%% \else +%% \PackageError{lineno}%% Shorthand!? +%% {You can't reset line number in pagewise mode}% +%% {This should suffice.}% +%% \fi +%% } +% +% \subsection{% +% Running line numbers +% \unskip} +% +% Running mode is easy, ~\LineNumber~ and ~\theLineNumber~ +% produce ~\thelinenumber~, which defaults to +% ~\arabic{linenumber}~, using the ~\c@runninglinenumber~ +% counter. This is the default mode of operation. + +\def\makeRunningLineNumber{\makeLineNumberRunning} + +\def\setrunninglinenumbers{% + \def\theLineNumber{\thelinenumber}% + \let\c@linenumber\c@runninglinenumber + \let\makeLineNumber\makeRunningLineNumber + } + +\setrunninglinenumbers\resetlinenumber + +% +% \subsection{% +% Pagewise line numbers +% \unskip}\label{ss:PW} +% +% Difficult, if you think about it. The number has to be +% printed when there is no means to know on which page it +% will end up, except through the aux-file. My solution +% is really expensive, but quite robust. +% +% With version ~v2.00~ the hashsize requirements are +% reduced, because we do not need one controlsequence for +% each line any more. But this costs some computation time +% to find out on which page we are. +% +% ~\makeLineNumber~ gets a hook to log the line and page +% number to the aux-file. Another hook tries to find out +% what the page offset is, and subtracts it from the counter +% ~\c@linenumber~. Additionally, the switch +% ~\ifoddNumberedPage~ is set true for odd numbered pages, +% false otherwise. + +\def\setpagewiselinenumbers{% + \let\theLineNumber\thePagewiseLineNumber + \let\c@linenumber\c@pagewiselinenumber + \let\makeLineNumber\makePagewiseLineNumber + } + +\def\makePagewiseLineNumber{\logtheLineNumber\getLineNumber + \ifoddNumberedPage + \makeLineNumberOdd + \else + \makeLineNumberEven + \fi + } + +% Each numbered line gives a line to the aux file +% \begin{verse} +% ~\@LN{~~}{~~}~ +% \end{verse} +% very similar to the ~\newlabel~ business, except that we need +% an arabic representation of the page number, not what +% there might else be in ~\thepage~. + +\def\logtheLineNumber{\protected@write\@auxout{}{% +%% +% (New v4.00) (UL) +% As Daniel Doherty observed, the earlier line +% \begin{old}\begin{verbatim} +% % \string\@LN{\the\c@linenumber}{\noexpand\the\c@page}}} +% \end{verbatim} +% \end{old} +% here may lead into an infinite loop when the user resets +% the page number (think of ~\pagenumbering~, e.g.). +% Stephan and I brief\/ly discussed the matter and decided +% to introduce a ``physical''-page counter to which +% ~\logtheLineNumber~ refers. It was Stephan's idea to use +% ~\cl@page~ for reliably augmenting the ``physical''-page +% counter. However, this relies on the output routine once +% doing ~\stepcounter{page}~. Before Stephan's +% suggestion, I had thought of appending the stepping to +% \LaTeX's ~\@outputpage~.---So the macro definition ends +% as follows. +%% + \string\@LN{\the\c@linenumber}{% +%% +% (New v4.2) +%% \noexpand\number\n@LN@truepage}}} +%% +% The `truepage' counter must start with ~\c@~ so it works +% with ~\include~, and the ~\@addtoreset~ below is needed +% for the same purpose. +%% + \noexpand\the\c@LN@truepage}}} + +%% \newcount\n@LN@truepage +%% \g@addto@macro\cl@page{\global\advance\n@LN@truepage\@ne} +\newcount\c@LN@truepage +\g@addto@macro\cl@page{\global\advance\c@LN@truepage\@ne} +\@addtoreset{LN@truepage}{@ckpt} + +% (/New v4.2) I had thought of offering more +% features of a \LaTeX\ counter. However, the user should +% better \emph{not} have access to this counter. ~\c@page~ +% should suffice as a pagewise master counter.---To be sure, +% along the present lines the user \emph{can} manipulate +% ~\c@LN@truepage~ by ~\stepcounter{page}~. E.g., she might +% do this in order to manually insert a photograph. Well, +% seems not to harm. +% +% The above usage of ~\g@addto@macro~ and ~\cl@page~ may be +% not as stable as Stephan intended. His proposal used +% ~\xdef~ directly. But he used ~\cl@page~ as well, and who +% knows \dots{} And as to ~\g@addto@macro~, I have introduced +% it for list macros anyway. +% (/UL) (/New v4.00) +% +% From the aux-file we get one macro ~\LN@P~ for each +% page with line numbers on it. This macro calls four other +% macros with one argument each. These macros are +% dynamically defined to do tests and actions, to find out +% on which page the current line number is located. +% +% We need sort of a pointer to the first page with line +% numbers, initiallized to point to nothing: + +\def\LastNumberedPage{first} +\def\LN@Pfirst{\nextLN\relax} + +% The four dynamic macros are initiallized to reproduce +% themselves in an ~\xdef~ + +\let\lastLN\relax % compare to last line on this page +\let\firstLN\relax % compare to first line on this page +\let\pageLN\relax % get the page number, compute the linenumber +\let\nextLN\relax % move to the next page + +% During the end-document run through the aux-files, we +% disable ~\@LN~. I may put in a check here later, to give +% a rerun recommendation. + +\AtEndDocument{\let\@LN\@gobbletwo} + +% Now, this is the tricky part. First of all, the whole +% definition of ~\@LN~ is grouped, to avoid accumulation +% on the save stack. Somehow ~\csname~~\endcsname~ pushes +% an entry, which stays after an ~\xdef~ to that . +% +% If ~\LN@P~ is undefined, initialize it with the +% current page and line number, with the +% \emph{pointer-to-the-next-page} pointing to nothing. And +% the macro for the previous page will be redefined to point +% to the current one. +% +% If the macro for the current page already exists, just +% redefine the \emph{last-line-number} entry. +% +% Finally, save the current page number, to get the pointer to the +% following page later. + +\def\@LN#1#2{{\expandafter\@@LN + \csname LN@P#2C\@LN@column\expandafter\endcsname + \csname LN@PO#2\endcsname + {#1}{#2}}} + +\def\@@LN#1#2#3#4{\ifx#1\relax + \ifx#2\relax\gdef#2{#3}\fi + \expandafter\@@@LN\csname LN@P\LastNumberedPage\endcsname#1% + \xdef#1{\lastLN{#3}\firstLN{#3}% + \pageLN{#4}{\@LN@column}{#2}\nextLN\relax}% + \else + \def\lastLN##1{\noexpand\lastLN{#3}}% + \xdef#1{#1}% + \fi + \xdef\LastNumberedPage{#4C\@LN@column}} + +% The previous page macro gets its pointer to the +% current one, replacing the ~\relax~ with the cs-token +% ~\LN@P~. + +\def\@@@LN#1#2{{\def\nextLN##1{\noexpand\nextLN\noexpand#2}% + \xdef#1{#1}}} + +% Now, to print a line number, we need to find the page, +% where it resides. This will most probably be the page where +% the last one came from, or maybe the next page. However, it can +% be a completely different one. We maintain a cache, +% which is ~\let~ to the last page's macro. But for now +% it is initialized to expand ~\LN@first~, where the poiner +% to the first numbered page has been stored in. + +\def\NumberedPageCache{\LN@Pfirst} + +% To find out on which page the current ~\c@linenumber~ is, +% we define the four dynamic macros to do something usefull +% and execute the current cache macro. ~\lastLN~ is run +% first, testing if the line number in question may be on a +% later page. If so, disable ~\firstLN~, and go on to the +% next page via ~\nextLN~. + +\def\testLastNumberedPage#1{\ifnum#1<\c@linenumber + \let\firstLN\@gobble + \fi} + +% Else, if ~\firstLN~ finds out that we need an earlier +% page, we start over from the beginning. Else, ~\nextLN~ +% will be disabled, and ~\pageLN~ will run +% ~\gotNumberedPage~ with four arguments: the first line +% number on this column, the page number, the column +% number, and the first line on the page. + +\def\testFirstNumberedPage#1{\ifnum#1>\c@linenumber + \def\nextLN##1{\testNextNumberedPage\LN@Pfirst}% + \else + \let\nextLN\@gobble + \def\pageLN{\gotNumberedPage{#1}}% + \fi} + +% We start with ~\pageLN~ disabled and ~\nextLN~ defined to +% continue the search with the next page. + +\long\def \@gobblethree #1#2#3{} + +\def\testNumberedPage{% + \let\lastLN\testLastNumberedPage + \let\firstLN\testFirstNumberedPage + \let\pageLN\@gobblethree + \let\nextLN\testNextNumberedPage + \NumberedPageCache + } + +% When we switch to another page, we first have to make +% sure that it is there. If we are done with the last +% page, we probably need to run \TeX\ again, but for the +% rest of this run, the cache macro will just return four +% zeros. This saves a lot of time, for example if you have +% half of an aux-file from an aborted run, in the next run +% the whole page-list would be searched in vain again and +% again for the second half of the document. +% +% If there is another page, we iterate the search. + +\def\testNextNumberedPage#1{\ifx#1\relax + \global\def\NumberedPageCache{\gotNumberedPage0000}% + \PackageWarningNoLine{lineno}% + {Linenumber reference failed, + \MessageBreak rerun to get it right}% + \else + \global\let\NumberedPageCache#1% + \fi + \testNumberedPage + } + +% \linelabel{demo2} +% \marginpar{\tiny\raggedright +% Let's see if it finds the label +% on page \pageref{demo}, +% line \ref{demo}, and back here +% on page \pageref{demo2}, line +% \ref{demo2}. +% \unskip}% +% To separate the official hooks from the internals there is +% this equivalence, to hook in later for whatever purpose: + +\let\getLineNumber\testNumberedPage + +% So, now we got the page where the number is on. We +% establish if we are on an odd or even page, and calculate +% the final line number to be printed. + +\newif\ifoddNumberedPage +\newif\ifcolumnwiselinenumbers +\columnwiselinenumbersfalse + +\def\gotNumberedPage#1#2#3#4{\oddNumberedPagefalse + \ifodd \if@twocolumn #3\else #2\fi\relax\oddNumberedPagetrue\fi + \advance\c@linenumber\@ne + \ifcolumnwiselinenumbers + \subtractlinenumberoffset{#1}% + \else + \subtractlinenumberoffset{#4}% + \fi + } + +% You might want to run the pagewise mode with running line +% numbers, or you might not. It's your choice: + +\def\runningpagewiselinenumbers{% + \let\subtractlinenumberoffset\@gobble + } + +\def\realpagewiselinenumbers{% + \def\subtractlinenumberoffset##1{\advance\c@linenumber-##1\relax}% + } + +\realpagewiselinenumbers + +% For line number references, we need a protected call to +% the whole procedure, with the requested line number stored +% in the ~\c@linenumber~ counter. This is what gets printed +% to the aux-file to make a label: + +\def\thePagewiseLineNumber{\protect + \getpagewiselinenumber{\the\c@linenumber}}% + +% And here is what happens when the label is refered to: + +\def\getpagewiselinenumber#1{{% + \c@linenumber #1\relax\testNumberedPage + \thelinenumber + }} + +% % +% A summary of all per line expenses: +% \begin{description}\item +% [CPU:] The ~\output~ routine is called for each line, +% and the page-search is done. +% \item +% [DISK:] One line of output to the aux-file for each +% numbered line +% \item +% [MEM:] One macro per page. Great improvement over v1.02, +% which had one control sequence per line in +% addition. It blew the hash table after some five +% thousand lines. +% \end{description} +% +% \subsection{% +% Twocolumn mode (New v3.06) +% \unskip} +% +% Twocolumn mode requires another patch to the ~\output~ +% routine, in order to print a column tag to the .aux +% file. + +\AtBeginDocument{% v4.2, revtex4.cls (e.g.). + % <- TODO v4.4+: Or better in \LineNoLaTeXOutput!? + \let\@LN@orig@makecol\@makecol} +\def\@LN@makecol{% + \@LN@orig@makecol + \setbox\@outputbox \vbox{% + \boxmaxdepth \@maxdepth + \protected@write\@auxout{}{% + \string\@LN@col{\if@firstcolumn1\else2\fi}% + }% + \box\@outputbox + }% \vbox +} %% TODO cf. revtexln.sty. + +\def\@LN@col{\def\@LN@column} % v4.22, removed #1. +\@LN@col{1} + +% +% \subsection{% +% Numbering modulo $m$, starting at $f$ +%% Numbering modulo 5 +% \unskip}\label{ss:Mod} +% +% Most users want to have only one in five lines numbered. +% ~\LineNumber~ is supposed to produce the outfit of the +% line number attached to the line, while ~\thelinenumber~ +% is used also for references, which should appear even if +% they are not multiples of five. +% +% (New v4.00) Moreover, some users want to +% control which line number should be printed first. Support +% of this is now introduced here---see ~\firstlinenumber~ +% below.---~numline.sty~ by Michael Jaegermann and +% James Fortune offers controlling which \emph{final} +% line numbers should not be printed. What is +% it good for? We ignore this here until some user demands +% it.---Peter Wilson's ~ledmac.sty~ offers much different +% choices of line numbers to be printed, due to Wayne Sullivan. +% (/New v4.00) +% +% (New v4.22) ~\c@linenumbermodulo~ is rendered a +% fake counter, as discussed since v4.00. So it can +% no longer be set by ~\setcounter~. ~\modulolinenumbers~ +% serves this purpose. Well, does anybody want to do +% what worked with ~\addtocounter~? (Then please tell +% me.)---At least, ~\value~ still works. For the same +% purpose I rename the fake `firstlinenumber' counter +% ~\n@...~ to ~\c@...~. (/New v4.22) +% \begin{old}\begin{verbatim} +% % \newcount\c@linenumbermodulo % removed for v4.22 +% \end{verbatim} +% \end{old} +% +%% Removed for v4.22: +%% (UL) On my question why, e.g., +%% ~\chardef~ would not have sufficed, Stephan couldn't remember +%% exactly; guessed that he wanted to offer \LaTeX\ counter +%% facilities. However, the typical ones don't come this way. +%% So I'm quite sure that I will change this next time. +%% +%% However, I observed at least two times that users gave a very +%% high value to ~\c@linenumbermodulo~ in order to suppress +%% printing of the line number. One of these users preferred an +%% own way of handling line numbers, just wanted to use +%% ~\linelabel~ and ~ednotes.sty~ features. Should we support this? +%% I rather would like to advise them to +%% ~\let\makeLineNumber\relax~. (/UL) +% +% (New v4.00) \par +% ~\themodulolinenumber~ waits for being declared +% ~\LineNumber~ by ~\modulolinenumbers~. (This has +% been so before, no change.) Here is how it +% looked before: +% \begin{old}\begin{verbatim} +% % \def\themodulolinenumber{{\@tempcnta\c@linenumber +% % \divide\@tempcnta\c@linenumbermodulo +% % \multiply\@tempcnta\c@linenumbermodulo +% % \ifnum\@tempcnta=\c@linenumber\thelinenumber\fi +% % }} +% \end{verbatim} +% \end{old} +% (UL) This was somewhat slow. This arithmetic +% happens at every line. This time I tend to declare an extra +%% TODO v4.4+ +% line counter (as opposed to my usual recommendations to use +% counters as rarely as possible) which is stepped every line. +% It could be incremented in the same way as ~\c@LN@truepage~ +% is incremented via ~\cl@page~! This is another point in favour +% of ~{linenumber}~ being a \LaTeX\ counter! +% When this new counter equals ~\c@linenumbermodulo~, it is reset, +% and ~\thelinenumber~ is executed.---It gets much slower by my +% support of controlling the first line number below. I should +% improve this.---On +%% %% TODO v4.4+--pagewise!? +% the other hand, time expense means very little nowadays, +% while the number of \TeX\ counters still is limited. +% +% For the same purpose, moreover, attaching the line number +% box could be intercepted earlier (in ~\MakeLineNo~), +% without changing ~\LineNumber~. However, this may be +% bad for the latter's announcement as a wizard interface +% in section_\ref{s:UserCmds}. +%% +%% I wonder about Stephan's group. Its only effect is that +%% ~\@tempcnta~ is restored after using it. What for is this? +%% I tend to remove the group braces. %% TODO v4.4+ +% (/UL) +% +% Here is the new code. It is very near to my ~lnopatch.sty~ +% code which introduced the first line number feature +% before.---I add starting with a ~\relax~ which is so often +% recommended---without understanding this really. At least, +% it will not harm.---Former group braces appear as +% ~\begingroup~/~\endgroup~ here. + +\def\themodulolinenumber{\relax + \ifnum\c@linenumber<\c@firstlinenumber \else + \begingroup + \@tempcnta\c@linenumber + \advance\@tempcnta-\c@firstlinenumber + \divide\@tempcnta\c@linenumbermodulo + \multiply\@tempcnta\c@linenumbermodulo + \advance\@tempcnta\c@firstlinenumber + \ifnum\@tempcnta=\c@linenumber \thelinenumber \fi + \endgroup + \fi +} + +% (/New v4.00) +% +% The user command to set the modulo counter: +% (New v4.31) \dots\ a star variant is introduced to implement +% Hillel Chayim Yisraeli's idea to print the first line number +% after an interruption of the edited text by some editor's +% text, regardless of the modulo. If it is 1, it is printed only +% with ~\firstlinenumber{1}~. I.e., you use ~\modulolinenumbers*~ +% for the new feature, without the star you get the simpler +% behaviour that we have had so far. And you can switch back +% from the refined behaviour to the simple one by using +% ~\modulolinenumbers~ without the star.---This enhancement +% is accompanied by a new package option ~modulo*~ which just +% executes ~\modulolinenumbers*~ +% (subsection_\ref{ss:v3opts}).---`With ~\firstlinenumber{1}~' +% exactly means: `1' is printed if and only if the last +% ~\firstlinenumber~ before or in the paragraph that follows +% the ``interruption'' has argument `1' (or something +% \emph{expanding} to `1', or (to) something that \TeX\ +% ``reads'' as 1, e.g.: a \TeX\ count register storing +% 1).---At present, this behaviour may be unsatisfactory with +% pagewise line-numbering $\dots$ I'll make an experimental +% extra package if someone complains \dots + +\newcommand\modulolinenumbers{% + \@ifstar + {\def\@LN@maybe@moduloresume{% + \global\let\@LN@maybe@normalLineNumber + \@LN@normalLineNumber}% + \@LN@modulolinenos}% + {\let\@LN@maybe@moduloresume\relax \@LN@modulolinenos}% +} + +\global\let\@LN@maybe@normalLineNumber\relax +\let\@LN@maybe@moduloresume\relax +\gdef\@LN@normalLineNumber{% + \ifnum\c@linenumber=\c@firstlinenumber \else + \ifnum\c@linenumber>\@ne + \def\LineNumber{\thelinenumber}% + \fi + \fi +%% +% ~\def~ instead of ~\let~ enables taking account of a +% redefinition of ~\thelinenumber~ in a present numbering +% environment (e.g.). +%% + \global\let\@LN@maybe@normalLineNumber\relax} + +% Instead of changing ~\LineNumber~ directly by +% ~LN@moduloresume~, these tricks enable ~\modulolinenumbers*~ +% to act as locally as I can make it. I don't know how to +% avoid that the output routine switches back to the normal +% modulo behaviour by a global change. (An ~\aftergroup~ may +% fail in admittedly improbable cases.) + +\newcommand*\@LN@modulolinenos[1][\z@]{% +%% +% The definition of this macro is that of the former +% ~\modulolinenumbers~. (/New v4.31) +%% + \let\LineNumber\themodulolinenumber + \ifnum#1>\@ne + \chardef % v4.22, note below + \c@linenumbermodulo#1\relax + \else\ifnum#1=\@ne +% \begin{old}\begin{verbatim} +% % \def\LineNumber{\thelinenumber}% +% \end{verbatim} +% \end{old} +% (New v4.00) I am putting something here to enable +% ~\firstlinenumber~ with $~\c@linenumbermodulo~=1$. +% With ~lnopatch.sty~, a trick was offered for this purpose. +% It is now obsolete. +% + \def\LineNumber{\@LN@ifgreat\thelinenumber}% +%% +% (/New v4.00) +%% + \fi\fi + } + +% (New v4.00) The default of ~\@LN@ifgreat~ is + +\let\@LN@ifgreat\relax + +% The previous changes as soon as ~\firstlinenumber~ is used: + +\newcommand*\firstlinenumber[1]{% + \chardef\c@firstlinenumber#1\relax +%% +% No counter, little values allowed only---OK?---(UL) +% The change is local---OK? The good thing is that +% ~\global\firstlinenumber{~~}~ works. Moreover, +% ~\modulolinenumbers~ acts locally as well. (/UL) +% +% (New v4.31) +%% + \let\@LN@ifgreat\@LN@ifgreat@critical} + +\def\@LN@ifgreat@critical{% + \ifnum\c@linenumber<\c@firstlinenumber + \expandafter \@gobble + \fi}% + +% (/New v4.31) +% +% The default +% value of ~\c@firstlinenumber~ %% v4.31 +% is 0. This is best for what one would expect from modulo +% printing. + +\let\c@firstlinenumber=\z@ + +% +% For usage and effects of ~\modulolinenumbers~ and %% v4.31 +% ~\firstlinenumbers~, please consult section_\ref{s:UserCmds}. +% Two details on ~\firstlinenumbers~ here: +% (i)_~\firstlinenumber~ acts on a paragraph if and only if +% (a)_the paragraph is broken into lines ``in line-numbering +% mode'' (after ~\linenumbers~, e.g.); +% (b)_it is the last occurrence of a ~\firstlinenumbers~ +% before or in the paragraph. +% (The practical applications of this that I can imagine +% don't seem appealing to me.) +% Cf._the explanation above of how ~\modulolinenumbers~ and +% ~\firstlinenumbers~ interact---for this and for (ii), +% which is concerned with possible arguments for +% ~\firstlinenumbers~. +% +% Note that the line numbers of the present section +% demonstrate the two devices. (/New v4.00) + +%%\setcounter{linenumbermodulo}{5} +\chardef\c@linenumbermodulo=5 % v4.2; ugly? +\modulolinenumbers[1] + +% (New v4.22) The new implementation through ~\chardef~ +% decreases the functionality and raises certain compatibility +% problems. I face this without fear. The maximum modulo value +% is now ~255~. I expect that this suffices for usual applications. +% However, some users have ``abused'' ~lineno.sty~ to get +% ~ednotes.sty~ features without line numbers, so have set the +% modulo to a value beyond the total number of lines in their +% edition. This ought to be replaced by +% ~\let\makeLineNumber\relax~. (/New v4.22) +% +% \section{% +% Package options +% \unskip}\label{s:Opts} +% +% (New v4.1) +% The last heading formerly was the heading of what is now +% subsection_\ref{ss:v3opts}. The options declared there were +% said to execute user commands only. This was wrong already +% concerning ~displaymath~ and ~hyperref~. At least, however, +% these options were no or almost no occasion to skip definitions +% or allocations. This is different with the options that we now +% insert. +% +%% (New v4.2) v4.00 moved the ``options'' below the +%% ``extensions''. This was bad with ~\do@mlineno~ in +%% subsection_\ref{ss:v3opts} which is to control +%% subsection_\ref{ss:display}---undone here. (/New v4.2) +% +% \subsection{% +% Extended referencing to line numbers. (v4.2) +% \unskip} +% This subsection explains and declares package option ~addpageno~. %% v4.31 +% +% If a line to whose number you refer by ~\ref~ is not on the +% present page, it may be useful to add the number of the page +% on which the line occurs---and perhaps it should not be added +% otherwise. In general, you could use the Standard \LaTeX\ +% package varioref for this. However, the latter usually +% produces verbose output like `on the preceding page'--- +% unless costumized---, while in critical editions, e.g., one +% may prefer just adding the page number and some mark on the +% left of the line number, irrespectively of how far the page is +% apart etc. To support this, package option ~addpageno~ +% provides a command ~\vpagelineref~ to be used in place of +% ~\ref~. This produces, e.g., `34.15' when referring to line_15 +% on page_34 while the present page is not 34. You can customize +% the outcome, see the package file ~vplref.sty~ where the code +% and further details are. You may conceive of +% ~\vpagelineref~ as a certain customization of varioref's +% ~\vref~. +% +% This implies that option ~addpageno~ requires the files +% ~vplref.sty~ and ~varioref.sty~. ~addpageno~ automatically +% loads both of them. Yet you can also load ~varioref.sty~ +% on your own to use its package options. +% +% Of course, you might better introduce a shorter command name +% for ~\vpagelineref~ for your work, while we cannot predict +% here what shorthand will fit your work. E.g., +% ~\newcommand{\lref}{\vpagelineref}~. +% +% If you really want to add the page number in \emph{any} case, +% use, e.g., some ~\myref~ instead of ~\ref~, after +% \[~newcommand*{\myref}{\pageref{#1}.\ref{#1}}~\] +% or what you like. You don't need the ~addpageno~ option in +% this case. +% +% ~addpageno~ is due to a suggestion by Sergei Mariev. + +\DeclareOption{addpageno}{% + \AtEndOfPackage{\RequirePackage{vplref}[2005/04/25]}} + +% \subsection{% +% \scs{linelabel} in math mode +% \unskip}\label{ss:MathRef} +% +% We have made some first steps towards allowing ~\linelabel~ in +% math mode. Because our code for this is presently experimental, +% we leave it to the user to decide for the experiment by calling +% option ~mathrefs~. We are in a hurry now and thus leave the +% code, explanations, and discussion in the separate package +% ~ednmath0.sty~. Maybe we later find the time to improve the +% code and move the relevant content of ~ednmath0.sty~ to here. +% The optimal situation would be to define ~\linelabel~ from +% the start so it works in math mode, omitting the ~mathrefs~ +% option. +% +% Actually, this package even provides adjustments for analogously +% allowing ~ednotes.sty~ commands in math mode. Loading the package +% is postponed to ~\AtBeginDocument~ when we know whether these +% adjustments are needed. + +\DeclareOption{mathrefs}{\AtBeginDocument + {\RequirePackage{ednmath0}[2004/08/20]}} + +% +% \subsection{% +% Arrays, tabular environments (Revised v4.11) +% \unskip}\label{ss:Tab} +% +% This subsection explains and declares package options %% v4.31 +% ~edtable~, ~longtable~, and ~nolongtablepatch~. +% +% The standard \LaTeX\ tabular environments come as single +% boxes, so the ~lineno.sty~ versions before v4.00 treated them as +% (parts of) single lines, printing (at most) one line number +% beside each and stepping the line number counter once only. +% Moreover, ~\linelabel~s got lost. Of course, tables are +% usually so high that you will want to treat each row like a +% line. (Christian Tapp even desires that the lines of table +% entries belonging to a single row are treated like ordinary +% lines.) Footnotes get lost in such environments as well, which +% was bad for ~ednotes.sty~. +% +% We provide adjustments to count lines, print their numbers +% etc.\ as desired at least for \emph{some} \LaTeX\ tabular +% environments. (Like with other details, ``some'' is to some +% extent explained in ~edtable.sty~.) We do this similarly as +% with option ~mathrefs~ before. We leave code +% and explanations in the separate package ~edtable.sty~. +% (For wizards: this package provides adjustments for +% ~ednotes.sty~ as well. However, in the present case we don't try +% to avoid them unless ~ednotes.sty~ is loaded.) +% Package option ~edtable~ +% defines---by loading ~edtable.sty~---an environment ~{edtable}~ +% which is able to change some \LaTeX\ tabular environments +% with the desired effects. (v4.11: ~edtable.sty~ v1.3 counts +% \LaTeX's ~{array}~ [etc.\@] as a ``tabular environment'' as +% well.) +% +% The ~{edtable}~ environment doesn't help with ~longtable.sty~, +% however. To make up for this, ~{longtable}~ is adjusted in a +% different way---and this happens only when another ~lineno.sty~ +% option ~longtable~ is called. In this case, option ~edtable~ +% needn't be called explicitly: option ~longtable~ works as if +% ~edtable~ had been called. +% +% Now, we are convinced that vertical spacing around +% ~{longtable}~ works wrongly---see \LaTeX\ bugs database +% tools/3180 and 3485, or see explanations in the package +% ~ltabptch.sty~ (which is to be obtained from CTAN folder +% \path{macros/latex/ltabptch}). Our conviction is so strong +% that the ~longtable~ option loads---after ~longtable.sty~---the +% patch package ~ltabptch.sty~. If the user doesn't want this +% (maybe preferring her own arrangement with the vertical +% spacing), she can forbid it by calling ~nolongtablepatch~. +% +% The following code just collects some choices, which are +% then executed in section_\ref{ss:ExOpt}. We use an ~\if...~ +% without ~\newif~ since ~\if...true~ and ~\if...false~ +% would occur at most two times and only within the present +% package. (~\AtEndOfClass{\RequirePackage{edtable}}~ +% could be used instead, I just overlooked this. Now I don't +% change it because it allows to change the version requirement +% at one place only.) + +\let\if@LN@edtable\iffalse + +\DeclareOption{edtable}{\let\if@LN@edtable\iftrue} + +\DeclareOption{longtable}{\let\if@LN@edtable\iftrue + \PassOptionsToPackage{longtable}{edtable}} + +\DeclareOption{nolongtablepatch}{% + \PassOptionsToPackage{nolongtablepatch}{edtable}} + +% (/New v4.1) +% +% \subsection{% +% Switch among settings +% \unskip}\label{ss:v3opts} +% +% There is a bunch of package options that execute %% v4.2 +%% There is a bunch of package options, all of them executing +%% executing only user commands (see below). %% Cf. start of section. +% user commands only. +% +% Options ~left~ (~right~) put the line numbers on the left +% (right) margin. This works in all modes. ~left~ is the +% default. + +\DeclareOption{left}{\leftlinenumbers*} + +\DeclareOption{right}{\rightlinenumbers*} + +% Option ~switch~ (~switch*~) puts the line numbers on the +% outer (inner) margin of the text. This requires running +% the pagewise mode, but we turn off the page offset +% subtraction, getting sort of running numbers again. The +% ~pagewise~ option may restore true pagewise mode later. + +\DeclareOption{switch}{\setpagewiselinenumbers + \switchlinenumbers + \runningpagewiselinenumbers} + +\DeclareOption{switch*}{\setpagewiselinenumbers + \switchlinenumbers*% + \runningpagewiselinenumbers} + +% In twocolumn mode, we can switch the line numbers to +% the outer margin, and/or start with number 1 in each +% column. Margin switching is covered by the ~switch~ +% options. + +\DeclareOption{columnwise}{\setpagewiselinenumbers + \columnwiselinenumberstrue + \realpagewiselinenumbers} + +% The options ~pagewise~ and ~running~ select the major +% linenumber mechanism. ~running~ line numbers refer to a real +% counter value, which can be reset for any paragraph, +% even getting multiple paragraphs on one page starting +% with line number one. ~pagewise~ line numbers get a +% unique hidden number within the document, but with the +% opportunity to establish the page on which they finally +% come to rest. This allows the subtraction of the page +% offset, getting the numbers starting with 1 on top of each +% page, and margin switching in twoside formats becomes +% possible. The default mode is ~running~. +% +% The order of declaration of the options is important here +% ~pagewise~ must come after ~switch~, to overide running +% pagewise mode. ~running~ comes last, to reset the running +% line number mode, e.g, after selecting margin switch mode +% for ~pagewise~ running. Once more, if you specify all +% three of the options ~[switch,pagewise,running]~, the +% result is almost nothing, but if you later say +% ~\pagewiselinenumbers~, you get margin switching, with +% real pagewise line numbers. +% +\DeclareOption{pagewise}{\setpagewiselinenumbers + \realpagewiselinenumbers} + +\DeclareOption{running}{\setrunninglinenumbers} + +% The option ~modulo~ causes only those linenumbers to be +% printed which are multiples of five. + +\DeclareOption{modulo}{\modulolinenumbers\relax} + +% Option ~modulo*~ modifies ~modulo~ in working like +% ~\modulolinenumbers*~---see section_\ref{s:UserCmds}. + +\DeclareOption{modulo*}{\modulolinenumbers*\relax} + +% The package option ~mathlines~ switches the behavior of +% the ~{linenomath}~ environment with its star-form. +% Without this option, the ~{linenomath}~ environment does +% not number the lines of the display, while the star-form +% does. With this option, its just the opposite. +% +%%% 1999-06-10: renamed ~displaymath~ to ~mathlines~. + +\DeclareOption{mathlines}{\linenumberdisplaymath} + +% ~displaymath~ now calls for wrappers of the standard +% \LaTeX\ display math environment. This was previously +% done by ~mlineno.sty~. +% +% (New v4.3) Option `displaymath' becomes default according +% to Erik \mbox{Luijten}'s suggestion. I was finally convinced +% of this as soon as I discovered how to avoid a spurious line +% number above ~\begin{linenomath}~ (subsection_\ref{ss:DM}). +% ~\endlinenomath~ provides ~\ignorespaces~, so what could go +% wrong now? + +\DeclareOption{displaymath}{\PackageWarningNoLine{lineno}{% + Option [displaymath] is obsolete -- default now!}} +%% +%%\let\do@mlineno\relax +%%\DeclareOption{displaymath}{\let\do@mlineno\@empty} +% (/New v4.3) +% +% \subsection{% +% Compatibility with \texttt{hyperref} %% own subsec. v4.3. +% \unskip} +% The ~hyperref~ package, via ~nameref~, requires three more +% groups in the second argment of a ~\newlabel~. Well, why +% shouldn't it get them? (New v3.07) The presence of the +% ~nameref~ package is now detected automatically +% ~\AtBeginDocument~. (/New v3.07) (Fixed in v3.09) We try +% to be smart, and test ~\AtBeginDocument~ if the ~nameref~ +% package is loaded, but ~hyperref~ postpones the loading of +% ~nameref~ too, so this is all in vain. +% +% (New v4.3) But we can also test at the first ~\linelabel~. +% Regarding the error-message for misplaced ~\linelabel~ from v4.11: +% previously, ~\linenumbers~ rendered ~\linelabel~ the genuine +% version of ~\linelabel~ from the start on. This doesn't work +% now, since ~\@LN@linelabel~ may change its meaning after the +% first ~\linenumbers~ and before a next one (if there is some). +% (/New v4.3) + +\DeclareOption{hyperref}{\PackageWarningNoLine{lineno}{% + Option [hyperref] is obsolete. + \MessageBreak The hyperref package is detected automatically.}} + +\AtBeginDocument{% + \@ifpackageloaded{nameref}{% +%% +% (New v4.3) ``Global'' is merely ``symbolic'' ~\AtBeginDoc...~. +% If ~nameref~ is not detected here, the next ~\@LN@linelabel~ +% will do almost the same, then globally indeed. +%% + \gdef\@LN@ExtraLabelItems{{}{}{}}% + }{% + \global\let\@LN@@linelabel\@LN@linelabel + \gdef\@LN@linelabel{% +%% +% ~\@ifpackageloaded~ is ``preamble only'', its---very +% internal---preamble definition is replicated here: +%% + \expandafter + \ifx\csname ver@nameref.sty\endcsname\relax \else + \gdef\@LN@ExtraLabelItems{{}{}{}}% + \fi +%% +% Now aim at the ``usual'' behaviour: +%% + \global\let\@LN@linelabel\@LN@@linelabel + \global\let\@LN@@linelabel\relax + \@LN@linelabel + }% + }% +} + +% (/New v4.3) +% +% (New v4.1) +% \subsection{% +% A note on calling so many options +% \unskip} +% +% The number of package options may stimulate worrying about how to +% \emph{enter} all the options that one would like to use---they may +% not fit into one line. Fortunately, you can safely break code lines +% after the commas separating the option names in the ~\usepackage~ +% command (no comment marks needed). +% +% \subsection{% +% Execute options +% \unskip}\label{ss:ExOpt} +% +% We stop declaring options and execute the ones that are +% called by the user. (/New v4.1) + +\ProcessOptions + +% (New v4.1) Now we know whether ~edtable.sty~ is wanted +% and (if it is) with which options it is to be called. + +\if@LN@edtable \RequirePackage{edtable}[2005/03/07] \fi + +% (/New v4.1) +% +% \section{% +% Former package extensions +% \label{s:Xt}\unskip} +% +% The extensions in this section were previously supplied +% in separate ~.sty~ files. +% +% \subsection{% +% $display math$ +% \unskip}\label{ss:display} +%% (New v4.32) +% (New v4.3) From now on, you no longer need to type +% the ~{linenomath}~ environment with the ~\[~, ~{equation}~, +% and ~{eqnarray}~ environments---and you no longer need to +% use the former package option ~displaymath~ for this feature. +% (/New v4.3) +%% (/New v4.32) +% +% The standard \LaTeX\ display math environments are +% wrapped in a ~{linenomath}~ environment. +% +% (New 3.05) The ~[fleqn]~ option of the standard +% \LaTeX\ classes defines the display math +% environments such that line numbers appear just +% fine. Thus, we need not do any tricks when +% ~[fleqn]~ is loaded, as indicated by presents of +% the ~\mathindent~ register. (/New 3.05) +% +% (New 3.05a) for ~{eqnarray}~s we rather keep the +% old trick. (/New 3.05a) +% +% (New 3.08) Wrap ~\[~ and ~\]~ into ~{linenomath}~, +% instead of ~{displaymath}~. Also save the definition +% of ~\equation~, instead of replicating the current +% \LaTeX\ definition. (/New 3.08) + +%%\ifx\do@mlineno\@empty + \@ifundefined{mathindent}{ + +%% \AtBeginDocument{% + \let\LN@displaymath\[% + \let\LN@enddisplaymath\]% + \renewcommand\[{\begin{linenomath}\LN@displaymath}% + \renewcommand\]{\LN@enddisplaymath\end{linenomath}}% +% + \let\LN@equation\equation + \let\LN@endequation\endequation + \renewenvironment{equation}% + {\linenomath\LN@equation}% + {\LN@endequation\endlinenomath}% +%% } + + }{}% \@ifundefined{mathindent} -- 3rd arg v4.2, was \par! + +%%\AtBeginDocument{% + \let\LN@eqnarray\eqnarray + \let\LN@endeqnarray\endeqnarray + \renewenvironment{eqnarray}% + {\linenomath\LN@eqnarray}% + {\LN@endeqnarray\endlinenomath}% +%%} + +%%\fi + +% (UL) Indeed. The \LaTeX\ macros are saved for +% unnumbered mode, which is detected by ~\linenomath~. +% (/UL) +% +% \subsection{% +% Line numbers in internal vertical mode +% \unskip}\label{ss:ILN} +% +% The command ~\internallinenumbers~ adds line numbers in +% internal vertical mode, but with limitations: we assume +% fixed baseline skip. +% +% (v4.22) v3.10 provided a global (~\global\advance~) +% as well as a local version (star-form, using +% ~\c@internallinenumber~). ~\resetlinenumbers~ acted +% locally and was here used with the global version---save +% stack danger, \TeX book p._301---in v4.00 I +% disabled the global version therefore. Now I find that +% it is better to keep a global version, and the now global +% ~\resetlinenumbers~ is perfect for this. The global version +% allows continuing the ``internal'' numbers in the ensuing +% ``external'' text, and---unless reset by brackets +% argument---continuing the above series of line numbers. +% As with v3.10, the local version always starts with +% line number one. A new ~\@LN@iglobal~ steps ~\global~ly +% in the global version, otherwise it is ~\relax~. +% (I also remove all my stupid discussions as of v4.00. +% And I use ~\newcommand~.) (v4.22) + +\let\@LN@iglobal\global % v4.22 + +\newcommand\internallinenumbers{\setrunninglinenumbers + \let\@@par\internallinenumberpar + \ifx\@par\@@@par\let\@par\internallinenumberpar\fi + \ifx\par\@@@par\let\par\internallinenumberpar\fi + \ifx\@par\linenumberpar\let\@par\internallinenumberpar\fi + \ifx\par\linenumberpar\let\par\internallinenumberpar\fi + \@ifnextchar[{\resetlinenumber}%] + {\@ifstar{\let\c@linenumber\c@internallinenumber + \let\@LN@iglobal\relax % v4.22 + \c@linenumber\@ne}{}}% + } + +\let\endinternallinenumbers\endlinenumbers +\@namedef{internallinenumbers*}{\internallinenumbers*} +\expandafter\let\csname endinternallinenumbers*\endcsname\endlinenumbers + +\newcount\c@internallinenumber +\newcount\c@internallinenumbers + +\newcommand\internallinenumberpar{% + \ifvmode\@@@par\else\ifinner\@@@par\else\@@@par + \begingroup + \c@internallinenumbers\prevgraf + \setbox\@tempboxa\hbox{\vbox{\makeinternalLinenumbers}}% + \dp\@tempboxa\prevdepth + \ht\@tempboxa\z@ + \nobreak\vskip-\prevdepth + \nointerlineskip\box\@tempboxa + \endgroup + \fi\fi + } + +\newcommand\makeinternalLinenumbers{% + \ifnum\c@internallinenumbers>\z@ % v4.2 + \hb@xt@\z@{\makeLineNumber}% + \@LN@iglobal % v4.22 + \advance\c@linenumber\@ne + \advance\c@internallinenumbers\m@ne + \expandafter\makeinternalLinenumbers\fi + } + % TODO v4.4+: star: line numbers right!? cf. lnocapt.sty + +% +% \subsection{% +% Line number references with offset +% \unskip} +% +% This extension defines macros to refer to line +% numbers with an offset, e.g., to refer to a line +% which cannot be labeled directly (display math). +% This was formerly knows as ~rlineno.sty~. +% +% To refer to a pagewise line number with offset: +% \begin{quote} +% ~\linerefp[~~]{~