From 5fbdde835cedbab62d0fef554d33770b307839a8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 13 Apr 2022 21:22:09 +0000 Subject: \ref* and \Ref support, tex4ht r1109-1110 git-svn-id: svn://tug.org/texlive/trunk@63021 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/generic/tex4ht/ChangeLog | 6 ++++++ .../source/generic/tex4ht/tex4ht-4ht.tex | 24 ++++++++++++++++++---- Master/texmf-dist/tex/generic/tex4ht/latex.4ht | 18 +++++++++++----- Master/texmf-dist/tex/generic/tex4ht/nameref.4ht | 10 ++++----- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog index 8ee941ac8c4..fdef1c98b94 100644 --- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog +++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog @@ -1,3 +1,9 @@ +2022-04-13 Michal Hoftich + + * tex4ht-4ht.tex (latex.4ht): added support for the \Ref command. + * tex4ht-4ht.tex (latex.4ht,nameref.4ht): added support for the + \ref* command. + 2022-04-05 Michal Hoftich * tex4ht-ooffice.tex (ooffice.4ht): added option to produce inline diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex index f12d3182680..86cf26ae1bb 100644 --- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex +++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-4ht.tex 1107 2022-04-04 14:44:55Z karl $ +% $Id: tex4ht-4ht.tex 1110 2022-04-13 14:59:07Z michal_h21 $ % tex tex4ht-4ht or ht tex tex4ht-4ht % % Copyright 2009-2022 TeX Users Group @@ -1492,10 +1492,26 @@ A better def is given to \''\l:bel' in AmsLaTeX . \let\o:ref|=\:ref \def\::ref#1{{\:SUBOff\:SUPOff\xdef\RefArg{#1}}\expandafter\o:ref \expandafter{\RefArg}} -\def\:ref{\Protect\::ref} +\def\:ref{\@ifstar{\Protect\::ref}{\Protect\::ref}} \let\ref|=\:ref >>> + +Support for the \''\Ref' command. It is variant of \''\ref' that uppercases +first letter of the referenced label. + +\<<< +\def\::Ref#1{% + \let\olda:rEfLiNK\rEfLiNK%% + \def\rEfLiNK##1##2{\Link{##1}{}\edef\:ref:currentlabel{##2}\expandafter\MakeUppercase\:ref:currentlabel\EndLink}% + \::ref{#1}% + \let\rEfLiNK\olda:rEfLiNK% +} +\def\:Ref{\@ifstar{\Protect\::Ref}{\Protect\::Ref}} +\let\Ref\:Ref +>>> + + Without the \'''\expandafter' we may get \''\RefArg' passed as the first argument to \''\T@arg', resulting in \''\def\RefArg{\RefArg}'. @@ -3533,12 +3549,12 @@ definitions. } \let\T:ref=\::ref -\def\::ref{\protect\T@ref} +\def\::ref{\@ifstar{\protect\T@ref}{\protect\T@ref}} \def\T@ref#1{% \@safe@activestrue \let\::ref \T:ref \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}% - \def\::ref{\protect\T@ref}% + \def\::ref{\@ifstar{\protect\T@ref}{\protect\T@ref}} \@safe@activesfalse } diff --git a/Master/texmf-dist/tex/generic/tex4ht/latex.4ht b/Master/texmf-dist/tex/generic/tex4ht/latex.4ht index bb81d084856..176b80528cd 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/latex.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/latex.4ht @@ -1,4 +1,4 @@ -% latex.4ht (2022-02-01-14:27), generated from tex4ht-4ht.tex +% latex.4ht (2022-04-13-13:14), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % Copyright 2009-2022 TeX Users Group % @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2022-02-01-14:27} +\immediate\write-1{version 2022-04-13-13:14} \ifx\SaveMkHalignConf:g\:UnDef \else \expandafter\endinput\fi @@ -430,8 +430,16 @@ \let\o:ref\:ref \def\::ref#1{{\:SUBOff\:SUPOff\xdef\RefArg{#1}}\expandafter\o:ref \expandafter{\RefArg}} -\def\:ref{\Protect\::ref} +\def\:ref{\@ifstar{\Protect\::ref}{\Protect\::ref}} \let\ref\:ref +\def\::Ref#1{% + \let\olda:rEfLiNK\rEfLiNK%% + \def\rEfLiNK##1##2{\Link{##1}{}\edef\:ref:currentlabel{##2}\expandafter\MakeUppercase\:ref:currentlabel\EndLink}% + \::ref{#1}% + \let\rEfLiNK\olda:rEfLiNK% +} +\def\:Ref{\@ifstar{\Protect\::Ref}{\Protect\::Ref}} +\let\Ref\:Ref \let\:newl@bel\@newl@bel \let\n:wlbl\@newl@bel \def\@newl@bel#1#2{{\:SUBOff\:SUPOff @@ -2298,7 +2306,7 @@ $\vcenter \expandafter\:temp\usepackage!*?: \def\:tempa{\@latex@e@error} \ifx \:temp\:tempa - % latex209.4ht (2022-02-01-14:27), generated from tex4ht-4ht.tex + % latex209.4ht (2022-04-13-13:14), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % Copyright 2009-2022 TeX Users Group % @@ -2317,7 +2325,7 @@ $\vcenter % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2022-02-01-14:27} +\immediate\write-1{version 2022-04-13-13:14} \let\:fnsymbol\@fnsymbol \def\@fnsymbol#1{{\hbox{$\:fnsymbol{#1}$}}} diff --git a/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht b/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht index 89d00be8106..870920095ec 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/nameref.4ht @@ -1,6 +1,6 @@ -% nameref.4ht (2021-02-03-14:57), generated from tex4ht-4ht.tex +% nameref.4ht (2022-04-13-13:14), generated from tex4ht-4ht.tex % Copyright 2005-2009 Eitan M. Gurari -% Copyright 2009-2021 TeX Users Group +% Copyright 2009-2022 TeX Users Group % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -17,7 +17,7 @@ % % If you modify this program, changing the % version identification would be appreciated. -\immediate\write-1{version 2021-02-03-14:57} +\immediate\write-1{version 2022-04-13-13:14} \let\NR:Type\relax \let\ltx@label\label @@ -163,12 +163,12 @@ } \let\T:ref=\::ref -\def\::ref{\protect\T@ref} +\def\::ref{\@ifstar{\protect\T@ref}{\protect\T@ref}} \def\T@ref#1{% \@safe@activestrue \let\::ref \T:ref \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}% - \def\::ref{\protect\T@ref}% + \def\::ref{\@ifstar{\protect\T@ref}{\protect\T@ref}} \@safe@activesfalse } -- cgit v1.2.3