Skip to content

Commit

Permalink
[CWEB] Move '\scan' to 'cwebacromac.tex'.
Browse files Browse the repository at this point in the history
Remove redundant copies of these macros.

Note that '\scan' has moved almost next to '\pdfnote'. However, I don't
see how to replace the latter with the former at this time. '\pdfnote'
receives much more than just numbers outside of the '\inx' macro.

git-svn-id: svn://tug.org/texlive/trunk/Build/source@72004 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
Andreas Scherer committed Aug 10, 2024
1 parent f88fc00 commit 6c2cae1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 46 deletions.
3 changes: 2 additions & 1 deletion texk/web2c/cwebdir/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* cwebacromac.tex,
* cwebmac.tex,
* texinputs/icwebmac.tex,
* texinputs/pdfctproofmac.tex: Apply new scanning macros.
* texinputs/pdfctproofmac.tex,
* texinputs/pdfctwimac.tex: Apply new scanning macros.

2024-08-08 Andreas Scherer <https://ascherer.github.io>

Expand Down
14 changes: 14 additions & 0 deletions texk/web2c/cwebdir/cwebacromac.tex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@
\fi
\ifpdflua\pdfcatalog{\pagemode\space\pagelabels}
\else\special{pdf: docview << \pagemode\space\pagelabels >>}\fi}
\ifacrohint\def\digits{\pdflink{\the\countA}\scan}
\else\def\digits{{\the\countA}\scan}\fi
\def\scan#1{\begingroup
\ifx!#1% exit on exclamation point
\else\ifx,#1,\space\aftergroup\scan % insert ,\space}\scan ...
\else\ifx\[#1\aftergroup#1% insert }\[...
\else\ifx\*#1\aftergroup\lapstar\aftergroup\scan % insert }\lapstar\scan ...
\else\ifnum`#1>`9#1\aftergroup\scan % insert #1}\scan ...
\else\ifnum`#1<`0#1\aftergroup\scan % insert #1}\scan ...
\else
\afterassignment\digits \aftergroup\countA
\aftergroup#1% insert }\countA=#1...\digits ...
\fi\fi\fi\fi\fi \fi
\endgroup}
% Local variables; there are a few externals like '\toksA' and '\countA'
\newtoks\toksB \newtoks\toksC \newtoks\toksD \newtoks\toksF \newtoks\sanitizer
Expand Down
16 changes: 1 addition & 15 deletions texk/web2c/cwebdir/cwebmac.tex
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
\def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
\def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi
\ifacrohint \input cwebacromac \fi % load hypertext macros
\input cwebacromac % load hypertext macros
\def\pdfURL#1#2{\ifpdf \ifpdflua\pdfannotlink height \theheight depth \thedepth
attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A
<< /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
Expand Down Expand Up @@ -324,20 +324,6 @@
\outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
\scan##2!.} % index entry
\def\[##1]{$\underline{\scan##1!}$\scan} % underlined index item
\ifacrohint\def\digits{\pdflink{\the\countA}\scan}
\else\def\digits{{\the\countA}\scan}\fi
\def\scan##1{\begingroup
\ifx!##1% exit on exclamation point
\else\ifx,##1,\space\aftergroup\scan %insert,\space}\scan ...
\else\ifx\[##1\aftergroup##1%{% insert }\[...
\else\ifx\*##1\aftergroup\lapstar\aftergroup\scan %insert }\lapstar\scan ...
\else\ifnum`##1>`9##1\aftergroup\scan %{% insert #1}\scan ...
\else\ifnum`##1<`0##1\aftergroup\scan %{% insert #1}\scan ...
\else
\afterassignment\digits \aftergroup\countA
\aftergroup##1%{% insert }\countA=#1...\digits ...
\fi\fi\fi\fi\fi \fi
\endgroup}
\rm \rightskip0pt plus 2.5em \tolerance 10000
\hyphenpenalty 10000 \parindent0pt
\readindex}
Expand Down
14 changes: 0 additions & 14 deletions texk/web2c/cwebdir/texinputs/icwebmac.tex
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,6 @@
\outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
\scan##2!.} % index entry
\def\[##1]{$\underline{\scan##1!}$\scan} % underlined index item
\ifacrohint\def\digits{\pdflink{\the\countA}\scan}
\else\def\digits{{\the\countA}\scan}\fi
\def\scan##1{\begingroup
\ifx!##1% exit on exclamation point
\else\ifx,##1,\space\aftergroup\scan %insert,\space}\scan ...
\else\ifx\[##1\aftergroup##1%{% insert }\[...
\else\ifx\*##1\aftergroup\lapstar\aftergroup\scan %insert }\lapstar\scan ...
\else\ifnum`##1>`9##1\aftergroup\scan %{% insert #1}\scan ...
\else\ifnum`##1<`0##1\aftergroup\scan %{% insert #1}\scan ...
\else
\afterassignment\digits \aftergroup\countA
\aftergroup##1%{% insert }\countA=#1...\digits ...
\fi\fi\fi\fi\fi \fi
\endgroup}
\rm \rightskip0pt plus 2.5em \tolerance 10000
\hyphenpenalty 10000 \parindent0pt
\readindex}
Expand Down
16 changes: 1 addition & 15 deletions texk/web2c/cwebdir/texinputs/pdfctproofmac.tex
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
\def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
\def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi
\ifacrohint \input cwebacromac \fi % load hypertext macros
\input cwebacromac % load hypertext macros
\def\pdfURL#1#2{\ifpdf \ifpdflua\pdfannotlink height \theheight depth \thedepth
attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A
<< /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
Expand Down Expand Up @@ -346,20 +346,6 @@
\outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
\scan##2!.} % index entry
\def\[##1]{$\underline{\scan##1!}$\scan} % underlined index item
\ifacrohint\def\digits{\pdflink{\the\countA}\scan}
\else\def\digits{{\the\countA}\scan}\fi
\def\scan##1{\begingroup
\ifx!##1% exit on exclamation point
\else\ifx,##1,\space\aftergroup\scan %insert,\space}\scan ...
\else\ifx\[##1\aftergroup##1%{% insert }\[...
\else\ifx\*##1\aftergroup\lapstar\aftergroup\scan %insert }\lapstar\scan ...
\else\ifnum`##1>`9##1\aftergroup\scan %{% insert #1}\scan ...
\else\ifnum`##1<`0##1\aftergroup\scan %{% insert #1}\scan ...
\else
\afterassignment\digits \aftergroup\countA
\aftergroup##1%{% insert }\countA=#1...\digits ...
\fi\fi\fi\fi\fi \fi
\endgroup}
\rm \rightskip0pt plus 2.5em \tolerance 10000
\hyphenpenalty 10000 \parindent0pt
\readindex}
Expand Down
2 changes: 1 addition & 1 deletion texk/web2c/cwebdir/texinputs/pdfctwimac.tex
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
\def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
\def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi
\ifacrohint \input cwebacromac \fi % load hypertext macros
\input cwebacromac % load hypertext macros

\def\lapstar{\rlap{*}}
\def\stsec{\tenpoint\rightskip=0pt % get out of C mode (cf. \B)
Expand Down

0 comments on commit 6c2cae1

Please sign in to comment.