From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- web/hyperfweb/Hyperfweb.tex | 151 +++++++++++++++++++++++++++++++++++++++++ web/hyperfweb/README.hyperfweb | 30 ++++++++ web/hyperfweb/hyperfweave.ch | 45 ++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 web/hyperfweb/Hyperfweb.tex create mode 100644 web/hyperfweb/README.hyperfweb create mode 100644 web/hyperfweb/hyperfweave.ch (limited to 'web/hyperfweb') diff --git a/web/hyperfweb/Hyperfweb.tex b/web/hyperfweb/Hyperfweb.tex new file mode 100644 index 0000000000..79d1c2d8bb --- /dev/null +++ b/web/hyperfweb/Hyperfweb.tex @@ -0,0 +1,151 @@ +% -- -- Hyperfweb.tex -- -- +% +% This one does the same thing for fweb as Tanmoy Bhattacharyya's +% hyperweb.tex does for Pascal web but without the input hacking hacks +% +% It rather assumes an fweave where every occurrence of a module number +% is screened by a macro call, so that the macros downbelow +% only have to swich meaning of one macro, according to context +% +% Please note that this is a supplement not a replacement +% for fwebmac.sty +% +% +\input hyperbasics +\def\HySRnull#1{#1} +\let\HySR=\HySRnull +\def\HySRef#1{\hyperref{}{section}{#1}{#1}} +% +% +% +% +% + + +\def\note#1#2.{\WY\noindent{\let\HySR=\HySRef + \hangindent2em\baselineskip10pt\eightrm#1~#2.\par}} + + + +\def\startsection{\WQ\noindent{\let\*=\empty\bf\hyperdef\hypernoname + {section}{\modstar}{\let\*=\lapstar\modstar.}% +\ifx\includefile\empty\else\ [{\tt\includefile}]\fi\quad}} + + +\def\WX#1:#2\X#3\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi + \XX$\langle\,$#2{\let\HySR=\HySRef + \eightrm\kern.5em#1}$\,\rangle^{\rm #3}$\XX} + + +\def\lheader{\mainfont\hyperdef\hypernoname{page}{\the\pageno}% + {\the\pageno}\eightrm\qquad\Whead\hfill\Wtitle\qquad + \ifnum\pageno=\contentspageno\else + \tensy x\mainfont\Wmodno + \fi} + + +\def\rheader{\ifnum\pageno=\contentspageno\else + \tensy x\mainfont\Wmodno + \fi + \eightrm\qquad\Wtitle\hfill\Whead + \qquad\mainfont\hyperdef\hypernoname{page}{\the\pageno}% + {\the\pageno}} + + +\newbox\hyperbox +\newif\iffooter\footertrue + + +\def\normaloutput#1#2#3{ + \ifodd\pageno\hoffset=\pageshift\fi + \shipout\vbox + { + \vbox to\fullpageheight + { + \iftitle\global\titlefalse + \else \hbox to\pagewidth + {\vbox to10pt{}% + \ifidenticalpageheads#2\else + \ifodd\pageno + #3% Pg nos alternate left \& right. + \else#2\fi + \fi + }% + \fi + \vfill#1% Parameter |#1| is the page itself. + \iffooter\vfill\copy\hyperbox\fi + } + } + \global\advance\pageno by1} + + +{\boxmaxdepth=0pt\relax\global +\setbox\hyperbox\hbox to \pagewidth{GO TO:\hfil\hyperref{}{page}{1}{first + page}\hfil\hyperref{}{section}{INDEX}{Index}\hfil\hyperref{}{section}% + {SECTIONS}{Section Names}\hfil\hyperref{}{section}{CONTENTS}{Contents}}} +\iffooter\advance\pageheight by -\ht\hyperbox\setpage\relax\fi + + +\def\Winx{\par\vskip6pt plus 1fil + \let\HySR=\HySRef + \write\cont{}% Ensure that the contents file isn't empty + \closeout\cont % The contents information has been fully gathered + \output{\ifpagesaved\normaloutput{\box\Sbox}\lheader\rheader\fi + \global\setbox\Sbox=\page \global\pagesavedtrue} + \pagesavedfalse \eject % Eject the page-so-far and predecessors + \setbox\Sbox\vbox{\unvbox\Sbox}% Take it out of its box + \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) + \parfillskip 0pt plus .6\hsize % Try to avoid almost empty lines + \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 + \hbox to\pagewidth{\box\Lbox\hfil\page}}}\lheader\rheader + \global\vsize\pageheight\gdef\lr{L}\global\pagesavedfalse\fi} +%% \message{Index:} + \parskip 0pt plus .5pt + \outer\def\:##1, {\par\hangindent2em\noindent##1:\kern1em}% Index entry + \def\[##1]{$\underline{##1}$}% Underlined index item + \def\(##1){$^{\rm ##1}$}% Language marker + \hyperdef\hypernoname{section}{INDEX}{}% + \let\Windexspace\medskip % Spacing between letter groups in index. + \rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar + \hyphenpenalty 10000 \parindent0pt} + + +\def\Wfin{\par\vfill\eject + \ifpagesaved\null\vfill\eject\fi % Output a null index column + \if L\lr\else\null\vfill\eject\fi % Finish the current page + \parfillskip 0pt plus 1fil + \def\rhead{NAMES OF THE SECTIONS} + \output{\normaloutput\page\lheader\rheader} + \setpage + \hyperdef\hypernoname{section}{SECTIONS}{}% + \def\note##1##2.{\quad{\eightrm##1 ##2.}} + \def\WU{\note{Used in }}% Cross-reference for uses of sections + \def\:{\par\hangindent 2em}\let\*=*} + + + +\def\Wcon{\par\vfill\eject + \rightskip 0pt \hyphenpenalty 50 \tolerance 200 + \setpage + \output{\normaloutput\page\lheader\rheader} + \titletrue % Prepare to output the table of contents + \hyperdef\hypernoname{section}{CONTENTS}{} + \pageno=\contentspageno \def\rhead{TABLE OF CONTENTS} + \topofcontents + \catcode`\@=11 + \hbox to\hsize{\hfil Section\hbox to3em{\hss Page}} + \def\WZ##1##2##3##4{\hbox to\hsize{\kern##1em\ignorespaces##2 + \leaders\hbox to .5em{.\hfil}\hfil\ % + \let\preserve=\*\let\*=\empty + \hyperref{}{section}{##3}{\let\*=\preserve##3}% + \hbox to3em{\hss\hyperref{}{page}{##4}{##4}}}} + \let\WIM\WIN % Restore the proper definition. + \readcontents\relax % Read the contents info. + \botofcontents + \FWEBend} + + diff --git a/web/hyperfweb/README.hyperfweb b/web/hyperfweb/README.hyperfweb new file mode 100644 index 0000000000..740685be90 --- /dev/null +++ b/web/hyperfweb/README.hyperfweb @@ -0,0 +1,30 @@ + ------ Hyperfweb, an extention of Krommes' fweb ------ + + +With hyperfweb, all the section numbers in the web are resolved +as html anchors, that is, out from any index entry, "Used in ..", +"See also .." you jump to the section referenced right away. +There is also a bottom line with four special jumps on every page. + + +You want two files to do hyperfweb: + +- hyperfweave,ch. + You ftangle this along with fweave to produce hyperfweave. + +- Hyperfweb.sty. + Your hyperfwoven .tex is to read this *after* fwebmac.sty + to produce a hyperdvi + +of course you want some previewer capable of hyperdvi +You find these, along with other hyperstuff, on +http://xxx.lanl.gov/hypertex/ +or on ctan:/tex-archive/support/hypertex/ + +-------------------------------------------- + +Acknowledgemants and thanks go to Tanmoy Bhattacharya +whose ideas and hyperwebmac were the template for +Hyperfweb.tex + + -- mahilata diff --git a/web/hyperfweb/hyperfweave.ch b/web/hyperfweb/hyperfweave.ch new file mode 100644 index 0000000000..9abf263a0a --- /dev/null +++ b/web/hyperfweb/hyperfweave.ch @@ -0,0 +1,45 @@ + -- -- hyperfweave.ch -- -- + + + + +@x +@ Here is a macro that outputs a module number in decimal notation. The +number to be converted by |out_mod| is known to be less than |def_flag|, so +it cannot have more than five decimal digits. If the module is changed, we +output~`\.{\\*}' just after the number. + +@=@[ + +SRTN out_mod FCN((n)) + sixteen_bits n C1("Module number.")@; +{ +char s[6]; + +sprintf(s,"%u",n); OUT_STR(s); + +if(chngd_module[n]) OUT_STR("\\*"); +} +@y +@ Here is a macro that outputs a module number in decimal notation. The +number to be converted by |out_mod| is known to be less than |def_flag|, so +it cannot have more than five decimal digits. If the module is changed, we +output~`\.{\\*}' just after the number. + +This one surrounds the module number by a macro call. It is up to +some fwebmac modification what to do with it. The intended use +is to hypertex a web. See |'Hyperfweb.tex'| for reference. + +@=@[ + +SRTN out_mod FCN((n)) + sixteen_bits n C1("Module number.")@; +{ +char s[6]; + +sprintf(s,"\\HySR{%u}",n); OUT_STR(s); + +if(chngd_module[n]) OUT_STR("\\*"); +} +@z + -- cgit v1.2.3