diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-23 22:16:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-23 22:16:55 +0000 |
commit | 1ea90739d1ab4cbc99996063321d8d94f05a7ab9 (patch) | |
tree | 32ef868faa4105a380184105a771b0dfbd6265ec | |
parent | 2f29eaac5f1a5540c3e514e0f6b828ec29d56caa (diff) |
autonum (21apr13)
git-svn-id: svn://tug.org/texlive/trunk@30081 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/autonum/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/autonum/autonum.pdf | bin | 268974 -> 270863 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/autonum/test-autonum.pdf | bin | 72140 -> 87833 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/autonum/test-autonum.tex | 159 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/autonum/autonum.dtx | 80 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/autonum/autonum.ins | 242 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/autonum/autonum.sty | 13 |
7 files changed, 230 insertions, 266 deletions
diff --git a/Master/texmf-dist/doc/latex/autonum/README b/Master/texmf-dist/doc/latex/autonum/README index 661eabefde9..207e6926927 100644 --- a/Master/texmf-dist/doc/latex/autonum/README +++ b/Master/texmf-dist/doc/latex/autonum/README @@ -13,4 +13,4 @@ introducing the bug to overwrite long equations with the equation number. Usage: \usepackage{autonum} Everything else should happen automatically. -To use autonum together with other packages, load autonum last.
\ No newline at end of file +To use autonum together with other packages, load autonum last. diff --git a/Master/texmf-dist/doc/latex/autonum/autonum.pdf b/Master/texmf-dist/doc/latex/autonum/autonum.pdf Binary files differindex d55c0bf5a61..9c2e211c02a 100644 --- a/Master/texmf-dist/doc/latex/autonum/autonum.pdf +++ b/Master/texmf-dist/doc/latex/autonum/autonum.pdf diff --git a/Master/texmf-dist/doc/latex/autonum/test-autonum.pdf b/Master/texmf-dist/doc/latex/autonum/test-autonum.pdf Binary files differindex 213b1a0e80c..11c8f038e82 100644 --- a/Master/texmf-dist/doc/latex/autonum/test-autonum.pdf +++ b/Master/texmf-dist/doc/latex/autonum/test-autonum.pdf diff --git a/Master/texmf-dist/doc/latex/autonum/test-autonum.tex b/Master/texmf-dist/doc/latex/autonum/test-autonum.tex new file mode 100644 index 00000000000..f5c0797fa73 --- /dev/null +++ b/Master/texmf-dist/doc/latex/autonum/test-autonum.tex @@ -0,0 +1,159 @@ +\documentclass{article} + +\usepackage{amsmath} +\usepackage[hypertexnames=false]{hyperref} +\usepackage{cleveref} +\usepackage{autonum} + +\newcounter{Hequation} +\renewcommand{\theHequation}{\thechapter.\arabic{Hequation}} +\makeatletter +\g@addto@macro\equation{\stepcounter{Hequation}} +\makeatother + +\begin{document} + +% \tracingall +% \makeatletter +% \show\equation +% \show\autonum@equationOld +% \show\mathdisplay +% \show\mathdisplay@pop + +% \begin{equation}\label{dd}a\end{equation}%\ref{dd} +% % \stop +% \begin{equation}\label{ee}b\end{equation} + \section*{Tests} + \begin{itemize} + \item Having a referenced equation with reference before \ref{referenceBefore} + \begin{equation}\label{referenceBefore} + d - d = 0 + \end{equation} + \begin{equation}\label{referenceNo} + d - d = 0 + \end{equation} + \ref{b}\begin{equation}\label{a}a\end{equation}\begin{equation}\label{b}b\end{equation} + \item Having a referenced equation with reference after + \begin{equation}\label{referenceAfter} + c^2 = c c + \end{equation} + \ref{referenceAfter} + \item Having an unlabeled equation + \begin{equation}\label{abc} + a^2 + b^2 = c^2 + \end{equation} + \item Having a labeled, but unreferenced equation + \begin{equation}\label{unreferenced} + \sqrt{a} + \end{equation} + \item Having a labeled equation with a very strange label \ref{äöüÄÖÜß?:, 3075µ!/§} + \begin{equation}\label{äöüÄÖÜß?:, 3075µ!/§} + \sqrt{b} + \end{equation} + \item Check for spurious whitespace around reference (\ref{checkWhitespace}) + \begin{equation}\label{checkWhitespace} + b_c + \end{equation} + \item Placing the number in long equations \ref{long} + \begin{equation}\label{long} + \sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum\sum a + \end{equation} + \item Printing the number without referencing + \begin{equation+} + E = mgh + \end{equation+} + \item Using a ref inside a caption + \begin{figure} + ref + \caption{\ref{long}} + \end{figure} + \item Using a cref inside a caption + \begin{figure} + cref + \caption{\cref{long}} + \end{figure} + \item Using cref with one argument + \begin{equation}\label{crefOne} + g + \end{equation} + \cref{crefOne} + \item Using cref with two arguments + \begin{equation}\label{crefTwo} + cr = ef + \end{equation} + \cref{crefOne,crefTwo} + \item Using otherwise unused cref with two arguments + \[\label{crefThree} + cr = ef + \] + \[\label{crefFour} + cr = ef + \] + \cref{crefThree,crefFour} + \item Using align \ref{alignOne}, \ref{alignThree} + \begin{align} + a\label{alignOne}\\ + b\label{alignTwo}\\ + c\label{alignThree} + \end{align} + \item Using gather \ref{gatherOne}, \ref{gatherThree} + \begin{gather} + a\label{gatherOne}\\ + b\label{gatherTwo}\\ + c\label{gatherThree} + \end{gather} + \item Using multline without referencing + \begin{multline} + a\\ + c\label{multlineUnreferenced} + \end{multline} + \item Using multline with referencing \ref{multlineReferenced} + \begin{multline} + a\\ + c\label{multlineReferenced} + \end{multline} + \item Using flalign with referencing \ref{flalignReferenced} + \begin{flalign} + a\\ + c\label{flalignReferenced} + \end{flalign} + \item Using alignat with referencing \ref{alignatReferenced} + \begin{alignat}{4} + x &= yy & \implies & y &= x \label{alignatUnreferenced}\\ + y &= z & \implies & z &= y \label{alignatReferenced} + \end{alignat} + \item short one-line shortcut \[n\] +% \item shortcut environment with two lines, referencing \ref{firstShortcut} \[n_1\label{firstShortcut} \\ n_2\] + \item align, numbering always \begin{align+} a=l \end{align+} + \item gather, numbering always \begin{gather+} g=a \end{gather+} + \item multline, numbering always (and avoiding overfull hbox warning) \begin{multline+} m=u\line(1,0){220}=v \end{multline+} + \item equation, numbering always \begin{equation+} e=q \end{equation+} + \item shortcut and split \ref{split} \[ \label{split}\begin{split} s \\ p \end{split} \] + \item equation and split \ref{splitEquation} \begin{equation} \label{splitEquation}\begin{split} s \\ p \end{split} \end{equation} +% \item super-short \[\(a+b\\d+e\)\] +% \item Using aligned \ref{alignedOne}, \ref{alignedThree} +% \begin{equation} +% \begin{aligned} +% a\label{alignedOne}\\ +% b\label{alignedTwo}\\ +% c\label{alignedThree} +% \end{aligned} +% \end{equation} +% \item Using gathered \ref{gatheredOne}, \ref{gatheredThree} +% \begin{equation} +% \begin{gathered} +% a\label{gatheredOne}\\ +% b\label{gatheredTwo}\\ +% c\label{gatheredThree} +% \end{gathered} +% \end{equation} + \end{itemize} + \section{Using ref in section \ref{i1}}\label{i1} text + \section{Using cref in \cref{i2}}\label{i2} text + \begin{figure} + \caption{Ref 2: \cref{i2} and \ref{i2}} + \end{figure} +\tableofcontents +\listoffigures +\end{document} + diff --git a/Master/texmf-dist/source/latex/autonum/autonum.dtx b/Master/texmf-dist/source/latex/autonum/autonum.dtx index 3474232cd0a..6bde0a0669b 100644 --- a/Master/texmf-dist/source/latex/autonum/autonum.dtx +++ b/Master/texmf-dist/source/latex/autonum/autonum.dtx @@ -21,7 +21,6 @@ Usage: \usepackage{autonum} Everything else should happen automatically. To use autonum together with other packages, load autonum last. %</readme> -%<readme>\endbatchfile %<*internal> \fi \def\nameofplainTeX{plain} @@ -86,7 +85,7 @@ and the derived files autonum.ins, %</internal> %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{autonum}[2012/09/03 v0.3.2 autonum LaTeX package] +\ProvidesPackage{autonum}[2013/04/20 v0.3.3 autonum LaTeX package] \PassOptionsToPackage{hypertexnames=false}{hyperref} \RequirePackage{etoolbox} \RequirePackage{amsmath} @@ -94,11 +93,11 @@ and the derived files autonum.ins, %</package> %<*driver> \documentclass{ltxdoc} +% \documentclass{ydoc} \usepackage[utf8]{inputenx} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{amsmath} -\usepackage{\jobname} \usepackage[numbered]{hypdoc} \usepackage{autonum}% \hypersetup{pdftitle=The autonum package} @@ -130,11 +129,12 @@ and the derived files autonum.ins, %\changes{v0.3}{2012/08/16}{Support alignat and flalign environments. Fix handling of special characters in label names. Fix handling of multiple label names in \cmd{\cref} command.} %\changes{v0.3.1}{2012/08/25}{Fix of leading whitespace in references. Fix of underfull hbox.} %\changes{v0.3.2}{2012/09/03}{Fix using reference inside caption.} +%\changes{v0.3.3}{2013/04/20}{Fix using cleveref inside section.} % % \section{Introduction} % With \LaTeX, the user has to decide manually to not number an equation by adding a star in the math environment. Authors who do not want to think about the numbering during the writing (and maybe they should not), often use the environments without stars. As default, these users get all equations numbered, although there are \href{http://tex.stackexchange.com/q/29267/7323}{different opinions} about what should be numbered. % -% The other automatic possibility one can think of is to number only the referenced equations. The \href{http://www.ctan.org/tex-archive/macros/latex/contrib/mh/}{mathtools} package's option \texttt{showonlyrefs} seems to be the solution for those who want to have the referenced equations numbered only. Unfortunately for \href{http://www.ctan.org/pkg/amsmath}{amsmath} users this also means a step backwards, as the numbering can overwrite parts of the equation according to its documentation. Generally, this options seems to be quite unreliable as it is incompatible with the \href{http://www.ctan.org/tex-archive/macros/latex/contrib/cleveref/}{cleveref} package. The autonum package implements the numbering of referenced equations only without this deficiencies. +% The other automatic possibility one can think of is to number only the referenced equations. The \href{http://www.ctan.org/tex-archive/macros/latex/contrib/mh/}{mathtools} package's option \texttt{showonlyrefs} seems to be the solution for those who want to have the referenced equations numbered only. Unfortunately, for \href{http://www.ctan.org/pkg/amsmath}{amsmath} users this also means a step backwards, as the numbering can overwrite parts of the equation according to its documentation. Generally, this options seems to be quite unreliable as it is incompatible with the \href{http://www.ctan.org/tex-archive/macros/latex/contrib/cleveref/}{cleveref} package. The autonum package implements the numbering of referenced equations only without this deficiencies. %^^A This currently does not work with cleveref, as equations without a number increment the equation counter, too. As placing the labels does not always work correctly, \cmd{\mathtoolsset{showonlyrefs}} is not an option (see mathtools documentation, bottom of page 10). % % \section{Usage and Examples} @@ -174,10 +174,10 @@ and the derived files autonum.ins, % \cmd{\usepackage\{autonum\}}\\ % \cmd{\begin\{document\}}\\ % \indent\cmd{\begin\{equation\}}\cmd{\label\{a\}}\\ -% \indent\indent a\\ +% \indent\indent \texttt{a}\\ % \indent\cmd{\end\{equation\}}\\ % \indent\cmd{\begin\{equation\}}\cmd{\label\{b\}}\\ -% \indent\indent b\\ +% \indent\indent \texttt{b}\\ % \indent\cmd{\end\{equation\}}\\ % \indent\cmd{\ref\{a\}}\\ % \cmd{\end\{document\}} @@ -210,23 +210,42 @@ and the derived files autonum.ins, % % \subsection{Reference commands} % As default the \cmd{\ref} and cleveref's \cmd{\cref} commands are supported. Support for new reference commands can be added by executing\\ -% \cmd{\let}\cmd{\ref}\cmd{\NewReferenceCommand}.\\ +% \cmd{\let}\cmd{\ref}\cmd{\NewReferenceCommand}. +% +% If you want to use the power of \cmd{\cref} without getting rid of the habit of writing \cmd{\ref}, you can just use add the following code to the preamble +% +% \vspace{0.5em} +% \noindent\cmd{\AfterEndPreamble\{\%}\\ +% \indent\cmd{\let}\cmd{\ref}\cmd{\cref}\\ +% \texttt{\}\%} +% \vspace{0.5em} +% +% If you also strive for maximum consistency and want to avoid accidently writing \cmd{\cref} or \cmd{\autoref}, you can instead add the following lines +% +% \vspace{0.5em} +% \noindent\cmd{\AfterEndPreamble\{\%}\\ +% \indent\cmd{\let}\cmd{\ref}\cmd{\cref}\\ +% \indent\cmd{\undef\{}\cmd{\cref\}\%}\\ +% \indent\cmd{\undef\{}\cmd{\autoref\}\%}\\ +% \texttt{\}\%} +% \vspace{0.5em} +% % If the original \cmd{\ref} command should not be overwritten, you have the following choices. Please mind that these interfaces might change in the future. Please also mind the \cmd{\makeatletter} and \cmd{\makeatother} command before and after the commands, respectively. % %\begin{macro}{\autonum@generatePatchedReference} -% For normal reference commands expecting a single label name as an argument, you can use \cmd{\autonum@generatePatchedReference}\{\cmd{\NewReferenceCommand}\}. +% For normal reference commands expecting a single label name as an argument, you can use \cmd{\autonum@generatePatchedReference}\{\texttt{NewReferenceCommand}\}. %\end{macro} % %\begin{macro}{\autonum@generatePatchedReferenceCSL} % For reference commands expecting a comma separated list of label names as an argument, you can use\\ -% \cmd{\autonum@generatePatchedReferenceCSL}\{\cmd{\NewReferenceCommand}\}. +% \cmd{\autonum@generatePatchedReferenceCSL}\{\texttt{NewReferenceCommand}\}. %\end{macro} % %\begin{macro}{\autonum@generatePatchedReferenceGeneral} % For reference commands expecting a general data structure containing label names as an argument, you can use\\ -% \cmd{\autonum@generatePatchedReferenceGeneral}\{\cmd{\NewReferenceCommand}\}\\ +% \cmd{\autonum@generatePatchedReferenceGeneral}\{\texttt{NewReferenceCommand}\}\\ % \{\cmd{\SplitAndLoopMacro}\}.\\ -% The macro \cmd{\SplitAndLoopMacro} acts as a function expecting the to-be-called function as the first argument and the data structure as the second argument. It must call the function given in the first argument for each label name given in the data structure of the second argument. An example is the \cmd{\forcsvlist} macro from the etoolbox package, which is used to implement \cmd{\autonum@generatePatchedReferenceCSL}. +% The macro \cmd{\SplitAndLoopMacro} acts as a function expecting the to-be-called function as the first argument and the data structure as the second argument. It must call the function given in the first argument for each label name given in the data structure of the second argument. An example is the \cmd{\forcsvlist} macro from the etoolbox package, which is used to implement \cmd{\autonum@generatePatchedReferenceCSL}. Commands like the \cmd{\crefrange} command are not supported at the moment. %\end{macro} % % \section{Further Ideas} @@ -235,7 +254,7 @@ and the derived files autonum.ins, % \item A warning could be printed, if another compile is necessary. % \item A "*" could be used instead of a "+". % \item If a reference is used before the label is defined, the reference information is saved in a variable and can be used later in the current run when processing the label. It does not have to be saved to the aux file. If a reference is used after defining the label, the reference information is saved in the aux file and can be used in the next run when processing the label. The information does not have to be saved into a variable, as a label must only be defined once and the definition has already happened. Unfortunately, this would make it necessary to distinguish between definitions in the current and in the last run, as otherwise this leads either to oscillation or to defining everything in the end (depending if csdefaux or csdefall is used in the not-defined case), which is probably not worth the effort. -% \item The command \cmd{\(} could be an alias for \texttt{begin\{split\}} and \cmd{\)} could be an alias for \texttt{end\{split\}} +% \item The command \cmd{\(} could be an alias for \texttt{begin\{split\}} and \cmd{\)} could be an alias for \texttt{end\{split\}}, not, that this collied with the \href{http://tex.stackexchange.com/questions/510/are-and-preferable-to}{LaTeX math inline syntax} % \item This \href{http://tex.stackexchange.com/a/5652}{trick} might be handy % \item The \cmd{\crefrange} might be supported. As this would require a lot of work it will only be done if multiple people show interest and there are really convincing real-world examples where using \cmd{\crefrange} is superior to using \cmd{\cref}. Patches are, of course, welcome, too. % \end{itemize} @@ -279,7 +298,11 @@ and the derived files autonum.ins, % \end{itemize} % \item Ulrike Fischer % \begin{itemize} -% \item found that a \cmd{\protect} is missing to use \cmd{\ref} inside a \cmd{\caption}, which lead to its addition. +% \item found that a \cmd{\protect} is missing to use \cmd{\ref} inside a \cmd{\caption}, which lead to its addition +% \end{itemize} +% \item Johannes Gerer +% \begin{itemize} +% \item found a bug when using \cmd{\cref} inside the \cmd{\section} command when hyperref is loaded which lead to its fix % \end{itemize} % \end{itemize} % @@ -288,7 +311,11 @@ and the derived files autonum.ins, % The basic idea is to write into the aux file and save a variable whenever a label is referenced, so that the information is available in the current and in the next run. The label information is passed from the label command to the newline command. The newline command uses the label and the reference information to possibly add a \cmd{\notag} command, deciding if it is referenced or not. % % ^^A Calling the old newline command leads to a redefinition (overwriting, not patching) of the (current) newline command (proved by using \cmd{\show}\cmd{\\} before and after the call to amsmath's newline command) when using local definitions. As amsmath behaves like a virus then, the patched newline function is only called for the first newline. After the first call, amsmath's hijacked newline is used directly without giving a chance to do something useful. To correct this behavior, the newline command would need to be patched again. Unfortunately, \cmd{\let} cannot be used to save the current command, because the copy generated by \cmd{\let} is deleted by amsmath (WTF?). To avoid all this, some global definitions are used. - +% +% \iffalse +%<*package> +% \fi +% %\begin{macro}{\csxdefaux} % This command is similar to the \cmd{\csxdef} command from the package etoolbox, but instead of defining the command immediately, it is defined in the next run by writing it to the aux file. The name is given by the first argument (which may not have a leading backslash). The second argument is the replacement text. This command would be a candidate for inclusion into etoolbox. \cmd{\ifcsdef} can be used to check, if the command has been defined. See also http://tex.stackexchange.com/a/49035 % Usage: \cmd{\csxdefaux\{csname\}\{replacement\}} @@ -614,12 +641,21 @@ and the derived files autonum.ins, % \begin{macrocode} \def\autonum@generatePatchedReferenceGeneral#1#2{% \csletcs{autonum@reference#1Old}{#1}% - \csdef{#1}##1{% - \csuse{#2}{\protect\autonum@markLabelAsReferenced}{##1}% % \end{macrocode} - % Call the old reference command. + % Mark label as referenced and call the old reference command. If hyperref is loaded (i.e. \cmd{\texorpdfstring} is defined), take care to not write in the pdf string, as this would lead to a write inside of a write when, e.g., calling \cmd{\cref} inside of a section command. % \begin{macrocode} - \csuse{autonum@reference#1Old}{##1}% + \ifdef{\texorpdfstring}{% + \csdef{#1}##1{% + \texorpdfstring{% + \csuse{#2}{\protect\autonum@markLabelAsReferenced}{##1}% + }{}% + \csuse{autonum@reference#1Old}{##1}% + }% + }{% + \csdef{#1}##1{% + \csuse{#2}{\protect\autonum@markLabelAsReferenced}{##1}% + \csuse{autonum@reference#1Old}{##1}% + }% }% } % \end{macrocode} @@ -751,10 +787,14 @@ and the derived files autonum.ins, } % \end{macrocode} %\end{macro} - +% +% \iffalse +%</package> +% \fi +% %\StopEventually{^^A % \PrintChanges %^^A \PrintIndex %} % -%\Finale
\ No newline at end of file +%\Finale diff --git a/Master/texmf-dist/source/latex/autonum/autonum.ins b/Master/texmf-dist/source/latex/autonum/autonum.ins index a3f10221438..d90907ba0e0 100644 --- a/Master/texmf-dist/source/latex/autonum/autonum.ins +++ b/Master/texmf-dist/source/latex/autonum/autonum.ins @@ -49,248 +49,6 @@ and the derived files autonum.ins, \file{autonum.sty}{\from{autonum.dtx}{package}} } \endbatchfile - -\def\csxdefaux#1#2{% -\protected@write\@mainaux{}{% -\csxdef{\detokenize{#1}}{#2}% -}% -} - -\def\csxdefall#1#2{% -\csxdefaux{#1}{#2}% -\csxdef{#1}{#2}% -} - -\def\ifcsedef#1#2#3{% -\edef\autonum@ifcsedefTemp{#1}% -\expandafter\ifcsdef\expandafter{\autonum@ifcsedefTemp}{#2}{#3}% -\undef{\autonum@ifcsedefTemp}% -} - -\AtBeginDocument{% -\newlength{\autonum@environmentWidth}% -\forcsvlist{\autonum@patchParametrizedFullEnvironment}{alignat}% -\forcsvlist{\autonum@patchFullEnvironment}{equation,gather,multline,flalign,align}% -\def\[#1\]{% -\begin{equation}#1\end{equation}% -}% -\autonum@generatePatchedReference{ref}% -\ifdef{\cref}{% -\autonum@generatePatchedReferenceCSL{cref}% -}{}% -} - -\def\autonum@patchFullEnvironment#1{% -\autonum@saveEnvironmentSubcommands{#1}{center}{}% -\autonum@patchEnvironmentHelper{#1}{0}% -} -\def\autonum@patchParametrizedFullEnvironment#1{% -\autonum@saveEnvironmentSubcommands{#1}{center}{1}% -\autonum@patchEnvironmentHelper{#1}{1}% -} -\def\autonum@patchBlockEnvironment#1{% -\autonum@saveEnvironmentSubcommands{#1}{equation*}{}% -\autonum@patchEnvironmentHelper{#1}{0}% -} -\def\autonum@patchEnvironmentHelper#1#2{% -\autonum@renameEnvironment{#1}{#2}% -\autonum@changeEnvironment{#1}{#2}% -\autonum@generatePatchedLabel{#1}% -\autonum@generatePatchedNewline{#1}% -} - -\def\autonum@saveEnvironmentSubcommands#1#2#3{% -\begin{textblock}{1}[1,1](0,0)% -\begin{#2}% -\begin{#1}#3% -\deflength{\autonum@environmentWidth}{\linewidth-\multlinegap-\multlinegap}% -\hspace{\autonum@environmentWidth}% -\global\cslet{autonum@newline#1}\\% -\notag% -\ifboolexpr{not test {\ifstrequal{#1}{multline}} or test {\ifcsundef{autonum@label#1}}}{% -\global\cslet{autonum@label#1}{\label}% -}% -\notag% -\end{#1}% -\end{#2}% -\end{textblock}% -} - -\def\autonum@renameEnvironment#1#2{% -\csletcs{autonum@#1Old}{#1}% -\csletcs{autonum@end#1Old}{end#1}% -\newenvironment{#1+}[#2]{% -\csuse{autonum@#1Old}% -}{% -\csuse{autonum@end#1Old}% -}% -} - -\def\autonum@changeEnvironment#1#2{% -\ifnum #2=0% -\renewenvironment{#1}{% -\autonum@startChangeEnvironment{#1}{}% -}{% -\autonum@endChangeEnvironment{#1}% -}% -\else -\renewenvironment{#1}[1]{% -\autonum@startChangeEnvironment{#1}{##1}% -}{% -\autonum@endChangeEnvironment{#1}% -}% -\fi -\global\csundef{#1*}% -\global\csundef{end#1*}% -} - -\def\autonum@startChangeEnvironment#1#2{% -\autonum@saveSubcommands -\csuse{autonum@#1Old}#2% -\autonum@patchSubcommands{#1}% -} - -\def\autonum@endChangeEnvironment#1{% -\autonum@possiblyHideNumber -\csuse{autonum@end#1Old}% -\autonum@restoreSubcommands -} - -\def\autonum@saveSubcommands{% -\let\autonum@labelNormal\label% -\let\autonum@newlineNormal\\% -} - -\def\autonum@patchSubcommands#1{% -\global\letcs{\label}{autonum@patched#1Label}% -\ifstrequal{#1}{multline}{% -}{% - \global\letcs{\\}{autonum@patched#1Newline}% -}% -} - -\def\autonum@restoreSubcommands{% -\global\let\label\autonum@labelNormal% -\global\let\\\autonum@newlineNormal% -} - -\def\autonum@generatePatchedLabel#1{% -\csdef{autonum@patched#1Label}##1{% -\ifdef{\autonum@currentLabel}{% -\PackageError{autonum}{Two succeeding \string\label's detected}{Did you forget a \string\\?}% -}{% -\def\autonum@currentLabel{##1}% -}% -\ifcsedef{autonum@##1Referenced}{% -\let\df@label\@empty% -\csuse{autonum@label#1}{##1}% -}{} -}% -} - -\def\autonum@generatePatchedNewline#1{% -\csdef{autonum@patched#1Newline}{% -\autonum@possiblyHideNumber -\csuse{autonum@newline#1}% -} -} - -\def\autonum@possiblyHideNumber{ -\ifdef{\autonum@currentLabel}{% -\ifcsedef{autonum@\csuse{autonum@currentLabel}Referenced}{% -}{% -\notag% -}% -}{% -\notag% -}% -} - -\def\autonum@generatePatchedReference#1{% -\autonum@generatePatchedReferenceGeneral{#1}{autonum@use}% -} - -\def\autonum@generatePatchedReferenceCSL#1{% -\autonum@generatePatchedReferenceGeneral{#1}{forcsvlist}% -} - -\def\autonum@generatePatchedReferenceGeneral#1#2{% -\csletcs{autonum@reference#1Old}{#1}% -\csdef{#1}##1{% -\csuse{#2}{\protect\autonum@markLabelAsReferenced}{##1}% -\csuse{autonum@reference#1Old}{##1}% -}% -} - -\def\autonum@markLabelAsReferenced#1{% -\csxdefall{autonum@#1Referenced}{}% -} - -\def\autonum@use#1#2{% -#1{#2}% -} - -\newcounter{autonum@counter} -\def\autonum@patchShortcutEnvironment{% -\def\[##1\]{% -\ifcsedef{autonum@\Roman{autonum@counter}HasExactlyOneLine}{% -\autonum@useWithMultipleLineDetection{equation}{##1}% -}{% -\autonum@useWithMultipleLineDetection{align}{##1}% -}% -\stepcounter{autonum@counter}% -}% -} - -\def\autonum@useWithMultipleLineDetection#1#2{% -\begin{#1}% -\autonum@patchParentheses -\global\let\autonum@patchedNewline\\% -\ifstrequal{#1}{align}{% -\gdef\\{% -\autonum@patchedNewline -\gdef\autonum@multipleLines{}% -}% -}{% -\gdef\\{% -\gdef\autonum@multipleLines{}% -}% -} -#2% -\global\let\\\autonum@patchedNewline% -\ifdef{\autonum@multipleLines}{% -\global\undef{\autonum@multipleLines}% -}{% -\csxdefaux{autonum@\Roman{autonum@counter}HasExactlyOneLine}{\Roman{autonum@counter}}% -}% -\autonum@restoreParentheses -\end{#1}% -} - -\global\def\autonum@patchParentheses{% -\autonum@patchParenthesis{(}{Left}{}% -\autonum@patchParenthesis{)}{Right}{end}% -} - -\global\def\autonum@patchParenthesis#1#2#3{% -\ifcsdef{#1}{% -\global\csletcs{autonum@old#2Parenthesis}{#1}% -}{}% -\global\csletcs{#1}{#3split}% -} - -\global\def\autonum@restoreParentheses{% -\autonum@restoreParenthesis{(}{Left}% -\autonum@restoreParenthesis{)}{Right}% -} - -\global\def\autonum@restoreParenthesis#1#2{% -\ifcsdef{autonum@old#2Parenthesis}{% -\global\csletcs{#1}{autonum@old#2Parenthesis}% -\global\csundef{autonum@old#2Parenthesis}% -}{}% -} - %% %% Copyright (C) 2012 by Patrick Häcker <pat_h@web.de> %% diff --git a/Master/texmf-dist/tex/latex/autonum/autonum.sty b/Master/texmf-dist/tex/latex/autonum/autonum.sty index d8ef67c4a4e..49a9552d548 100644 --- a/Master/texmf-dist/tex/latex/autonum/autonum.sty +++ b/Master/texmf-dist/tex/latex/autonum/autonum.sty @@ -13,12 +13,11 @@ %% ---------------------------------------------------------------- %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{autonum}[2012/09/03 v0.3.2 autonum LaTeX package] +\ProvidesPackage{autonum}[2013/04/20 v0.3.3 autonum LaTeX package] \PassOptionsToPackage{hypertexnames=false}{hyperref} \RequirePackage{etoolbox} \RequirePackage{amsmath} \RequirePackage[absolute]{textpos} - \def\csxdefaux#1#2{% \protected@write\@mainaux{}{% \csxdef{\detokenize{#1}}{#2}% @@ -185,10 +184,19 @@ \def\autonum@generatePatchedReferenceGeneral#1#2{% \csletcs{autonum@reference#1Old}{#1}% +\ifdef{\texorpdfstring}{% \csdef{#1}##1{% +\texorpdfstring{% \csuse{#2}{\protect\autonum@markLabelAsReferenced}{##1}% +}{}% \csuse{autonum@reference#1Old}{##1}% }% +}{% +\csdef{#1}##1{% +\csuse{#2}{\protect\autonum@markLabelAsReferenced}{##1}% +\csuse{autonum@reference#1Old}{##1}% +}% +}% } \def\autonum@markLabelAsReferenced#1{% @@ -259,7 +267,6 @@ \global\csundef{autonum@old#2Parenthesis}% }{}% } - %% %% Copyright (C) 2012 by Patrick Häcker <pat_h@web.de> %% |