diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2022-01-29 15:55:26 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2022-01-29 15:55:26 +0000 |
commit | 3d77a113bf3dc2f835eed37cbcd5ef55d3ee56e7 (patch) | |
tree | 304af5aa3ebaf152ac513247ec4faf94ed51fbdb /Build/source/texk | |
parent | 9326e71076755bb8c1eb97f368783371d47d7385 (diff) |
[CWEB] Support HINT format.
The upcoming CWEB 4.7 will support HiTeX and its HINT format.
To use this material you can
$ hitex -ini -jobname=hitex tex.ini
$ make all PDF=hi fullmanual
$ hintview common.hnt # et al.
git-svn-id: svn://tug.org/texlive/trunk@61785 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/Makefile | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/comm-man.ch | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctang-man.ch | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweav-man.ch | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cwebmac.tex | 101 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cwebman-w2c.ch | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cwebman.tex | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex | 89 |
9 files changed, 145 insertions, 71 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index 32f34133a62..445b2ba0ffa 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,14 @@ +2022-01-29 Andreas Scherer <https://ascherer.github.io> + + * Makefile, + * comm-man.ch, + * ctang-man.ch, + * cweav-man.ch, + * cwebmac.tex, + * cwebman-w2c.ch, + * cwebman.tex, + * texinputs/pdfctwimac.tex: Support HINT format. + 2022-01-15 Andreas Scherer <https://ascherer.github.io> * comm-pc.ch, diff --git a/Build/source/texk/web2c/cwebdir/Makefile b/Build/source/texk/web2c/cwebdir/Makefile index 86db9f3bfc6..6fd7a7c98b8 100644 --- a/Build/source/texk/web2c/cwebdir/Makefile +++ b/Build/source/texk/web2c/cwebdir/Makefile @@ -64,9 +64,11 @@ CP= /bin/cp # uncomment the second line if you use pdftex to bypass .dvi files # uncomment the third line if you use xetex to bypass .dvi files +# uncomment the forth line if you use hitex for HINT output PDFTEX = dvipdfm #PDFTEX = pdftex #PDFTEX = xetex +#PDFTEX = hitex ########## You shouldn't have to change anything after this point ####### @@ -108,6 +110,7 @@ ALL = common.w ctangle.w cweave.w prod.w \ dvipdfm ) tex "\let\pdf+ \input $*"; dvipdfm $* ;; \ pdftex ) pdftex $* ;; \ xetex ) xetex $* ;; \ + hitex ) hitex $* ;; \ esac all: ctangle cweave @@ -163,7 +166,7 @@ fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch # be sure to leave ctangle.c and common.c for bootstrapping clean: $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \ - *.log *.dvi *.toc *.idx *.scn *.pdf core cweave ctangle + *.log *.dvi *.toc *.idx *.scn *.pdf *.hnt core cweave ctangle install: all - mkdir $(DESTDIR) diff --git a/Build/source/texk/web2c/cwebdir/comm-man.ch b/Build/source/texk/web2c/cwebdir/comm-man.ch index c922c036312..f2cdcf52e45 100644 --- a/Build/source/texk/web2c/cwebdir/comm-man.ch +++ b/Build/source/texk/web2c/cwebdir/comm-man.ch @@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one. } @y \def\botofcontents{\vfill\titlefalse} -\def\contentspagenumber{28} +\def\contentspagenumber{29} \def\title{APPENDIX D: COMMON} \let\K=\leftarrow @z diff --git a/Build/source/texk/web2c/cwebdir/ctang-man.ch b/Build/source/texk/web2c/cwebdir/ctang-man.ch index f90d5361ae8..69bc686b724 100644 --- a/Build/source/texk/web2c/cwebdir/ctang-man.ch +++ b/Build/source/texk/web2c/cwebdir/ctang-man.ch @@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one. } @y \def\botofcontents{\vfill\titlefalse} -\def\contentspagenumber{64} +\def\contentspagenumber{65} \def\title{APPENDIX E: CTANGLE} \let\K=\leftarrow @z diff --git a/Build/source/texk/web2c/cwebdir/cweav-man.ch b/Build/source/texk/web2c/cwebdir/cweav-man.ch index 366cda6f114..6cfcc8fe2d2 100644 --- a/Build/source/texk/web2c/cwebdir/cweav-man.ch +++ b/Build/source/texk/web2c/cwebdir/cweav-man.ch @@ -16,7 +16,7 @@ under the terms of a permission notice identical to this one. } @y \def\botofcontents{\vfill\titlefalse} -\def\contentspagenumber{108} +\def\contentspagenumber{109} \def\title{APPENDIX F: CWEAVE} \let\K=\leftarrow @z diff --git a/Build/source/texk/web2c/cwebdir/cwebmac.tex b/Build/source/texk/web2c/cwebdir/cwebmac.tex index 586e7bb30f0..05632731f27 100644 --- a/Build/source/texk/web2c/cwebdir/cwebmac.tex +++ b/Build/source/texk/web2c/cwebdir/cwebmac.tex @@ -1,8 +1,8 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 4.6 --- December 2021 +% Version 4.7--- January 2022 \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CWEB4.6} -\chardef\cwebversion=4 \chardef\cwebrevision=6 +\xdef\fmtversion{\fmtversion+CWEB4.7} +\chardef\cwebversion=4 \chardef\cwebrevision=7 \newif\ifpdf \ifx\pdf+\pdftrue\fi % Uncomment the following line if you want PDF goodies to be the default @@ -16,7 +16,10 @@ \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\fi +\newif\ifHINT +\ifx\HINToutline\undefined \HINTfalse \else \HINTtrue \fi \newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi +\newif\ifacroHINT \ifacro\acroHINTtrue\fi \ifHINT\acroHINTtrue\fi \let\:=\. % preserve a way to get the dot accent % (all other accents will still work as usual) @@ -127,7 +130,7 @@ \def\?{\mathrel?} \def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\note#1#2.{\Y\noindent{\hangindent2em% - \baselineskip10pt\eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}} + \baselineskip10pt\eightrm#1~\ifacroHINT{\pdfnote#2.}\else#2\fi.\par}} \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newtoks\toksE \newtoks\toksF \newtoks\usersanitizer @@ -148,29 +151,6 @@ \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight depth \thedepth << /Type /Annot /Subtype /Link /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi -\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} -\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% - \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} - \toksC={}\let\space\empty}\makenote}\maketoks}} -\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} -\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% - \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} -\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% - \ifnum\countB>`9 \countB=0 \fi - \ifnum\countB<`0 - \ifnum0=\countC\else\makenote\fi - \ifx\first.\let\next=\maketoksdone\else - \let\next=\maketoks - \addtokens\toksB{\the\toksD} - \ifx\first,\addtokens\toksB{\space}\fi - \fi - \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks - \fi - \next -} -\def\makenote{\addtokens\toksB - {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} -\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69 @@ -235,7 +215,7 @@ \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi % 0.1E5->\T{0.1\_5} \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi % 0x77 -> \T{\^77} \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi % 0b10111 -> \T{\\10111} - \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi % \T{77\$L} + \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L} \else\ifx\nxt\{\addF\lbchar \else\ifx\nxt\}\addF\rbchar \else\ifx\nxt\ \addF\space \else\ifx\nxt\#\addF{\string\#}% \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}% @@ -281,9 +261,53 @@ \outlinest\let\outlinedone=\relax} \fi % End of pdf macros +\ifHINT +% The following uses HINT primitives to implement: +% \HINThome to mark the position of the home page +% \HINTlabel to attach a label to the top of a section +% \HINTlink to link a section number to the section label +% \HINTcontents to produce an 'outline' item +% These are the top level HINT macros that are used in this file +% No HINT primitives are used directly. +\def\HINThome{\HINTdest name {HINT.home}% + \HINToutline goto name {HINT.home} depth 1 {Table of Contents}} +\def\HINTlabel{{\let\*=\empty\HINTdest num \secstar top}} +\def\HINTlink#1#2{\HINTstartlink goto num #1 {#1}\HINTendlink}% #2 not used ??? +\def\HINTcontents#1#2#3{\HINToutline goto num #3 depth #2 {#1}} +\let\pdflink=\HINTlink +\fi % End of HINT macros + +% Common macros for \ifacro and \ifHINT +\ifacroHINT +\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} +\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% + \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} + \toksC={}\let\space\empty}\makenote}\maketoks}} +\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} +\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% + \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} +\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% + \ifnum\countB>`9 \countB=0 \fi + \ifnum\countB<`0 + \ifnum0=\countC\else\makenote\fi + \ifx\first.\let\next=\maketoksdone\else + \let\next=\maketoks + \addtokens\toksB{\the\toksD} + \ifx\first,\addtokens\toksB{\space}\fi + \fi + \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks + \fi + \next +} +\def\makenote{\addtokens\toksB + {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} +\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\fi % End of common macros + \def\lapstar{\rlap{*}} \def\stsec{\rightskip=0pt % get out of C mode (cf. \B) \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 + \ifHINT\HINTlabel\fi% Start page before section \noindent{\let\*=\lapstar\bf\secstar.\quad}% \ifacro \smash{\raise\baselineskip\hbox to0pt{\let\*=\empty \ifpdftex \pdfdest num \secstar fith% @@ -345,19 +369,19 @@ \let\R=\lnot % logical not % \S is section sign \def\T#1{\leavevmode % octal, hex or decimal constant - \hbox{$\def\?{\kern.2em}% + \hbox{$\def\?{\kern.2em}%$% \let\ \, % C++ digit separator becomes a little white space % \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67 \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67 \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) - \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}} + \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$% \def\U{\note{This code is used in section}} % xref for use of a section \def\Us{\note{This code is used in sections}} % xref for uses of a section \let\V=\lor % logical or \let\W=\land % logical and \def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name \XX$\langle\,${\let\I=\ne#2\eightrm\kern.5em - \ifacro{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX} + \ifacroHINT{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX} \def\Y{\par\yskip} \let\Z=\le \let\ZZ=\let % now you can \write the control sequence \ZZ @@ -451,7 +475,9 @@ \vsize=\pageheight \advance\vsize by -\ht\sbox % the remaining height \hsize=.5\pagewidth \advance\hsize by -10pt % column width for the index (20pt between cols) + \ifHINT\else \parfillskip 0pt plus .6\hsize % try to avoid almost empty lines + \fi \def\lr{L} % this tells whether the left or right column is next \output{\if L\lr\global\setbox\lbox=\page \gdef\lr{R} \else\normaloutput{\vbox to\pageheight{\box\sbox\vss @@ -460,7 +486,7 @@ \message{Index:} \parskip 0pt plus .5pt \outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em - \ifacro\pdfnote##2.\else##2\fi.} % index entry + \ifacroHINT\pdfnote##2.\else##2\fi.} % index entry \def\[##1]{$\underline{##1}$} % underlined index item \rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar \hyphenpenalty 10000 \parindent0pt @@ -475,7 +501,7 @@ \message{Section names:} \output={\normaloutput\page\lheader\rheader} \setpage - \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}} + \def\note##1##2.{\quad{\eightrm##1~\ifacroHINT{\pdfnote##2.}\else{##2}\fi.}} \def\Q{\note{Cited in section}} % crossref for mention of a section \def\Qs{\note{Cited in sections}} % crossref for mentions of a section \def\U{\note{Used in section}} % crossref for use of a section @@ -512,15 +538,20 @@ \pageno=\contentspagenumber \def\grouptitle{TABLE OF CONTENTS} \message{Table of contents:} + \ifHINT\HINThome\fi% Mark the Table of contents as home page \topofcontents \startpdf - \line{\hfil Section\hbox to3em{\hss Page}} + \line{\hfil Section\ifHINT\else\hbox to3em{\hss Page}\fi}% No Page in HINT \let\ZZ=\contentsline \readcontents\relax % read the contents info \botofcontents \end} % print the contents page(s) and terminate \def\contentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi \line{\consetup{#2}#1 \rm\leaders\hbox to .5em{.\hfil}\hfil - \ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}} + \ \ifHINT + \HINTlink{#3}{\romannumeral#3}% No page numbers in HINT + \HINTcontents{#1}{#2}{#3}% + \else\ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi + \hbox to3em{\hss#4}\fi}} \def\consetup#1{\ifcase#1 \bf % depth -1 (@**) \or % depth 0 (@*) \or \hskip2em % depth 1 (@*1) diff --git a/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch b/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch index cbe0107bdb5..2369d041eb3 100644 --- a/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch @@ -18,7 +18,7 @@ @x \input cwebmac -\acrofalse\pdffalse\pdftexfalse +\acrofalse\pdffalse\pdftexfalse\HINTfalse\acroHINTfalse @y \input cwebmac @z diff --git a/Build/source/texk/web2c/cwebdir/cwebman.tex b/Build/source/texk/web2c/cwebdir/cwebman.tex index 4540802d31e..f24fda451ed 100644 --- a/Build/source/texk/web2c/cwebdir/cwebman.tex +++ b/Build/source/texk/web2c/cwebdir/cwebman.tex @@ -2,7 +2,7 @@ \def\tangref{3} % where the main explanation of CTANGLing is given \input cwebmac -\acrofalse\pdffalse\pdftexfalse +\acrofalse\pdffalse\pdftexfalse\HINTfalse\acroHINTfalse \def\page{\box255 } \normalbottom \parskip 0pt plus 1pt \def\RA{\char'31 } % right arrow diff --git a/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex b/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex index cb6804e8545..c1f0c7cbc12 100644 --- a/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex +++ b/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex @@ -1,11 +1,11 @@ % standard macros for CWEB listings (in addition to plain.tex) -% Version 4.5 --- October 2021 +% Version 4.6 --- January 2022 % modified for pages produced by CTWILL % further modified for page size of the MMIXware book % modified for PDF output with 'tex "\let\pdf+', 'pdftex', and 'xetex' % This file is not copyrighted and can be used freely. \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros -\xdef\fmtversion{\fmtversion+CTWILL4.5+LNCS+PDF} +\xdef\fmtversion{\fmtversion+CTWILL4.6+LNCS+PDF} \newif\ifpdf \ifx\pdf+\pdftrue\fi @@ -19,7 +19,10 @@ \def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too \def\PDFlinkcolor{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}} \fi\fi +\newif\ifHINT +\ifx\HINToutline\undefined \HINTfalse \else \HINTtrue \fi \newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi +\newif\ifacroHINT \ifacro\acroHINTtrue\fi \ifHINT\acroHINTtrue\fi \let\:=\. % preserve a way to get the dot accent % (all other accents will still work as usual) @@ -238,7 +241,7 @@ \def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi} \def\note#1#2.{\par\penalty5000 \Y\noindent{\hangindent2\em\baselineskip10pt% - \eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}} + \eightrm#1~\ifacroHINT{\pdfnote#2.}\else#2\fi.\par}} \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newtoks\toksE \newtoks\toksF \newtoks\usersanitizer @@ -259,29 +262,6 @@ \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight depth \thedepth << /Type /Annot /Subtype /Link /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi -\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} -\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% - \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} - \toksC={}\let\space\empty}\makenote}\maketoks}} -\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} -\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% - \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} -\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% - \ifnum\countB>`9 \countB=0 \fi - \ifnum\countB<`0 - \ifnum0=\countC\else\makenote\fi - \ifx\first.\let\next=\maketoksdone\else - \let\next=\maketoks - \addtokens\toksB{\the\toksD} - \ifx\first,\addtokens\toksB{\space}\fi - \fi - \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks - \fi - \next -} -\def\makenote{\addtokens\toksB - {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} -\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox attr {/Border [0 0 0]} user {/Type /Action /Subtype /Link /A << /S /URI /URI (#2) >>}\PDFlinkcolor #1\Black \pdfendlink @@ -392,9 +372,53 @@ \outlinest\let\outlinedone=\relax} \fi % End of pdf macros +\ifHINT +% The following uses HINT primitives to implement: +% \HINThome to mark the position of the home page +% \HINTlabel to attach a label to the top of a section +% \HINTlink to link a section number to the section label +% \HINTcontents to produce an 'outline' item +% These are the top level HINT macros that are used in this file +% No HINT primitives are used directly. +\def\HINThome{\HINTdest name {HINT.home}% + \HINToutline goto name {HINT.home} depth 1 {Table of Contents}} +\def\HINTlabel{{\let\*=\empty\HINTdest num \secstar top}} +\def\HINTlink#1#2{\HINTstartlink goto num #1 {#1}\HINTendlink}% #2 not used ??? +\def\HINTcontents#1#2#3{\HINToutline goto num #3 depth #2 {#1}} +\let\pdflink=\HINTlink +\fi % End of HINT macros + +% Common macros for \ifacro and \ifHINT +\ifacroHINT +\def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} +\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}% + \def\makenote{\addtokens\toksB{\the\toksC}\def\makenote{\toksD={} + \toksC={}\let\space\empty}\makenote}\maketoks}} +\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} +\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}% + \ifcat\noexpand\first0\countB=`#1\else\countB=0\fi\toksA={#2}} +\def\maketoks{\expandafter\poptoks\the\toksA|ENDTOKS|% + \ifnum\countB>`9 \countB=0 \fi + \ifnum\countB<`0 + \ifnum0=\countC\else\makenote\fi + \ifx\first.\let\next=\maketoksdone\else + \let\next=\maketoks + \addtokens\toksB{\the\toksD} + \ifx\first,\addtokens\toksB{\space}\fi + \fi + \else \addtokens\toksC{\the\toksD}\global\countC=1\let\next=\maketoks + \fi + \next +} +\def\makenote{\addtokens\toksB + {\noexpand\pdflink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} +\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\fi % End of common macros + \def\lapstar{\rlap{*}} \def\stsec{\tenpoint\rightskip=0pt % get out of C mode (cf. \B) \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 + \ifHINT\HINTlabel\fi% Start page before section \noindent\strut{\let\*=\lapstar\bf\secno.\quad}% \ifacro \smash{\raise\baselineskip\hbox to0pt{\let\*=\empty \ifpdftex \pdfdest num \secstar fith% @@ -480,7 +504,7 @@ \let\W=\land % logical and \def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name \XX$\langle\,${\let\I=\ne#2\sevenrm\kern.5em - \ifacro{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX} + \ifacroHINT{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX} \def\Y{\par\yskip} \let\Z=\le \let\ZZ=\let % now you can \write the control sequence \ZZ @@ -612,7 +636,7 @@ {\obeylines\gdef\makeinref#1 #2 #3 {\ifsorted\else\ttoks={\[#1 #2 #3}\immediate\write\reffile{+ \the\ttoks}\fi % \hangindent=1em \noindent #2\miniform#3, %<== space! - \S\ifacro{\pdfnote#1.}\else{#1}\fi.\par}} + \S\ifacroHINT{\pdfnote#1.}\else{#1}\fi.\par}} {\obeylines\gdef\makeoutref#1 #2 #3 {\ifsorted\else\ttoks={\]#1 #2 #3}\immediate\write\reffile{+ \the\ttoks}\fi % \hangindent=1em \noindent #2\miniform#3, \extref#1.\par}} @@ -704,15 +728,20 @@ %\pageno=\contentspagenumber %\def\grouptitle{TABLE OF CONTENTS} %\message{Table of contents:} + %\ifHINT\HINThome\fi% Mark the Table of contents as home page %\topofcontents \startpdf - %\line{\hfil Section\hbox to3em{\hss Page}} + %\line{\hfil Section\ifHINT\else\hbox to3em{\hss Page}\fi}% No Page in HINT %\let\ZZ=\contentsline %\readcontents\relax % read the contents info %\botofcontents \end} % print the contents page(s) and terminate %\def\contentsline#1#2#3#4#5{\ifnum#2=0 \smallbreak\fi %\line{\consetup{#2}#1 %\rm\leaders\hbox to .5em{.\hfil}\hfil - %\ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}} + %\ \ifHINT + %\HINTlink{#3}{\romannumeral#3}% No page numbers in HINT + %\HINTcontents{#1}{#2}{#3}% + %\else\ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi + %\hbox to3em{\hss#4}\fi}} %\def\consetup#1{\ifcase#1 \bf % depth -1 (@**) %\or % depth 0 (@*) %\or \hskip2em % depth 1 (@*1) |