diff options
author | Karl Berry <karl@freefriends.org> | 2021-06-30 22:14:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-06-30 22:14:34 +0000 |
commit | 84db5394f4697c7286f734736d0ca5672fac918c (patch) | |
tree | 321d2502044e56f75796336f535ee228424cf286 /Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht | |
parent | f18baaf545c73262376befaccac7fda005b26975 (diff) |
cleveref fixes, tex4ht r963-964
git-svn-id: svn://tug.org/texlive/trunk@59783 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht')
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht b/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht index 7af226d474a..e9aead433fb 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/cleveref.4ht @@ -1,5 +1,5 @@ -% cleveref.4ht (2019-02-19-15:55), generated from tex4ht-4ht.tex -% Copyright 2018-2019 TeX Users Group +% cleveref.4ht (2021-06-30-14:33), generated from tex4ht-4ht.tex +% Copyright 2018-2021 TeX Users Group % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -16,9 +16,24 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2019-02-19-15:55} +\immediate\write-1{version 2021-06-30-14:33} + +% orig:refstepcounter is saved in cleveref-hooks.4ht +\let\cref@old@refstepcounter\orig:refstepcounter% +\def\refstepcounter{% + \@ifnextchar[{\refstepcounter@optarg}{\refstepcounter@noarg}%] +}% + +% fix for TeX4ht label mechanism +\def\cref:currentlabel#1{\let\cnt:currentlabel\@currentlabel +\def\:@currentlabel{\ifx \cnt:currentlabel\@currentlabel + \expandafter\the\csname c@#1\endcsname\else \@currentlabel\fi}% +% + \anc:lbl r{#1}% +} + \def\refstepcounter@noarg#1{% \cref@old@refstepcounter{#1}% \cref@constructprefix{#1}{\cref@result}% @@ -28,6 +43,7 @@ \protected@xdef\cref@currentlabel{% [\@tempa][\arabic{#1}][\cref@result]% \csname p@#1\endcsname\csname the#1\endcsname} + \cref:currentlabel{#1}% }% \def\refstepcounter@optarg[#1]#2{% \cref@old@refstepcounter{#2}% @@ -35,10 +51,11 @@ \@ifundefined{cref@#1@alias}% {\def\@tempa{#1}}% {\def\@tempa{\csname cref@#1@alias\endcsname}}% - \protected@edef\cref@currentlabel{% + \protected@xdef\cref@currentlabel{% [\@tempa][\arabic{#2}][\cref@result]% - \csname p@#2\endcsname\csname the#2\endcsname}}% -\Hinput{cleveref} + \csname p@#2\endcsname\csname the#2\endcsname} + \cref:currentlabel{#2}% + }% \ifdefined\@firstoffive\else% \def\@firstoffive#1#2#3#4#5{#1} @@ -52,5 +69,21 @@ \HLet\@@@setcref=\:tempa +\@ifpackageloaded{amsthm}{ + \let\cref@thmnoarg\@thm% + \def\@thm{\@ifnextchar[{\cref@thmoptarg}{\cref@thmnoarg}}%] + \def\:tempb[#1]#2#3#4{% + % call original amsthm theorem definition, but + % disable \:thm in order to prevent infinite loop + \let\:thm\:gobble + \cref@thmnoarg{#2}% + \o:cref@thmoptarg:[#1]{#2}{#3}{#4} + }% + \HLet\cref@thmoptarg\:tempb +}{}% + + +\Hinput{cleveref} + \endinput |