From 6562457df9eb963b961a6f205e4a04c71da7d2fb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 1 Mar 2022 02:25:21 +0000 Subject: hitex doc git-svn-id: svn://tug.org/texlive/trunk@62307 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/hitex/base/hint.ist | 16 + Master/texmf-dist/doc/hitex/base/hint.sty | 1446 +++++++++++++++++++++++++ Master/texmf-dist/doc/hitex/base/hitexman.hnt | Bin 0 -> 503784 bytes Master/texmf-dist/doc/hitex/base/hitexman.pdf | Bin 0 -> 220432 bytes Master/texmf-dist/doc/hitex/base/hitexman.tex | 707 ++++++++++++ Master/texmf-dist/doc/hitex/base/verbatim.tex | 48 + 6 files changed, 2217 insertions(+) create mode 100644 Master/texmf-dist/doc/hitex/base/hint.ist create mode 100644 Master/texmf-dist/doc/hitex/base/hint.sty create mode 100644 Master/texmf-dist/doc/hitex/base/hitexman.hnt create mode 100644 Master/texmf-dist/doc/hitex/base/hitexman.pdf create mode 100644 Master/texmf-dist/doc/hitex/base/hitexman.tex create mode 100644 Master/texmf-dist/doc/hitex/base/verbatim.tex (limited to 'Master/texmf-dist/doc/hitex/base') diff --git a/Master/texmf-dist/doc/hitex/base/hint.ist b/Master/texmf-dist/doc/hitex/base/hint.ist new file mode 100644 index 00000000000..5510d18027e --- /dev/null +++ b/Master/texmf-dist/doc/hitex/base/hint.ist @@ -0,0 +1,16 @@ + +% quote '+' + +actual '+' +encap ':' +preamble "\\beginindex\n" +postamble "\\endindex\n" +headings_flag 1 +heading_prefix "\\indexheading " +symhead_positive "{Symbols}" +numhead_positive "{Numbers}" + +delim_0 "\\quad " +delim_1 "\\quad " +delim_2 "\\quad " + diff --git a/Master/texmf-dist/doc/hitex/base/hint.sty b/Master/texmf-dist/doc/hitex/base/hint.sty new file mode 100644 index 00000000000..4b702e84d50 --- /dev/null +++ b/Master/texmf-dist/doc/hitex/base/hint.sty @@ -0,0 +1,1446 @@ +\input idxmac.tex +\let\displayverbatimfont=\tt +\input verbatim.tex + +%% +%% special treatment for @ +%% + +\def\makeatletter{\catcode`\@=11\relax} +\def\makeatother{\catcode`\@=12\relax} +\makeatletter + +%% +%% Conditionals +%% + +\newif\ifhint +\newif\ifbook +\newif\ifpdf + +% HINT +\ifx\HINTversion\undefined + \hintfalse +\else + \hinttrue +\fi + +% PDF +\ifx\pdfliteral\undefined % postscript und ps2pdf + \pdffalse +\else + \pdftrue +\fi + +% Book +\ifx\book\undefined + \ifhint\bookfalse + \else\ifpdf\bookfalse % This might change + \else\bookfalse + \fi\fi +\else +\booktrue +\hintfalse +\pdffalse +\fi + +\message{Book: \ifbook true \else false \fi} +\message{PDF: \ifpdf true \else false \fi} +\message{HINT: \ifhint true \else false \fi} + +%% +%% Additional fonts +%% + +\font\tenss=cmss10 % used for the HINT name +\font\tenssbx=cmssbx10 % used for the bold HINT name +\font\largess=cmss12 scaled\magstep1 % used for large HINT name +\font\largessbx=cmssbx10 scaled\magstep2 % used for large bold HINT name +\font\manual=manfnt % font used for the METAFONT logo, etc. +\let\sf\tenss +\def\bf{\let\sf\tenssbx\fam\bffam\tenbf} + + +%% Large Font for sections +%\font\largebf=cmb14 scaled\magstep0 +%\font\largebf=cmb12 scaled\magstep1 +\font\largebf=cmbx12 scaled\magstep1 +%\font\largebf=cmbx8 scaled\magstep3 +%\font\largeit=cmti14 scaled\magstep0 +\font\largeit=cmti12 scaled\magstep1 +%\font\largett=cmtt14 scaled\magstep0 +\font\largett=cmtt12 scaled\magstep1 +%\font\largerm=cmr14 scaled\magstep0 +\font\largerm=cmr12 scaled\magstep1 +% for mathbolditalic +%\font\tenmib=cmmib10 scaled\magstep0 +\font\tenmib=cmmib10 scaled\magstep0 +\font\largemib=cmmib10 scaled\magstep1 + +%% Small Fonts for Figure and Table descriptions +\font\figbf=cmbx9 scaled\magstep0 +\font\figit=cmti9 scaled\magstep0 +\font\figmit=cmmi9 scaled\magstep0 +\font\figsy=cmsy9 scaled\magstep0 +\font\figtt=cmtt9 scaled\magstep0 +\font\figrm=cmr9 scaled\magstep0 +% for mathbolditalic +\font\figmib=cmmib9 scaled\magstep0 + +\def\largebold{\let\bf\largebf\let\sf\largessbx\bf} + +\def\large{\def\rm{\fam0\largerm}\let\bf\largebold\let\it\largeit\let\tt\largett\let\mib\largemib\let\sf\largess% +\textfont0=\largerm\textfont1=\largeit +\setbox\strutbox=\hbox{\vrule height9.5pt depth5.0pt width\z@}\rm} + +\def\small{\def\rm{\fam0\figrm}\let\bf\figbf\let\it\figit\let\tt\figtt\let\mib\figmib% +\textfont0=\figrm\textfont1=\figmit\textfont2=\figsy% +\setbox\strutbox=\hbox{\vrule height9.0pt depth4.5pt width\z@}\rm} + +\let\tiny\eightrm +\let\mib\tenmib + + +%% +%% Logos +%% + +%\def\Pascal/{{\mc P\kern-.05emascal\spacefactor1000}} +\def\CEE{{\mc C\spacefactor1000}} +\def\Pascal{\leavevmode\hbox{\mc P\kern-.05emascal}} +\def\PDF{\leavevmode\hbox{\mc PDF}} +\def\WEB{\leavevmode\hbox{\tt WEB\spacefactor1000}} +\def\GNU{\leavevmode\hbox{\mc GNU}} +\def\Prote{{\tenrm P\kern-0.1em R\kern-0.15em\raise.11ex\hbox{o}% + \kern-0.22em T\kern-0.05em E}} +\def\eTeX{$\varepsilon$-\TeX} +\def\HINT{\leavevmode\hbox{\sf HINT\spacefactor1000}} +\def\cweb{\leavevmode\hbox{\tt cweb}} +\def\web2w{\leavevmode\hbox{\tt web2w}} +\def\LaTeX{L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em\TeX}% +\def\MF{{\manual META}\-{\manual FONT}}% +\def\TL{\TeX~Live} +\def\kpse{\leavevmode\hbox{\tt kpathsearch\spacefactor1000}} +\def\TUB{{\sl TUGboat\/}} +\def\TUG{\TeX\ \UG} +\def\tug{\acro{TUG}} +\def\UG{Users Group} +\ifacro +\sanitizecommand{\TeX}{TeX} +\sanitizecommand{\eTeX}{eTeX} +\sanitizecommand{\Prote}{PRoTE} +\fi +%% +%% Special controlsequences +%% + +\def\abs#1{\left|#1\right|} +\def\<#1>{$\langle\,$#1$\,\rangle$} +\def\registered{{\ooalign{\hfil\raise.07ex\hbox{\sevenrm R}\hfil\crcr\Orb}}} +\def\hair{\kern.05em\relax} % teeny tiny space +\def\center#1{\bigskip\line{\hfil#1\hfil}\bigbreak} +\chardef\VB=`\| % vertical bar character in a string +\def\^{\ifmmode\mathchar"222 \else\char`^ \fi}%from webmac.tex: pointer or hat +\ifhint +\def\_{{\tt\UL}} % make underline an ordinary character for better searching +\fi + +% Bibtex needs this +\def\mbox#1{\leavevmode\hbox{#1}} + +% URLs +{\gdef\urldot{.}\catcode`.=13 + \gdef\urlslash{/}\catcode`/=13 + \gdef\urlspecials{\def.{\urldot\penalty 0}\def/{\urlslash\penalty 0}} +} +\def\url{\bgroup\hskip 1cm plus 5cm\penalty -100\hskip -1cm plus -5cm\tt + \catcode`_=12\catcode`\~=12\catcode`.=13\catcode`/=13\urlspecials} +\def\endurl{\egroup} + + +% for the index +\def\see#1#2{\hskip 0pt plus 100pt\penalty 0\hskip 0 pt plus -100pt{\it see\/} #1} + +% typewriter type for strings +\def\.#1{\leavevmode\hbox{\tt + \let\\=\BS % backslash in a string + \let\{=\LB % left brace in a string + \let\}=\RB % right brace in a string + \let\~=\TL % tilde in a string + \let\ =\SP % space in a string + \let\_=\UL % underline in a string + \let\&=\AM % ampersand in a string + \let\^=\CF % circumflex in a string + \let\|=\VB % vertical bar in a string + #1\kern.05em}} + +%{\rm\gdef\strutdepth{\dp\strutbox}} + + +%% +%% Environments +%% + +% Quotations (form the standard) +\def\beginquote{\bgroup\narrower\noindent\sl} +\def\endquote{\egroup} + +% Enumerate +\newcount\enum +%other styles use \medskip instead of \par +\def\enumerate{\par\bgroup\advance\leftskip by\parindent\enum=0% + \def\item{\advance\enum by 1\par\enumdest\smallskip\noindent\hbox to 0pt{\hss\the\enum.~}\ignorespaces}} +\def\endenumerate{\medskip\egroup\noindent} + +%Itemize +\def\itemize{\par\bgroup\advance\leftskip by\parindent\relax% + \def\item{\par\smallskip\noindent\llap{$\bullet$\enspace}\ignorespaces}} +\def\enditemize{\medskip\egroup\noindent} + +%Float +\long\def\float#1{\midinsert\parindent 0pt\relax#1\endinsert} +%\def\float#1{\midinsert +%\hsize\pagewidth +%\parindent 0pt\vbox{\hbox{\kern-\marginwidth\vbox{#1}}}\endinsert} + +%% +%% Redefining cwebmac.tex macros +%% + +%defining how to output terminals and nonterminals +\def\ts#1{\ifmmode\hbox{\sc #1}\else{\sc #1}\fi}% terminal symbol +\def\nts#1{{\sl #1\/}}% nonterminal symbol +% redefining the box around verbatim code +\def\vb#1{\hbox{\strut\.{#1}}} +% regular expressions and actions +\newbox\rebox +\def\re#1{\leavevmode\setbox\rebox\hbox{#1\hfill}\ifdim\wd\rebox<7em\wd\rebox=7em\fi\box\rebox\quad} +\def\ac{\global\ind=10\hangindent=\ind em\relax} +\def\eac{\global\ind=3\hangindent=\ind em\relax} +% yskip is usually a smallskip = 3pt pus 1pt minus 1pt +% I give it some extra stretchability +%\def\yskip{\vskip 3pt plus 3pt minus 1pt} +\let\yskip\smallbreak + +% redefine \5 for an optional break without the 2.5em reduced indentation +%\def\5{\hskip 0pt plus 2.5em\penalty-1\hskip 0pt plus -2.5em\kern0.5em\ignorespaces}% optional break +%redefine \5 to give some shrinkability +% form hitex and hint style: +%\def\5{\hfil\penalty-1\hskip 0pt minus 6pt\hfilneg\kern2.5em\copy\bakk\ignorespaces}% optional break +\def\5{\hfil\penalty10\hfilneg\hskip 0pt minus 6pt\kern2.5em\copy\bakk\ignorespaces}% optional break +\def\J{}% dont show @& in the tex output +\def\Y{\par\yskip} + +% start sections +\def\stsec{\rightskip=0pt % get out of C mode (cf. \B) + \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50 % +} + +% the box for the points to operator "->" in C +\setbox\MGbox=\hbox{$\rightarrow$} + +% how to display NULL +\def\NULL{\tt NULL} + +%other styles make this a \par +\def\note#1#2.{} +%\Y\noindent{\hfill% +% \baselineskip10pt\tiny#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}} + +%other styles make this minus 10pt +\def\B{\rightskip=0pt plus 100pt minus 0pt % go into C mode + \sfcode`;=3000 + \pretolerance 10000 + \hyphenpenalty 1000 % so strings can be broken (discretionary \ is inserted) + \exhyphenpenalty 1000 + \codedest + \global\ind=2 \1\ \unskip + \vadjust{\vtop to 0pt{\vss\hbox to \hsize{\hfill\tiny(\secstar)}\kern 0pt}}} + +% formating of C comments +\def\C#1{\5\hfill$/\ast\,${\cmntfont #1}$\,\ast/$} + +% section begin +\def\M#1{\MN{#1}\ifon\stsec\smallskip +%\everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph +\noindent\ignorespaces}% beginning of section + +\def\N#1#2#3.{\MN{#1}\ifon\stsec\smallskip +%\everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph +\noindent{\bf#3\quad}\ignorespaces}% beginning of section + +\def\MN#1{\smallskip + {\xdef\secstar{#1}\let\*=\empty\xdef\secno{#1}}% + \gdef\thecode{#1}% common code for \M, \N + \ontrue} + +% Used in section text +\def\U{\rightnote{Used in}} % xref for use of a section +\def\Us{\rightnote{Used in}} % xref for uses of a section +% replacing \note in \U and \Us by \rightnote +%\def\rightnote#1#2.{\vskip-\baselineskip\vtop to 0pt{\vss\hbox to \hsize{\hfill +% \tiny#1~\ifacro{\pdfnote#2.}\else#2\fi.}\kern 0pt}} +%\def\rightnote#1#2.{\vskip-\baselineskip\hbox to \hsize{\hfill +% \tiny#1~\ifacro{\pdfnote#2.}\else#2\fi.}} +%\def\rightnote#1#2.{\penalty1000\discretionary{}{\hbox{}}{\kern 2em}\penalty1000\hfill +% \hbox{\tiny#1~\ifacro{\pdfnote#2.}\else#2\fi.}} +\def\rightnote#1#2.{% + \penalty1000\discretionary{}{\hbox{}}{\kern 4em}\penalty1000\hfill + \hskip -4em plus 4em\hbox{\tiny #1~\codenote#2.}.} + +\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name + \XX$\langle\,${\let\I=\ne#2\kern.5em\coderef{#1}$\,\rangle$\XX}} + + +% how to display hex numbers +\def\hex{\hbox{$^{\scriptstyle\#}$\tt\aftergroup}} % CWEB style + +\def\(#1){} % this is used to make section names sort themselves better + + +%% +%% Dimensions to achive the desired layout +%% + + +% the other variables are defined in cwebmac.tex +\newdimen\headheight +\newdimen\footheight +\newdimen\leftmargin +\newdimen\rightmargin +\newdimen\topmargin +\newdimen\bottommargin +\newdimen\marginwidth + +\parskip 0pt plus .8pt + +\leftmargin=22mm +\rightmargin=22mm +\topmargin=15mm +\bottommargin=27mm +\marginwidth=0pt % we do not have notes in the margin + +\headheight=12pt % Text in Head +\advance\headheight+13pt % Abstand 1pt, Linie 0.47pt und Abstand zum Text 11.53pt +\footheight=0pt % Text in Footer + +\pagewidth=6.69in +\advance\pagewidth-\leftmargin % left margin/offset +\advance\pagewidth-\rightmargin % left margin/offset + +% 6.69in = 169.926 +% - 2*22mm = 125.926mm +% +% 9.61in = 244.094 +% - 15mm -27 mm = 202.094 +% (12+13)pt = 8.786 mm +% -8.786 = 193.308 mm + +\fullpageheight=9.61in +\advance\fullpageheight-\topmargin% topmargin +\advance\fullpageheight-\bottommargin% bottommargin + +\pageheight=\fullpageheight +\advance\pageheight-\headheight +\advance\pageheight-\footheight + +\def\setpage{\hsize\pagewidth\advance\hsize-\marginwidth\vsize\pageheight} % use after changing page size + +\setpage + +% setting the papersize for postscript and pdf + +\ifbook + %\overfullrule=0pt + \pdfpageheight=9.61in + \pdfpagewidth=6.69in + \pdfhorigin=\leftmargin + \pdfvorigin=\topmargin + \pdfcompresslevel=9 + \pdfdecimaldigits=4 + \pdfpkresolution=1200 + \pdfimageresolution=1200 +\else\ifpdf + \pdfpageheight=9.61in + \pdfpagewidth=6.69in + \pdfhorigin=\leftmargin + \pdfvorigin=\topmargin + \pdfcompresslevel=9 + \pdfdecimaldigits=4 + \pdfpkresolution=1200 + \pdfimageresolution=1200 +\else + \special{papersize=6.69in,9.61in}% postscript und ps2pdf +\fi\fi + + + +%% +%% Page layout +%% + +\long\def\leftmark#1#2{#1} +\long\def\subsectionmark#1#2{#2} +\long\def\rightmark#1#2{\if0#1\else\expandafter\subsectionmark\botmark\fi} + +\def\lheader{\mainfont\strut +\thepageno\hfill\expandafter\leftmark\firstmark} % top line on left-hand pages + +\def\rheader{\mainfont\strut +\expandafter\rightmark\firstmark\hfill\thepageno} % top line on right-hand pages + +\let\page=\pagebody +%\raggedbottom +\normalbottom +%\def\page{\box255 }\normalbottom % faster, but loses plain TeX footnotes +\def\normaloutput#1#2#3{\ifodd\pageno\hoffset=\pageshift\fi + \shipout\vbox{ + \vbox to\fullpageheight{\pagelabel + \iftitle\global\titlefalse + \else\hbox{\vbox to \headheight{ + \hbox to \pagewidth{\ifodd\pageno #3\else#2\fi} + \vskip 1pt\relax + \nointerlineskip + \hrule height .47pt +% \hbox{\hrule}%fill\psfig{file=image/topline.eps}\hfil}% + \vfil}}% + \fi + \nointerlineskip + \hbox{\kern\marginwidth\vbox to \pageheight{#1}}}} % parameter #1 is the page itself + \global\advance\pageno by1} + +\def\nomarginoutput#1#2#3{% + \ifodd\pageno\hoffset=\pageshift\fi + \shipout\vbox to\fullpageheight{\pagelabel\nointerlineskip + \iftitle\global\titlefalse + \hbox{\vbox to \headheight{\vfil}} + \else + \hbox{\vbox to \headheight{\nointerlineskip + \hbox to \pagewidth{\ifodd\pageno#3\else#2\fi}% + \vskip 1 pt + \nointerlineskip + \hrule height .47pt +% \hbox{\psfig{silent=,bbllx=0pt,bblly=0pt,bburx=368pt,bbury=2pt,file=image/topline.eps}\hfil}% + \vfil}}% + \fi\nointerlineskip #1 % parameter #1 is the page itself +% \vss +% \hbox to \pagewidth{\ifodd\pageno\else#2\fi}% +% \nointerlineskip +% \hbox{\psfig{file=image/topline.eps}\hfil}% +}% +\global\advance\pageno by1} + +%% switch to global nomargin +\let\normaloutput\nomarginoutput +\def\sectionbox#1{\hbox{#1}} +\marginwidth=0mm +\setpage + + +%% +%% Frontmatter and mainmatter +%% +\pageno=1 +\def\thepageno{\romannumeral\pageno} +\def\frontmatter{\pageno=4\def\thepageno{\romannumeral\pageno}} +\def\mainmatter{ +\mark{{\sectionname}{\subsectionname}} +%\message{Mark {\sectionname}{\subsectionname}} +\vfil\break\ifodd\pageno\pageno=1\else\pageno=0\fi +\def\thepageno{\the\pageno}% +\sectioncount=0 +\mark{{0}{0}}% +%\hbox{Mark empty empty}% +\gdef\sectionname{} +\gdef\subsectionname{} +\gdef\codetitle{} +\gdef\subcodetitle{} +} + + + + +%% +%% Sections +%% + +\newcount\sectioncount +\sectioncount=0 +\newcount\subsectioncount +\subsectioncount=0 +\newcount\subsubsectioncount +\subsubsectioncount=0 + +\newskip\abovesecskip +\newskip\belowsecskip +\newskip\abovesubsecskip +\newskip\belowsubsecskip + +%\abovesecskip= 6ex plus 1ex minus .2ex %space above the section +%\belowsecskip=3.7ex plus .2ex% space after section +\abovesecskip= 0.15\vsize plus 5ex minus 1ex %space above the section +\belowsecskip=10pt plus 2pt% space after section +\abovesubsecskip=9pt plus 4pt minus 2pt%space above the section +\belowsubsecskip=3pt plus 1pt minus 0.5pt% space after section + + +\newif\ifappendix +\appendixfalse + +\mark{{0}{0}}\vskip 0pt minus 100pt +%\hbox{Mark empty empty}% +\def\thesection{\the\sectioncount} +\def\topsection{\the\sectioncount} + +%\def\sectionbox#1{\hskip-\marginwidth\hbox to \marginwidth{#1\hfil}} + +\def\heading#1#2{% +\def\secno{{\noindent\large\bf\strut{#1}#2}}% +\par\ifhmode\unskip\fi% end paragraph and remove vertical space +\penalty-500 +\vskip 0pt plus 72pt%allow some empty space at the bottom +\penalty-500 +\vskip 0pt plus -72pt% room for stetching and a page break +\hbox{}\vskip\abovesecskip% space above the section +%%\titletrue % omits page header for section +%\hbox{Mark null null}% +\mark{{0}{0}}% +\secno% The section title +\mark{{\sectionname}{\sectionname}}% +%\message{Mark heading {\sectionname}{\subsectionname}} +\nobreak\vskip\belowsecskip% space after section +\everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph +\ignorespaces} + + + +\newcount\plaincount +\def\plainsection#1{% +\mark{{\sectionname}{\subsectionname}}% +%\message{Mark plain {\sectionname}{\subsectionname}} +\subsubsectioncount=0\subsectioncount=0% +\advance\plaincount by 1\relax +\def\thesection{} +\sectionpage% +\gdef\sectionname{#1}% +\gdef\subsectionname{#1}% +\gdef\codetitle{#1}% +\gdef\subcodetitle{#1}% +\tocsection{0}{}{#1} +\heading{}{#1}% +} + + +\gdef\sectionname{} +\gdef\subsectionname{} +\gdef\codetitle{}% +\gdef\subcodetitle{} + +\def\sectionpage{% +\vfil\break +\ifodd\pageno\else +\hbox{}% +\titletrue +\fi +\vfil\break +} + + +\def\section#1{% +\mark{{\sectionname}{\subsectionname}}% +%\message{Mark section {\sectionname}{\subsectionname}} +\subsubsectioncount=0\subsectioncount=0% +\advance\sectioncount by 1%updating counts +\let\thesection\topsection +\sectionpage% +\gdef\sectionname{\topsection\quad#1}% +\gdef\subsectionname{\thesection\quad#1}% +\gdef\codetitle{#1}% +\gdef\subcodetitle{#1}% +\ifnum\sectioncount=1\ifappendix\tocsection{0}{}{Appendix}\heading{}{Appendix}\fi\fi +\tocsection{0}{\thesection}{#1}% +\heading{\thesection~}{#1}% +} + + +\def\subsection#1{% +\subsubsectioncount=0\advance\subsectioncount by 1%updating counts +\def\thesection{\topsection.\the\subsectioncount} +\def\secno{{\noindent\bf\strut\sectionbox{\thesection~}#1}}% +\par\ifhmode\unskip\fi% end paragraph and remove vertical space +\tocsection{1}{\thesection}{#1}% +\penalty-200 +\vskip 0pt plus 36pt% allow some empty space at the bottom +\penalty-200 +\vskip 0pt plus -36pt% room for stetching and a page break +\gdef\subsectionname{\thesection\quad#1}% +\mark{{\sectionname}{\subsectionname}}% +%\message{Mark subsection {\sectionname}{\subsectionname}} +\vskip\abovesubsecskip% space above the subsection +\secno% The subsection title +\gdef\subcodetitle{#1}% +%\mark{{\sectionname}{\subsectionname}}% +%\hbox{Mark {\sectionname}{\subsectionname}}% +\nobreak\vskip\belowsubsecskip% space after subsection +\everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph +\ignorespaces} + + +\def\subsubsection#1{% +%\mark{{\sectionname}{\subsectionname}}% +%\hbox{Mark {\sectionname}{\subsectionname}}% + \advance\subsubsectioncount by 1%updating counts +\def\thesection{\topsection.\the\subsectioncount.\the\subsubsectioncount} +\def\secno{{\noindent\it\strut\sectionbox{\thesection~}#1}}% +\par\ifhmode\unskip\fi% end paragraph and remove vertical space +\tocsection{2}{\thesection}{#1}% +\penalty-200 +\vskip 0pt plus 36pt% allow some empty space at the bottom +\penalty-200 +\vskip 0pt plus -36pt% room for stetching and a page break +\vskip\abovesubsecskip% space above the subsection +\secno% The subsubsection title +\nobreak\vskip\belowsubsecskip% space after subsection +%\everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph +%\noindent +\ignorespaces} + +%% +%% Appendix +%% + +\def\Alphanum#1{% + \ifcase#1\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or + K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or + Y\or Z\else\number#1\fi} + +\def\appendix{% +\mark{{\sectionname}{\subsectionname}}% +%\message{Mark appendix {\sectionname}{\subsectionname}} +\sectioncount=0 +\subsectioncount=0 +\gdef\thesection{\Alphanum\sectioncount}% +\gdef\topsection{\Alphanum\sectioncount}% +\appendixtrue +} + +%% +%% Crossreference of Identifiers and Sections +%% +\iftrue %% No Crossreference of identifiers + \def\inx{\def\lr{L}} % this tells whether the left or right column is next +\else +\def\inx{% + \hsize=\pagewidth + \def\page{\box255 } \normalbottom + \output{\ifpagesaved\normaloutput{\box\sbox}\lheader\rheader\fi + \global\setbox\sbox=\page \global\pagesavedtrue} + \pagesavedfalse + \plainsection{Crossreference of Identifiers}% we are beginning the index + \mark{{0}{0}}% +%\hbox{Mark empty empty}% + \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\nomarginoutput{\vbox to\pageheight{\box\sbox\vss + \hbox to\pagewidth{\box\lbox\hfil\page}}}\lheader\rheader + \global\vsize\pageheight\gdef\lr{L}\global\pagesavedfalse + \mark{{Crossreference of Identifiers}{Crossreference of Identifiers}}% + \fi} + \parfillskip 0pt plus 1fil + \let\topsecno=\nullsec + \message{Crossreference of Identifiers:} + \parskip 0pt plus .5pt + \outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em + \ifbook##2\else\ifpdf\pdfnote##2.\else##2\fi\fi.} % index entry + \def\[##1]{$\underline{##1}$} % underlined index item + \rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar + \hyphenpenalty 10000 \parindent0pt + \small + \readindex +} +\fi + +\def\fin{% + \if L\lr\mark{{}{}}\fi + \vfill\eject % complete the current column. + \mark{{}{}} + \if R\lr\null\vfill\eject\fi % if necessarry add a right column + \setpage + \def\page{\box255 } \normalbottom + \output={\nomarginoutput\page\lheader\rheader} +} +\ifbook +\let\crosssections=\relax +\else +\def\crosssections{ + \plainsection{Crossreference of Code}% this is done when we are ending the index + \parindent 0pt + \parfillskip 0pt plus 1fil + \let\topsecno=\nullsec + \message{Crossreference of Code:} + \def\note##1##2.{\hfil\penalty-1\hfilneg\quad{\tiny##1~\ifbook##2\else + \ifpdf{\pdfnote##2.}\else + \ifhint\codenote##2.\else##2.\fi\fi\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}} % crossref for use of a section + \def\Us{\note{Used in}} % crossref for uses of a section + \def\I{\par\hangindent 2em}\let\*=* + \def\X##1:##2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name + \XX$\langle\,${\let\I=\ne##2}$\,\rangle$\XX\quad{\tiny Defined in~\codenote##1.}} + \readsections +} +\fi + + + +%% +%% Table of Content +%% + +% we separate the identification of a section used in links +%from the identification on paper, because plain sections dont +%have the latter. +\newcount\toccount +\toccount=0 + +\def\tocsection#1#2#3{% depth sectionnumber sectiontitle +\global\advance\toccount by 1% +\newdest{SC.\the\toccount}% +\ifhint + \immediate\write\cont{\noexpand\ZZ {#1}{#2}{#3}% write to contents file + {\noexpand\thepageno}{\the\toccount}} +\else +\edef\next{\write\cont{\noexpand\ZZ {#1}{#2}{#3}% write to contents file + {\noexpand\thepageno}{\the\toccount}}}\next % \tocline{depth}{sec}{title}{page}{toccount} +\fi +} + +\output{ + \ifhint + \shipout\box255\relax% otherwise I loose open, write, or close commands + \else + \setbox0=\page % the first page is garbage + \fi +% \openout\cont=\contentsfile +% \write\cont{\catcode `\noexpand\@=11\relax} % \makeatletter + \global\output{\normaloutput\page\lheader\rheader}} + + +\newbox\tocbox +\def\maketoc{% + \typeout{Reading table of contents} + \setbox\tocbox\vbox{% + \let\ZZ=\tocline + \ifbook\else\ifpdf\startpdf\fi\fi + \readcontents\relax + } + \typeout{Writing \contentsfile} + \immediate\openout\cont=\contentsfile\relax + \immediate\write\cont{\catcode `\noexpand\@=11\relax} +} + +\def\tableofcontent{\plainsection{Contents}\ifhint\HINTdest name {HINT.home}\fi +\unvbox\tocbox +} + + +\def\tocline#1#2#3#4#5{% depth sectionnumber sectiontitle page toccount +\ifnum#1=0 \smallskip\vskip 0pt plus 12pt\penalty -100\vskip 0pt plus -12pt\fi +\noindent +\line{% +\ifnum#1=0% + \hbox to 2em{\bf#2\hfill}{\bf#3~}\hfill + \hbox to 2em{\hss\bf\tocref{#1}{#3}{#4}{#5}}% +\else \ifnum#1=1% + \kern 2em\hbox to 3em{\rm#2\hfill}{\rm#3~}\leaders\hbox to .5em{.\hfil}\hfill + \hbox to 2em{\hss\tocref{#1}{#3}{#4}{#5}}% +\else + \kern 2em\hbox to 5em{\rm#2\hfill}{\it#3~}\leaders\hbox to .5em{.\hfil}\hfill + \hbox to 2em{\hss\tocref{#1}{#3}{#4}{#5}}\fi\fi +}} + + + +%% +%% Figures and Tables +%% + +\def\fig#1{\global\advance\figcount by 1% +\ifvmode\noindent\fi +\def\captype{Fig}% +\capskip=1em% +\vbox{\nointerlineskip\figdest +\hbox{\noindent#1\hskip -2pt\hskip 0pt plus 2pt minus 2pt}% +\medskip +\rlap{\small\unhbox\capbox}% +}} + +\def\tab#1{% +\ifvmode\noindent\fi +\def\captype{Tab}% +\capskip=0pt% +\vbox{#1\medskip\rlap{\small\unhbox\capbox}}} + +\def\table#1#2{\global\advance\tabcount by 1% +\ifvmode\noindent\fi +\def\captype{Tab}% +\capskip=0pt% +\vbox{\offinterlineskip\tabdest + \halign{\large\strut + \vrule##&&\quad\hfil##\hfil\quad\vrule\cr + \noalign{\hrule}#2\noalign{\hrule}}% + \medskip + \tabcaption{#1}% + \rlap{\small\unhbox\capbox}% + }% +} + +\def\captype{} +\newdimen\capskip +\capskip=1em +\newbox\capbox +\setbox\capbox\hbox{} +\newcount\figcount +\figcount=0 +\newcount\tabcount +\tabcount=0 + +\def\nextfigcaption#1{\small\strut\it\hskip\capskip\figindex{\captype}{\the\figcount}{#1}\captype.~\the\figcount:} + +\def\caption#1{\global\setbox\capbox\hbox{\nextfigcaption{#1} #1}} + +\def\nexttabcaption#1{\small\strut\it\hskip\capskip\tabindex{\captype}{\the\tabcount}{#1}\captype.~\the\tabcount:} +\def\tabcaption#1{\global\setbox\capbox\hbox{\nexttabcaption{#1} #1}} + + +%\long\def\leftfig#1#2#3{% +%\ifvmode\noindent\fi +%\def\captype{Fig}% +%\capskip=1em% +%\vbox{% +% \tabskip=0pt\halign to \hsize{% +% \vtop{\vskip 0pt\parskip=0pt\hsize=62.5mm\relax +% ##}\tabskip=5mm plus 2pt minus 2pt& +% \vtop{\vskip 0pt\parskip=0pt\hsize=62.5mm\relax##}\tabskip=0pt\cr +% #1&\capskip=0pt\nextfigcaption{#2} #3\cr}\medbreak}} + +\long\def\leftright#1#2#3#4{% +\ifvmode\noindent\else\par\noindent\fi +\vbox{\nointerlineskip + \advance\hsize by -\leftskip\advance\hsize by -\rightskip% + \leftskip=0pt\rightskip=0pt% + \hbox to \hsize{\strut + \raise\ht\strutbox + \vtop{\vskip 0pt\parskip=0pt\hsize=#1\hsize\advance\hsize by -2.5mm\relax + \noindent\strut\ignorespaces#3\vfill}\hfil + \raise\ht\strutbox + \vtop{\vskip 0pt\parskip=0pt\hsize=#2\hsize\advance\hsize by -2.5mm\relax + \noindent\strut\ignorespaces#4\vfill}}}} + + +\long\def\leftfig#1#2#3{% +\def\captype{Fig}% +\capskip=0pt% +\leftright{0.5}{0.5}{#1\kern -2pt\hskip 2pt plus 2pt minus 2pt}{\nextfigcaption{#2}\strut #3}} + + +\def\subindex#1{% + \par\ifhmode\unskip\fi% end paragraph and remove vertical space + \vskip\abovesubsecskip% space above the subsection + \vskip 0pt plus 72pt% allow some empty space at the bottom + \penalty-200\vskip 0pt plus -72pt % room for stetching and a page break + \noindent{\bf\strut#1}% + \nobreak\vskip\belowsubsecskip% space after subsection + \everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph + \ignorespaces +} + +\newwrite\@figfile +\newwrite\@tabfile + +\def\makefigindex{% + \immediate\openout\@figfile=\jobname.fig\relax + \def\figindex{\@bsphack\begingroup\@sanitize\@wrfigindex\@figfile}% + \immediate\openout\@tabfile=\jobname.tab\relax + \def\tabindex{\@bsphack\begingroup\@sanitize\@wrfigindex\@tabfile}% + \typeout{Writing index files \jobname.fig \jobname.tab} +} + +\newdimen\iboxsize +\def\thefigindex{% + + \immediate\closeout\@figfile\relax + \immediate\closeout\@tabfile\relax + %\small\baselineskip=11pt + \plainsection{List of Figures and Tables} + \makeatletter + \iboxsize=3.7em\relax + \subindex{Figures} + \def\indexentry##1##2##3##4{% captype, fig/tab count, caption, page + \noindent + \line{\hbox to \iboxsize{% + \rm##1.~##2:\hfil}{\rm ##3}\ \leaders\hbox to .5em{.\hfil}% + \hfill\hbox to 1.4em{\hss + \ifbook##4\else + \ifpdf + \pagelnk{##4}% + \else\ifhint\figlink{##2} + \else##4\fi\fi\fi + }}\par + }% + \input\jobname.fig\relax + \iboxsize=3.9em\relax + \subindex{Tables} + \def\indexentry##1##2##3##4{% captype, fig/tab count, caption, page + \noindent + \line{\hbox to \iboxsize{% + \rm##1.~##2:\hfil}{\rm ##3}\ \leaders\hbox to .5em{.\hfil}% + \hfill\hbox to 1.4em{\hss + \ifbook##4\else + \ifpdf + \pagelnk{##4}% + \else\ifhint\tablink{##2} + \else##4\fi\fi\fi + }}\par + }% + \input\jobname.tab\relax + \makefigindex +} + + +\def\@wrfigindex#1#2#3#4{% file, captype, fig/tab count, caption + \xdef\gtempa{\write#1{\string\indexentry{#2}{#3}{#4}{\noexpand\thepageno}}}\endgroup\gtempa + \if@nobreak\ifvmode\@nobreak\fi\fi\@esphack} + +%% +%% Format Definitions +%% + +%\newbox\codebox +\newwrite\@getfile +\newwrite\@putfile +\newwrite\@redfile +\newwrite\@wrtfile + +\def\makecode{% + \immediate\openout\@getfile=\jobname.get\relax + \immediate\openout\@putfile=\jobname.put\relax + \immediate\openout\@redfile=\jobname.red\relax + \immediate\openout\@wrtfile=\jobname.wrt\relax + \typeout{Writing index files \jobname.get \jobname.put \jobname.red \jobname.wrt} +} + +\def\thecodeindex{% + \immediate\closeout\@getfile\relax + \immediate\closeout\@putfile\relax + \immediate\closeout\@redfile\relax + \immediate\closeout\@wrtfile\relax + \def\indexentry##1##2##3##4{% codecount, depth, pagenumber, section + \ifnum##2=0 \smallskip\vskip 0pt plus 12pt\penalty -100\vskip 0pt plus -12pt\fi + \noindent + \line{% + \ifnum##2=0##4\hfill + \else\qquad\rm##4\ \leaders\hbox to .5em{.\hfil}\hfill + \hbox to 1.4em{\hss\pagelnk{##3}} + \fi + }\par + }% + \section{Format Definitions} + \makeatletter + \subsection{Reading the Long Format}\label{codeindex} + \input\jobname.red.srt\relax + \subsection{Writing the Long Format} + \input\jobname.wrt.srt\relax + \subsection{Reading the Short Format} + \input\jobname.get.srt\relax + \subsection{Writing the Short Format} + \input\jobname.put.srt\relax +} + + +\newcount\codecount +\codecount=0 + +\ifhint +\def\@wrcodeindex#1#2#3#4{% file, depth, pagenumber, [sub]sectionname + \global\advance\indexcount by 1\indexdest + \xdef\gtempa{\write#1{\string\indexentry{#3}{#2}{\the\indexcount}{#4}}}\endgroup\gtempa\@esphack +} +\else +\def\@wrcodeindex#1#2#3#4{% file, depth, pagenumber, [sub]sectionname + \xdef\gtempa{\write#1{\string\indexentry{#3}{#2}{\noexpand\thepageno}{#4}}}\endgroup\gtempa\@esphack +} +\fi + +\def\getindex{\@bsphack\begingroup\@sanitize\@wrcodeindex\@getfile}% +\def\putindex{\@bsphack\begingroup\@sanitize\@wrcodeindex\@putfile}% +\def\redindex{\@bsphack\begingroup\@sanitize\@wrcodeindex\@redfile}% +\def\wrtindex{\@bsphack\begingroup\@sanitize\@wrcodeindex\@wrtfile}% + + +\def\codelabel#1#2#3{ + \getindex{#1}{#2}{#3}% + \putindex{#1}{#2}{#3}% + \redindex{#1}{#2}{#3}% + \wrtindex{#1}{#2}{#3}} +\def\getsymbol{$\cdots\Longrightarrow$} +\def\putsymbol{$\Longrightarrow\cdots$} +\def\redsymbol{$-{}-{}-{}\Longrightarrow$} +\def\wrtsymbol{$\Longrightarrow{}-{}-{}-$} +\def\getcode{\codesection{\getsymbol}{Reading the short format}\getindex{1}{\the\codecount}{\subcodetitle}} +\def\putcode{\codesection{\putsymbol}{Writing the short format}\putindex{1}{\the\codecount}{\subcodetitle}} +\def\writecode{\codesection{\wrtsymbol}{Writing the long format}\wrtindex{1}{\the\codecount}{\subcodetitle}} +\def\readcode{\codesection{\redsymbol}{Reading the long format}\redindex{1}{\the\codecount}{\subcodetitle}} +\newdimen\coderule +\def\codesection#1#2{% + \par\ifhmode\unskip\fi% end paragraph and remove vertical space + \penalty-200 + \vskip 0pt plus 72pt% allow some empty space at the bottom + \penalty-200 + \vskip 0pt plus -72pt% room for stetching and a page break +\vskip\abovesubsecskip% space above the subsection +%\line{\setbox0=\hbox{#1}% +%\coderule=\hsize\advance\coderule by -\wd0\advance\coderule by -2em% +%$\vcenter{\hrule width \coderule}$\hss\box0} +\line{{\it #2\/}:\hfill#1} +\nobreak\vskip\belowsubsecskip\nobreak% space after subsection +%\everypar{{\setbox0=\lastbox}\everypar{}}% no indentation in the next paragraph +%\noindent +\ignorespaces} + +\def\hascode{\global\advance\codecount by 1% +\codelabel{0}{\the\codecount}{\codetitle}}% + + +%% +%% Makeindex and the Index +%% + +\newwrite\@indexfile + +% new jobname for index file +\def\makeindex{ + \immediate\openout\@indexfile=\jobname.inx% + \def\index{\@bsphack\begingroup\@sanitize\@wrindex\@indexfile}% + \typeout{Writing index file \jobname.inx }% +} + +\def\@idxitem{\par\hangindent 40pt} + +\newif\ifnextindex +\nextindexfalse + +\def\beginindex{% +\ifhint\relax\else + \def\page{\box255} \normalbottom + \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\nomarginoutput{\vbox to\pageheight{\box\sbox\vss + \hbox to\pagewidth{\box\lbox\hfil\page}}}\lheader\rheader + \global\nextindextrue + \global\vsize\pageheight\gdef\lr{L}\global\pagesavedfalse\fi} +\fi +\message{Index:} +\mark{{0}{0}} +\noindent\par +\begingroup + \rightskip 0pt plus 12pt + \parskip 0pt plus .5pt + \hyphenpenalty 10000 \parindent0pt + \small\baselineskip=11pt +\def\item{\par\hangindent 40pt\relax\ifnextindex\mark{{Index}{Index}}\fi}% +\def\subitem{\par\hangindent 40pt\hskip 20pt\relax}% +\def\subsubitem{\par\hangindent 40pt\hskip 30pt\relax}% +\def\indexspace{\par\vskip 12pt plus 6pt minus 4pt\vskip 12pt\goodbreak\vskip -12pt\relax}% +\def\indexheading##1{{\tenbf ##1}\nobreak\vskip 3pt\relax} +} +\def\endindex{% +\endgroup + \vfill\eject % complete the current column. +\ifhint\relax\else + \if R\lr\null\vfill\eject\fi % if necessarry add a right column +\fi +} + + +%% +%% Label page, section, toccount, figure, table, code, enum +%% +\newcount\cdcount +\cdcount=0 + +\newdimen\labelskip +\def\label#1{% writes \labeldef{name}{{page}{section}{toccount}{figure}{table}{code}{enum}} to aux + \ifhint + \global\advance\indexcount by 1\indexdest + \begingroup\@readauxfile + \edef\next{\@writeaux{\string\labeldef{#1}{{\the\indexcount}% + {\thesection}{\the\toccount}{\the\figcount}{\the\tabcount}{\the\cdcount}{\the\enum}}}\endgroup}% + \else + \begingroup\@readauxfile + \edef\next{\@writeaux{\string\labeldef{#1}{{\noexpand\thepageno}% + {\thesection}{\the\toccount}{\the\figcount}{\the\tabcount}{\the\cdcount}{\the\enum}}}\endgroup}% + \fi + \ifvmode %make \removelastskip work after \label + \labelskip=\lastskip + \vskip-\labelskip + \next + \vskip\labelskip + \else + \next + \fi +} + + +\def\m@kelabel#1{label@#1}% this makes the controlseqence from the name + +\def\labeldef#1#2{% #1 is name #2 is page section subsection figure table code +\expandafter\gdef\csname\m@kelabel{#1}\endcsname{#2}}% + +\def\@setref#1#2#3{% + \ifx#1\relax + \message{Undefined reference: #3} + \else + \expandafter#2#1% + \fi} + +\def\@iofvii#1#2#3#4#5#6#7{#1} +\def\@iiofvii#1#2#3#4#5#6#7{#2} +\def\@iiiofvii#1#2#3#4#5#6#7{#3} +\def\@ivofvii#1#2#3#4#5#6#7{#4} +\def\@vofvii#1#2#3#4#5#6#7{#5} +\def\@viofvii#1#2#3#4#5#6#7{#6} +\def\@viiofvii#1#2#3#4#5#6#7{#7} + + +\def\pageref#1{\@readauxfile + \pagelnk{\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@iofvii{#1}}} +\def\secref#1{\@readauxfile + \sectionlink + {\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@iiofvii{#1}}% + {\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@iiiofvii{#1}}% +} +\def\figref#1{\@readauxfile +\figlink{\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@ivofvii{#1}}} +\def\tabref#1{\@readauxfile +\tablink{\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@vofvii{#1}}} +\def\cdref#1{\@readauxfile +\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@viofvii{#1}} +\def\enumref#1{\@readauxfile +\enumlink{\expandafter\@setref\csname\m@kelabel{#1}\endcsname\@viiofvii{#1}}} + +%% +%% Links and Destinations +%% + +\ifbook + \def\pdflinkcolor{0 0 0} % the RGB values for hyperlink color + \def\linkcolor{\Black} + \def\pdflink#1#2{#1} + \def\pdfnote#1.{#1} + \message{No PDF Links} +\else + \def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color + \def\linkcolor{\Blue} + \message{PDF Links are blue} +\fi + +\def\@esphack{\relax\ifhmode\spacefactor\@savsf + {}\ifdim \@savsk >\z@ \ignorespaces + \fi \fi} + +% +% Code destinations: by number +% + +%The number is set be \M and \N and stored as \secno +%The destination is set in \B where we go into C mode +\def\codedest{% +\ifbook\else +\ifhint\HINTdest num \thecode top\relax +\else\ifpdf\pdfdest num \thecode fith\relax +\else\relax +\fi\fi\fi +} +\def\coderef#1{% used in \X +\ifbook${}_{#1}$\else +\ifhint\HINTstartlink goto num #1 \hbox{${}_{#1}$}\HINTendlink +\else\ifpdf{\eightrm\pdfnote#1.} +\else${}_{#1}$\fi\fi\fi +} + +\def\codenote#1.{% replaces \pdfnote + \setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA} +% define the following like for pdf +\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\codelink{\the\toksC}{\romannumeral\the\toksC}}\toksC={}\global\countC=0} +\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} + +\def\codelink#1#2{ +\ifbook#1\else +\ifhint\HINTstartlink goto num #1 #1\HINTendlink +\else\ifpdf\pdflink{#1}{#2}% +\else#1% +\fi\fi\fi} + +% +% new destinations and links: by name +% + +\def\newdest#1{% used to make a new destination +%\message{New destination #1}% +\ifbook +\else\ifpdf + \pdfdest name {#1} fith%\message{Defining pdf label #1}% +\else\ifhint + \HINTdest name {#1}%\message{Defining HINT label #1}% +\fi\fi\fi} + +\def\newlink#1#2{% + \ifbook #2\else + \ifpdf + \pdfstartlink goto name {#1}\linkcolor#2\Black\pdfendlink + \else\ifhint + \HINTstartlink goto name {#1}#2\HINTendlink + \else + #2% + \fi\fi\fi +} + + +%SC.-\the\plaincount for plain sections +%SC.\thesection for regular sections, with subsections and letters for the appendix + +\def\tocref#1#2#3#4{% depth, title, page, label used in tocline + \ifbook#3\else + \ifpdf + \pdfstartlink goto name {SC.#4}\relax \linkcolor#3\Black\pdfendlink + \ifnum#1=0\pdfoutline goto name {SC.#4} {#2}\fi + \else\ifhint + \HINTstartlink goto name {SC.#4}\relax $\rightarrow$\HINTendlink + \HINToutline goto name {SC.#4} depth #1 {#2}% + \else + #3% + \fi\fi\fi +}% + +% +% Page references from the index +% + +% \index{keyword} -> \@wrindex{file}{keyword} writes the nectessary information +% makeindex produces the index and pages are enclosed in \hyperref{pagenumber} +% Problems: +% pagenumbers may be roman numerals in the frontmatter +% hyperpage has to cope with 6 different formats +% \hyperpage{50} a single page number +% \hyperpage{51, 52} two numbers +% \hyperpage{53--59} a page range +% \hyperpage{xi} a roman numeral +% \hyperpage{xi, xii} two numbers +% \hyperpage{xi--xx} a page range + + +% Writing the index file: in HINT replacing the page number by the index count +\newcount\indexcount +\def\theindexcount{\the\indexcount} + +\ifhint + \def\@wrindex#1#2{% file, keyword + \global\advance\indexcount by 1\indexdest + \immediate\write#1{\string + \indexentry{#2:hyperpage}{\the\indexcount}}\endgroup + \if@nobreak \ifvmode\@nobreak\fi\fi\@esphack} + \else + \def\@wrindex#1#2{% + \xdef\gtempa{\write#1{\string + \indexentry{#2:hyperpage}{\noexpand\thepageno}}}\endgroup\gtempa + \if@nobreak \ifvmode\@nobreak\fi\fi\@esphack} +\fi + + +% for HINT and PDF we used hyperrange and hypercomma to split the +% arguments into index/page numbers and then use pagelink +\ifbook + \def\hyperpage#1{#1}\else +\ifhint + \def\hyperpage#1{\hyperrange#1----+\relax} +\else\ifpdf + \def\hyperpage#1{\hyperrange#1----+\relax} +\else + \def\hyperpage#1{#1} +\fi\fi\fi + +%\def\indexlink#1{#1} + +\def\hyperrange#1--#2--#3+{% + \ifx\empty#2\empty% + \hypercomma#1, ,+% + \else\ifhint + \pagelnk{#1}--\pagelink{#2}{$\leftarrow$}% + \else + \pagelnk{#1}--\pagelnk{#2}% + \fi\fi} + +\def\hypercomma#1, #2,#3+{% + \ifx\empty#2\empty% + \pagelnk{#1}% + \else\ifhint% + \pagelink{#1}{$\longrightarrow$}% + \else + \pagelnk{#1}% +% I omit the second page number \ifpdf, \pagelnk{#2}\fi + \fi\fi +} + + +% +% Labels +% + +% section references from \secref use \sectionlink +% for plainsections, we display the label name because there +%is no section number. + +\def\sectionlink#1#2{% \message{Sectionlink #1 : #2}% + \ifbook#1\else + \ifpdf + \pdfstartlink goto name {SC.#2} \linkcolor#1\Black\pdfendlink + \else\ifhint + \HINTstartlink goto name {SC.#2}#1\HINTendlink + \else + #1% + \fi\fi\fi +} + + +% page references from \label and \pageref use \pagelink as before +\def\indexdest{\newdest{page.\the\indexcount}} +\def\pagelnk#1{% + \ifhint + \pagelink{#1}{$\rightarrow$}% + \else + \pagelink{#1}{#1}% + \fi +} +\def\pagelink#1#2{\newlink{page.#1}{#2}} +% For hint the destination is generated with each \index and \label +% Because of the roman numerals, for pdf files +% the pdf destination is generated in the header using \pagelabel + + +\ifbook\let\pagelabel=\relax\else +\ifpdf +\def\pagelabel{\pdfdest name {page.\thepageno} fitv\relax} +\else +\let\pagelabel=\relax +\fi\fi + +% references to Figures, Tables, Enumerations +\def\figdest{\newdest{FI.\the\figcount}} +\def\figlink#1{\newlink{FI.#1}{#1}} +\def\tabdest{\newdest{TA.\the\tabcount}} +\def\tablink#1{\newlink{TA.#1}{#1}} +\def\enumdest{\newdest{EN.\the\enum}} +\def\enumlink#1{\newlink{EN.#1}{#1}} + +% +% References to the bibliography +% +\def\citedest#1{\newdest{CI.#1}} +\def\citelink#1{%\message{Citelink #1}% + \newlink{CI.#1}{#1}} + +\def\bblhook{%defined before reading the .bbl file + \def\biblabelprint##1{% + \citedest{##1}% + \noindent + \hbox to \biblabelwidth{% + \biblabelprecontents + \biblabelcontents{##1}% + \biblabelpostcontents + }% + \kern\biblabelextraspace + }% +} +\def\@onecitation#1\@@{%called for each citation + \if@notfirstcitation + \printbetweencitations + \fi + % + \expandafter \ifx \csname\@citelabel{#1}\endcsname \relax + \if@citewarning + \message{\@linenumber Undefined citation `#1'.}% + \fi + % Give it a dummy definition: + \expandafter\gdef\csname\@citelabel{#1}\endcsname{% + {\tt + \escapechar = -1 + \nobreak\hskip0pt + \expandafter\string\csname#1\endcsname + \nobreak\hskip0pt + }% + }% + \fi + % Now produce the text, whether it was undefined or not. + \citelink{\csname\@citelabel{#1}\endcsname}% + \@notfirstcitationtrue +}% +%% +%% Images +%% + +\ifbook +\def\includefig#1{\leavevmode\hbox{\immediate\pdfximage{image/#1.pdf}\pdfrefximage\pdflastximage}} +\else\ifpdf +\def\includefig#1{\leavevmode\hbox{\immediate\pdfximage{image/#1.pdf}\pdfrefximage\pdflastximage}} +\else\ifhint + \def\includefig#1{\image=image/#1.png\relax} +\else + \input epsf.tex + \def\includefig#1{\epsfbox{image/#1.eps}}% this is a \leavevmode\hbox{...} +\fi\fi\fi + +\ifhint\eject\fi% hitex will remove empty pages that were introduced by cwebmac +\makeatother + + + + + + + diff --git a/Master/texmf-dist/doc/hitex/base/hitexman.hnt b/Master/texmf-dist/doc/hitex/base/hitexman.hnt new file mode 100644 index 00000000000..f0e843bfa78 Binary files /dev/null and b/Master/texmf-dist/doc/hitex/base/hitexman.hnt differ diff --git a/Master/texmf-dist/doc/hitex/base/hitexman.pdf b/Master/texmf-dist/doc/hitex/base/hitexman.pdf new file mode 100644 index 00000000000..6f96282e501 Binary files /dev/null and b/Master/texmf-dist/doc/hitex/base/hitexman.pdf differ diff --git a/Master/texmf-dist/doc/hitex/base/hitexman.tex b/Master/texmf-dist/doc/hitex/base/hitexman.tex new file mode 100644 index 00000000000..2c58f877c47 --- /dev/null +++ b/Master/texmf-dist/doc/hitex/base/hitexman.tex @@ -0,0 +1,707 @@ +% This file is part of HINT +% Copyright 2017-2021 Martin Ruckert, Hochschule Muenchen, Lothstrasse 64, 80336 Muenchen +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the "Software"), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be +% included in all copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +% WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT +% OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +% THE SOFTWARE. +% +% Except as contained in this notice, the name of the copyright holders shall +% not be used in advertising or otherwise to promote the sale, use or other +% dealings in this Software without prior written authorization from the +% copyright holders. + +\input cwebmac +\input hint.sty + +\makeindex +\maketoc + +\titletrue +\pageno=-2 + +\def\lastrevision{${}$Revision: 2541 ${}$} +\def\lastdate{${}$Date: 2021-10-26 09:03:28 +0200 (Tue, 26 Oct 2021) ${}$} + +\font\largetitlefont=cmssbx10 scaled\magstep4 +\font\Largetitlefont=cmssbx10 at 40pt +\font\hugetitlefont=cmssbx10 at 48pt +\font\smalltitlefontit=cmbxti10 scaled\magstep3 +\font\smalltitlefont=cmssbx10 scaled\magstep3 + +\hbox{} +\vskip 0pt plus 1fill +{ + \baselineskip=1cm\parindent=0pt + \largetitlefont\raggedright Hi\TeX\par + \vskip 10pt plus 0.3fill + \leftline{\smalltitlefont User Manual} + \vskip-3pt + \vskip 10pt plus 0.3fill + \hskip 0pt plus 2fill \it F\"ur Beatriz\hskip 0pt plus 0.5fill\hbox{} + \vskip 10pt plus 3fill + \leftline{\smalltitlefont Version 1.1 (Draft)} + \bigskip + \raggedright\baselineskip=12pt + \bf MARTIN RUCKERT \ \it Munich University of Applied Sciences\par + \bigskip + \lastdate, \lastrevision\par + \smallskip +} +{\raggedright\advance\rightskip 3.5pc +\def\:{\discretionary{}{}{}} +\noindent +Internet page {\tt http:\://hint.\:userweb.\:mwn.\:de/\:hint/\:format.html} +may contain current information about this book, downloadable software, +and news. + +\smallskip +\noindent +Copyright $\copyright$ 2022 by Martin Ruckert +\smallskip +} +\frontmatter +\pageno=-1 + +\tableofcontent + +\mainmatter + +\def\rs{\hskip 2pt plus 3pt minus 2pt\penalty0\relax} +\def\rule#1:#2.{\par{\hangindent32pt\hangafter1\parindent0pt\rightskip 0pt plus 60pt#1{\bf:}\quad% + \hskip 0pt plus 60pt\penalty-300\hskip 0pt plus -60pt#2{\bf.}\par}} +\def\sym#1{\rs$<${\it #1\/}$>$\rs} +\def\OR{\rs${}\vert{}$\rs} +\def\opt#1{\rs$[{}$#1${}]$\rs} +\def\cs#1{\.{\BS #1}} + +\section{Hi\TeX\ primitives} + +While currently Hi\TeX\ is the only \TeX\ engine that supports output in the \HINT\ file +format, this might not be so forever. To avoid unnecessary complications for +package writers, it is strongly suggested that all such \TeX\ engines implement +the same primitives according to the same specification. The following is the first +draft of this specification. All the primitives use {\tt HINT} as a prefix to +avoid name conflicts. The prefix {\tt HINT}, as opposed to e.g. {\tt HiTeX}, +was chosen to stress the idea that these primitives are specific for the +output format---not for the \TeX\ engine. + +Because this is the first specification that will reach a wider user base, +it is reasonable to expect changes to occur in the future. Therefore it is +recommended that these primitives should not be used directly in a +\TeX\ document; instead they should be encapsulated in suitable +macros so that the consequences of any change to the primitives will +be local to these macros. + +\subsection{Syntax Description} +In the following, we describe the syntax of primitive control sequences which were +added to \TeX. + +\itemize +\item We use a {\tt typewriter font}\index{typewriter font} +for text that occurs \index{verbatim}verbatim in the \TeX\ document. +\item We use \sym{italics} enclosed in pointed brakets to denote symbols\index{symbol+\sym{symbol}}. +\item We use rules\index{rule} to define the meaning of symbols. +A rule starts with the symbol +to be explained, followed by a colon ``{\bf :}'', and then the text that this symbol +stands for. A rule ends with a period ``{\bf .}''. +\item Optional\index{optional+\opt{optional}} parts of the rule's text +are enclosed in \opt{square brackets}. +\item Alternatives\index{alternative} are seperated by a vertical bar ``\OR''\index{\OR}. +\item Some symbols refere to text that is defined as part of standard \TeX. These are explained here by an example: + +\medskip +\rule\sym{integer}: \index{integer+\sym{integer}} + an integer as in \cs{penalty}\sym{integer}. +\rule\sym{normal dimension}:\index{normal dimension+\sym{normal dimension}} + a dimension as in \cs{hrule} \.{width} \sym{normal dimension}. +\rule\sym{dimension}:\index{dimension+\sym{dimension}} + a dimension as in \cs{vskip} \.{0pt} \.{plus} \sym{dimension}. +\rule\sym{name}:\index{dimension+\sym{dimension}} + a name as in \cs{input} \sym{name}. +\rule\sym{vertical list}:\index{vertical list+\sym{vertical list}} + a token list with matching braces as in + \cs{vbox}\.{\LB}\sym{vertical list}\.{\RB}. +\rule\sym{horizontal list}:\index{horizontal list+\sym{horizontal list}} + a token list with matching braces as in + \cs{hbox}\.{\LB}\sym{horizontal list}\.{\RB}. +\rule\sym{general text}:\index{general text+\sym{general text}} + a token list with matching braces as in + \cs{write}\.{\LB}\sym{general text}\.{\RB}. +\medskip +\enditemize + +\subsection{Version and Revision} +The control sequences \cs{HINTversion}\index{HINTversion+\cs{HINTversion}} +and \cs{HINTsubversion}\index{HINTsubversion+\cs{HINTsubversion}} are +used to determine the version and subversion numbers of the HINT output format +that is generated by Hi\TeX. It can be used as part of the output as +in \verbatim|\the\HINTversion|. +The most important use, however, is testing whether the current \TeX\ engine +will in fact produce \HINT\ output. +As an example the file {\tt ifhint.tex}\index{ifhint.tex+{\tt ifhint.tex}} +contains the following code: + + +\verbatim/ +\newif\ifhint +\expandafter\ifx\csname HINTversion\endcsname\relax + \hintfalse\else\hinttrue\fi/ + + +\subsection{Images} +The primitive \cs{HINTimage}\index{HINTimage+\cs{HINTimage}} +includes an image\index{image} in a document. +The syntax is as follows: + +\medskip +\cs{HINTimage} \opt{\.{=}} \sym{name} +\opt{\sym{width}} \opt{\sym{height}} +\medskip + +The optional equal sign can be added to make the code look nicer. +The \sym{name} specifies the image file. +The width specification determines the width of the image. If omitted, +Hi\TeX\ tries to determine the image's width from the image file. +The same holds for the height specification. + +\medskip +\rule \sym{width}\index{width+\sym{width}}:\.{width} \sym{normal dimension}. +\rule \sym{height}\index{height+\sym{height}}:\.{height} \sym{normal dimension}. +\medskip + +Note that a \sym{normal dimension} that is computed from \cs{hsize} +or \cs{vsize} retains this dependency when processed by Hi\TeX. +This allows an image to adapt to the size of the viewing area. +Scaling in the \HINT\ viewer will, however, never change the +aspect ratio of an image. So it may become smaller or larger, +but it will never be distorted. +For this reason, Hi\TeX\ will inspect the image file to determine the +aspect ratio\index{aspect ratio} of the stored image. +The width and height values as given in the \TeX\ file serve +as the maximum values for the actual width and height. When rendering, +the image will become as large as possible within the given bounds. +If \TeX\ does not specify neither width nor height, the image file +must specify the absolute width and height of the image. +It is considered an error if valid settings for the image's width and height +can not be obtained. + +\subsection{Links, Labels, and Outlines} +A link\index{link} in a \HINT\ document refers to another location in the same document. +It can be used to navigate to that location. +A link is defined using the primitives +\cs{HINTstartlink}\index{HINTstartlink+\cs{HINTstartlink}} +and \cs{HINTendlink}\index{HINTendlink+\cs{HINTendlink}}. +Neither of them can be used in vertical mode. +The text between the start and the end of the link +constitutes the visible part of the link. Depending on the user interface, clicking +or tapping or otherwise activating the link (e.g. pronouncing) +will navigate to the destination of the link. +The user interface might provide a visual clue to make the user aware of the +available links but it also may choose to leave the visual clues to the author +of the document (e.g. using a special image or a special font). + +The syntax is +\cs{HINTstartlink} \sym{destination} +and +\cs{HINTendlink} +with + +\medskip +\rule \sym{destination}\index{destination+\sym{destination}}:\.{goto} \sym{label}. +\rule \sym{label}\index{label+\sym{label}}: + \.{name} \.{\LB}\sym{general text}\.{\RB} \OR\ \.{num} \sym{integer}. +\medskip + +As you can see, the link refers to its destination using a label +which is either a name or a number. +The destination can be defined by using the +\cs{HINTdest}\index{HINTdest+\cs{HINTdest}} primitive. +Forward and backward links are allowed; the definition of a lable can either +preceede or follow the use of the label. If at the end of the document a label +is undefined, a warning is given, and the label will reference the beginning of the +document. + +The syntax is +\cs{HINTdest} \sym{label} \opt{\sym{placement}} +with + +\medskip +\rule\sym{placement}\index{placement+\sym{placement}}: +\.{top}\index{top+{\tt top}} \OR\ \.{bot}\index{bot+{\tt bot}}. +\medskip + +The optional placement argument specifies how to build the page +containing the destination location. \.{top} demands +a page starting with the destination location. This is useful +if the destination is for example the start of a section or chapter heading. +Similarly \.{bot} asks for a page that ends with the destination location. +The most common case is to omit the placement argument. In this case, the +viewer will build a ``good'' page that includes the given destination. +In case of a section heading, for example, it will most probably start the +page with the section heading because section headings are usually preceded +by a negative penalty that will convince the page builder that this is a good +place to break the page. But if the section heading is immediately preceded +by a chapter heading, the negative penalty found there will probably +persuade the page builder to start with the chapter heading instead. + +There is a special label that has the form +\.{name} \.{\LB}\.{HINT.home}\.{\RB}\index{HINT.home+{\tt HINT.home}}. +It is used to mark the ``home page''\index{home page} of the document. User interfaces +are encouraged to offer a button or keyboard shortcut to navigate to the +document location labeled this way. The page should be a convenient +starting point to explore the document. The typical place for this label +would be the documents table of content. + +The labels that identify destinations in a document can also be used +to define document outlines. A document outline\index{outline} is a document summary +given as a hierarchical list of headings where each of them +refers to a specific location in the document. + +The syntax is +\cs{HINToutline}\index{HINToutline+\cs{HINToutline}} +\sym{destination} \opt{\sym{depth}} \.{\LB}\sym{horizontal list}\.{\RB}. + +\medskip +\rule \sym{depth}\index{depth+\sym{depth}}: \.{depth} \sym{integer}. +\medskip + +The user interface can format the \sym{horizontal list} much like +a \cs{hbox} would do and displays it to the user. When the user selects +this text, the document will be repositioned to show the destination location +in the same way as with a link. In order to support also simpler +user interfaces, the current \HINT\ backend also extracts the characters +(and spaces) from the horizontal list (in top-left to bottom-right order) +and makes this character string available to the user interface. + + +The order in which outline items are defined is important because +this is the order in which they will be presented to the reader of the +document. The optional depth argument allows to structure +the list of outline items as a hierarchy. Outline items with a higher depth value are considered to be sub-items of items earlier in the list with lower +depth values. If no depth value is given, the depth value is set to zero. +It is not necessary to define depth values strictly consecutive. + + +\subsection{Page Templates and Streams}\index{page template}\index{stream} + +To produce the final page, \TeX\ uses a special piece of program +called the output routine\index{output routine}. Because a \HINT\ +file is pure data, it can not contain output routines. Instead it +uses page templates to assemble pages from the main text, footnotes, +floating illustrations, and other material. I start here by +describing how \HINT's page templates work and the special syntax used +to specify them in a \TeX\ file that is about to be processed with +Hi\TeX. For those interested in how the design decision was made and +how page templates relate to \TeX's page building mechanism, a +separate section follows at the end. + +The syntax of a page template specification is: +\cs{HINTsetpage}\index{HINTsetpage+\cs{HINTsetpage}} +\sym{integer} \opt{\.{=}} \sym{name} +\opt{\sym{priority}} \opt{\sym{width}} \opt{\sym{height}} +\.{\LB}\sym{vertical list} \sym{stream definition list}\.{\RB} + + +The \sym{integer} specifies the page templates number in the range 1 +to 255. The number 0 is reserved for the build in page template of +the \HINT\ file format, which is used if no other page template has +been defined. The page template 0 can not be redefined. +The \sym{name} associates a name with the page template. The name can +be displayed by the \HINT\ viewer to help the user selecting a +suitable page template. + +After the name follows an optional priority; it is used to select the +``best page template'' if multiple templates are available. The +default value is~1. The build-in template has priority~0. + +\medskip +\rule\sym{priority}\index{priority+\sym{priority}}: {\tt priority} \sym{integer}. +\medskip + + +After that follows an optional width and height of the full page +including the margins. After subtracting \cs{hsize} from the width +and \cs{vsize} from the height, the remainder is used for the margins +around the displayed text. For example giving the width as +1.2\cs{hsize} will leave 0.1\cs{hsize} for the margins on both sides. +In this case the margins will grow together with the available width +of the display. If the width is computed by adding 20pt +to \cs{hsize}, the margin will be 10pt on both sides. In this case +the margin will not grow with the size of the display, but it will +grow with the magnification factor. Of course both methods can be +used together. The default is \cs{hsize} for the width and \cs{vsize} +for the height so there are no margins. + +The following \sym{vertical list} defines the page itself. It should assign suitable values +to \cs{topskip} and \cs{maxdepth} because the values valid at the end of the vertical list +are stored in the page template and are used in the page building process. +The vertical list usually also specifies the insertion of content streams using a \sym{stream insert point}. + +\medskip +\rule\sym{stream insert point}\index{stream insert point+\sym{stream insert point}}: + \cs{HINTstream} \sym{integer}. +\medskip + +Here the \sym{integer} must be in the range 0 to 254. The value 255 is invalid; +the value 0 indicates the main body of text (what \TeX's page builder would normally put into +box 255 before calling the output routine). +Otherwise, the \sym{integer} is TeX's insertion number, that is the number of \TeX's box +containing the insertions. As usual, this box is filled using \TeX's \cs{insert} primitive. +So after plain \TeX\ has defined \cs{footins}, +the footnotes for the current page can be inserted after the main body of text in the \sym{vertical list} +by saying \cs{HINTstream}\.0 followed by \cs{HINTstream}\cs{footins}. +Of course you might want to have a footnote rule and a small skip to separate the +footnotes ---if there are any---from the main text. This can be achieved by a suitable +\sym{stream definition} in the \sym{stream definition list}. + +\medskip +\rule\sym{stream definition list}\index{stream definition list+\sym{stream definition list}}: + \OR\ \sym{stream definition list} \sym{stream definition}. +\rule\sym{stream definition}\index{stream definition+\sym{stream definition}}: + \cs{HINTsetstream} \sym{integer} \opt{\.{=}} +\opt{{\tt preferred} \sym{integer}} +\opt{\.{next} \sym{integer}} +\opt{\.{ratio} \sym{integer}} \.{\LB}\sym{vertical list}\.{\RB}. +\medskip + + +The first \sym{integer} is the streams insertion number $i$, +and it must match the \sym{integer} +previously used in the \sym{stream insert point}. +Then follows the optional specification of a prefered stream with insertion number $p$, +a next stream with insertion number $n$, and a split ratio $r$. +If $r>0$, the contributions to stream $i$ are split between +stream $p$ and $n$ in the ratio $r/1000$ for $p$ and $1-r/1000$ for $n$ +before contributing streams $p$ and $r$ to the page. +Else if $p\ge0$ any insertion to stream $i$ is moved to stream $p$ as long as possible, +and if $n\ge0$ we move an insert to stream $n$ if there is ``no room left'' in $p$ nor in $i$. +How much ``room'' is available for the insertions is specified inside the vertical list +that follows. +Here \cs{dimen}$i$ should be set to the maximum total height of the insertions in class $i$ per page. +\cs{count}$i$ should be set to the magnification factor $f$, +such that inserting a box of height $h$ will contribute $h*f/1000$ to the main page; +and \cs{skip}$i$ should be set to the extra space needed if an insertion in class $i$ is present. + +This extra space is usually taken up by material that is inserted before and after the insertions, +such as for example the footnote rule. This material can be defined by a +\sym{before list} and an \sym{after list}. + +\medskip\index{HINTbefore+\cs{HINTbefore}}\index{HINTafter+\cs{HINTafter}} +\rule \sym{before list}\index{before list+\sym{before list}}: + \cs{HINTbefore} \opt{\.{=}} \.{\LB}\sym{vertical list}\.{\RB}. +\rule \sym{after list}\index{after list+\sym{after list}}: + \cs{HINTafter} \opt{\.{=}} \.{\LB}\sym{vertical list}\.{\RB}. +\medskip + +If you are interested in the design decision that motivate the definitions that have +be given in this section, you should read the next section. + + +\section{Replacing \TeX's Page Builder} + +\TeX\ uses an output\index{output routine} routine to finalize the page. +The output outine takes the material which the page builder had accumulated in {\tt box255} +and attaches headers, footers, and floating material +like figures, tables, and footnotes. The latter material is specified by insert nodes +while headers and footers are often constructed using mark nodes. +Running an output routine requires the full power of the \TeX\ engine and is not +part of the \HINT\ viewer. Therefore, \HINT\ replaces output routines by page templates\index{template}. +\TeX\ can use different output routines for different parts of a book---for example +the index might use a different output routine than the main body of text. + +\TeX\ uses insertions to describe floating content that is not necessarily displayed +where it is specified. Three examples may illustrate this: +\itemize +\item Footnotes\footnote*{Like this one.} are specified in the middle of the text but are displayed at the +bottom of the page. Several +footnotes\index{footnote} on the same page are collected and displayed together. The +page layout may specify a short rule to separate footnotes from the +main text, and if there are many short footnotes, it may use two columns +to display them. In extreme cases, the page layout may demand a long +footnote to be split and continued on the next page. + +\item Illustrations\index{illustration} may be displayed exactly where specified if there is enough +room on the page, but may move to the top of the page, the bottom of the page, +the top of next page, or a separate page at the end of the chapter. + +\item Margin notes\index{margin note} are displayed in the margin on the same page starting at the top +of the margin. +\enditemize + +\HINT\ uses page templates and content streams to achieve similar effects. +But before I describe the page building\index{page building} mechanisms of \HINT, +let me summarize \TeX's page builder. + +\subsection{\TeX's page building mechanism} +\TeX's page builder ignores leading glue\index{glue}, kern\index{kern}, +and penalty\index{penalty} nodes until the first +box\index{box node} or rule\index{rule node} node is encountered; +whatsit\index{whatsit node} nodes do not really contribute anything to +a page; mark\index{mark node} nodes are recorded for later use. Once +the first box, rule, or insert\index{insert node} arrives, \TeX\ makes +copies of all parameters that influence the page building process and +uses these copies. These parameters are the \.{page\_goal} and the +\.{page\_max\_depth}. Further, the variables {\tt page\_total}, {\tt page\_shrink}, +{\tt page\_stretch}, {\tt page\_depth}, and {\tt in\-sert\_pe\-nal\-ties} are +initialized to zero. The top skip\index{top skip} adjustment is made +when the first box or rule arrives---possibly after an insert. +Now the page builder accumulates material: normal material goes +into {\tt box255}\index{box 255} and will change {\tt page\_total}, {\tt page\_shrink}, +{\tt page\_stretch}, and {\tt page\_depth}. The latter is adjusted so that +is does not exceed {\tt page\_max\_depth}. + +The handling of inserts\index{insert node} is more complex. +\TeX\ creates an insert class using {\tt newinsert}. This reserves a number $i$ +and four registers: {\tt box\hair$i$} for the inserted material, +{\tt count\hair$i$} for the magnification factor $f$, {\tt dimen\hair$i$} +for the maximum size per page $d$, and {\tt skip\hair$i$} for the +extra space needed on a page if there are any insertions of class $i$. + +For example plain \TeX\ allocates $n=254$ for footnotes\index{footnote} and sets +{\tt count254} to~$1000$, {\tt dimen254} to 8in, and {\tt skip254} to {\tt \BS big\-skip\-amount}. + +An insertion node will specify the insertion class $i$, some vertical material, +its natural height plus depth $x$, a {\tt split\-\_top\-\_skip}, a {\tt split\-\_max\_depth}, +and a {\tt floa\-ting\-\_pe\-nal\-ty}. + + +Now assume that an insert node with subtype 254 arrives at the page builder. +If this is the first such insert, \TeX\ will decrease the {\tt page\_goal} +by the width of {\tt skip254} and adds its stretchability and shrinkability +to the total stretchability and shrinkability of the page. Later, +the output routine will add some space and the footnote rule to fill just that +much space and add just that much shrinkability and stretchability to the page. +Then \TeX\ will normally add the vertical material in the insert node to +{\tt box254} and decrease the {\tt page\_goal} by $x\times f/1000$. + +Special processing is required if \TeX\ detects that there is not enough space on +the current page to accommodate the complete insertion. +If already a previous insert did not fit on the page, simply the {\tt floating\_penalty} +as given in the insert node is added to the total {\tt insert\_penalties}. +Otherwise \TeX\ will test that the total natural height plus depth of {\tt box254} +including $x$ does not exceed the maximum size $d$ and that the +${\tt page\_total} + {\tt page\_depth} + x\times f/1000 - {\tt page\_shrink} \le {\tt page\_goal}$. +If one of these tests fails, the current insertion +is split in such a way as to make the size of the remaining insertions just pass the tests +just stated. + +Whenever a glue node, or penalty node, or a kern node that is followed by glue arrives +at the page builder, it rates the current position as a possible end of the page based on +the shrinkability of the page and the difference between {\tt page\_total} and {\tt page\_goal}. +As the page fills, the page breaks tend to become better and better until the +page starts to get overfull and the page breaks get worse and worse until +they reach the point where they become {\tt awful\_bad}. At that point, +the page builder returns to the best page break found so far and fires up the +output routine. + + +\subsection{\HINT\ Page Templates} +Let's look at the problems that show up when implementing a replacement for \TeX's +page building mechanism. + +\enumerate +\item +An insertion node can not always specify its height $x$ because insertions may contain paragraphs that need +to be broken in lines and the height of a paragraph depends in some non obvious way on +its width. + +\item +Before the viewer can compute the height $x$, it needs to know the width of the insertion. Just imagine +displaying footnotes in two columns or setting notes in the margin. Knowing the width, it +can pack the vertical material and derive its height and depth. + +\item +\TeX's plain format provides an insert macro that checks whether there is still space +on the current page, and if so, it creates a contribution to the main text body, otherwise it +creates a {\tt topinsert}. Such a decision needs to be postponed to the \HINT\ viewer. + +\item +\HINT\ has no output routines that would specify something like the space and the rule preceding the footnote. + +\item +\TeX's output routines have the ability to inspect the content of the boxes, +split them, and distribute the content over the page. +For example, the output routine for an index set in two column format might +expect a box containing index entries up to a height of $2\times\.{vsize}$. +It will split this box in the middle and display the top part in the left +column and the bottom part in the right column. With this approach, the +last page will show two partly filled columns of about equal size. + +\item +\HINT\ has no mark nodes that could be used to create page headers or footers. +Marks, like output routines, contain token lists and need the full \TeX\ interpreter +for processing them. Hence, \HINT\ does not support mark nodes. +\endenumerate + + +Instead of output routines, \HINT\ uses page templates. +Page templates are basically vertical boxes with \sym{stream insert points} marking the +positions where the content of the box registers, filled by the page builder, +should appear. +To output the page, the viewer traverses the page template, +replaces the placeholders by the appropriate box content, and +sets the glue. + +It is only natural to treat the page's main body, +inserts, and marks using the same mechanism. We call this +mechanism a content stream\index{stream}. +Content streams are identified by a stream number in the range 0 to 254; +the number 255 is used to indicate an invalid stream number. +The stream number 0 is reserved for the main content stream; it is always defined. + +\medskip +{\small \advance \leftskip by 30pt \advance \rightskip by 30pt +It is planed to implement a replacement for \TeX's mark nodes using +different types of streams: +\itemize +\item normal streams correspond to \TeX's inserts and accumulate content on the page, +\item first\index{first stream} streams correspond to \TeX's first marks and will contain only the first insertion of the page, +\item last\index{last stream} streams correspond to \TeX's bottom marks and will contain only the last insertion of the page, and +\item top\index{top stream} streams correspond to \TeX's top marks. Top streams are not yet implemented. +\enditemize +\medskip +} + +Nodes from the content section are considered contributions to stream~0 except +for insert nodes which will specify the stream number explicitly. +If the stream is not defined or is not used in the current page template, its content is simply ignored. + +The page builder needs a mechanism to redirect contributions from one content +stream to another content stream based on the availability of space. +Hence a \HINT\ content stream can optionally specify a preferred stream number, +where content should go if there is still space available, a next stream number, +where content should go if the present stream has no more space available, and +a split ratio if the content is to be split between these two streams before +filling in the template. + +Various stream parameters govern the treatment of contributions to the stream +and the page building process. + +\itemize +\item The magnification factor $f$: Inserting a box of height $h$ to this stream will contribute $h\times f/1000$ +to the height of the page under construction. For example, a stream +that uses a two column format will have an $f$ value of 500; a stream +that specifies notes that will be displayed in the page margin will +have an $f$ value of zero. + +\item The height $h$: The extended dimension $h$ gives the maximum height this +stream is allowed to occupy on the current page. +To continue the previous example, a stream that will be split into two columns +will have $h=2\cdot\.{vsize}$ , and a stream that specifies +notes that will be displayed in the page margin will have +$h=1\cdot\.{vsize}$. You can restrict the amount of space occupied by +footnotes to the bottom quarter by setting the corresponding $h$ value +to $h=0.25\cdot\.{vsize}$. + +\item The depth $d$: The dimension $d$ gives the maximum depth this +stream is allowed to have after formatting. + +\item The width $w$: The extended dimension $w$ gives the width of this stream +when formatting its content. For example margin notes +should have the width of the margin less some surrounding space. + +\item The ``before'' list $b$: If there are any contributions to this +stream on the current page, the material in list $b$ +is inserted {\it before\/} the material from the stream itself. For +example, the short line that separates the footnotes from the main +page will go, together with some surrounding space, into the list~$b$. + +\item The top skip glue $g$: This glue is inserted between the material +from list $b$ and the first box of the stream, reduced +by the height of the first box. Hence it specifies the distance between +the material in $b$ and the first baseline of the stream content. + +\item The ``after'' list $a$: The list $a$ is treated like list $b$ but +its material is placed {\it after\/} the material from the stream itself. + +\item The ``preferred'' stream number $p$: If $p\ne 255$, it is the number of +the {\it preferred\/} stream. If stream $p$ has still +enough room to accommodate the current contribution, move the +contribution to stream $p$, otherwise keep it. For example, you can +move an illustration to the main content stream, provided there is +still enough space for it on the current page, by setting $p=0$. + +\item The ``next'' stream number $n$: If $n\ne 255$, it is the number of the +{\it next\/} stream. If a contribution can not be +accommodated in stream $p$ nor in the current stream, treat it as an +insertion to stream $n$. For example, you can move contributions to +the next column after the first column is full, or move illustrations +to a separate page at the end of the chapter. + +\item The split ratio\index{split ratio} $r$: If $r$ is positive, both $p$ and $n$ must +be valid stream numbers and contents is not immediately moved to stream $p$ or $n$ as described before. +Instead the content is kept in the stream itself until the current page is complete. +Then, before inserting the streams into the page template, the content of +this stream is formatted as a vertical box, the vertical box is +split into a top fraction and a bottom fraction in the ratio $r/1000$ +for the top and $(1000-r)/1000$ for the bottom, and finally the top +fraction is moved to stream $p$ and the bottom fraction to stream +$n$. You can use this feature for example to implement footnotes +arranged in two columns of about equal size. By collecting all the +footnotes in one stream and then splitting the footnotes with $r=500$ +before placing them on the page into a right and left column. Even +three or more columns can be implemented by cascades of streams using +this mechanism. +\enditemize + +\HINT\ allows multiple page templates but Hi\TeX\ currently does not implement +restricting them to individual page ranges and the viewer selects +the page template with the highest priority. To support different output media, the page +templates are named and a suitable user interface may offer the user a selection +of possible page layouts. In this way, the page layout remains in the hands of the +book designer, and the user has still the opportunity to pick a layout that best fits +the display device. + +The build-in page template with number 0 is always defined and has priority 0. +It will display just the main content stream. It puts a small margin +of $\.{hsize}/8 -4.5\hbox{pt}$ all around it. +Given a letter size page, 8.5 inch wide, this formula yields a margin of 1 inch, +matching \TeX's plain format. The margin will be positive as long as +the page is wider than $1/2$ inch. For narrower pages, there will be no +margin at all. In general, the \HINT\ viewer will never set {\tt hsize} larger +than the width of the page and {\tt vsize} larger than its height. + +%8.5 in should give 1 inch margin 2/17 +%612pt should give 72pt margin +%72pt = 612/8-4.5pt +%This would give a positive margin starting at 36pt or 1/2 inch + + +%\appendix + +%\plainsection{References} + +%{\baselineskip=11pt +%\def\bfblrm{\small\rm}% +%\def\bblem{\small\it}% +%\bibliography{../hint} +%\bibliographystyle{plain} +%} + +\plainsection{Index} +{ +\def\_{{\tt \UL}} % underline in a string +\catcode`\_=\active \let_=\_ % underline is a letter +\input hitexman.ind +} + +\write\cont{} % ensure that the contents file isn't empty +% \write\cont{\catcode `\noexpand\@=12\relax} % \makeatother +\closeout\cont% the contents information has been fully gathered +\inx +\fin +\end diff --git a/Master/texmf-dist/doc/hitex/base/verbatim.tex b/Master/texmf-dist/doc/hitex/base/verbatim.tex new file mode 100644 index 00000000000..ed2aa700b9c --- /dev/null +++ b/Master/texmf-dist/doc/hitex/base/verbatim.tex @@ -0,0 +1,48 @@ +% F I L E V E R B A T I M . T E X +% +% THIS SET OF MACROs IS TAKEN FROM D.E.K.'s TeXBook +% AND PROVIDES AN EASY WAY OF TYPESETTING TEXTS VERBATIM: +% +% 1. \verbatim +% causes the text to be set verbatim using \tt font; +% 2. if the text uses up all the alphabet, \doubleverbatim macro +% can be used instead; this is similar to the previous one but +% a pair of characters is now used as a delimiter; +% 3. in case of emergency \tripleverbatim macro may be of help... +% +%--------------------------------------------- +\def\uncatcodespecials % see D.E.K., pp. 344 and 380 + {\def\do##1{\catcode`##1=12}\dospecials}% +%--------------------------------------------- +{\catcode`\^^I=\active \gdef^^I{\ \ \ \ }% TAB character is replaced by + % 4 spaces; it is better than + % nothing, but it does not mimic + % true tabbing satisfactorily---maybe + % some nice day... + \catcode`\`=\active\gdef`{\relax\lq}}% this line inhibits Spanish + % ligatures ?` and !` of \tt font +\def\setupverbatim % see D.E.K., p. 381 + {\tt % + \spaceskip=0pt \xspaceskip=0pt % just in case... + \catcode`\^^I=\active % + \catcode`\`=\active % + \def\par{\leavevmode\endgraf}% this causes that empty lines aren't + % skipped + \obeylines \uncatcodespecials \obeyspaces}% +{\obeyspaces \global\let =\ }% this causes that leading blanks aren't + % skipped; cf. also def's of \space, \endgraf, + % \lq, \obeyspaces, and \obeylines, + % D.E.K., pp. 351--352 +%--------------------------------------------- +% see D.E.K., p. 382 +\def\doverbatim#1{\def\next##1#1{##1\endgroup}\next}% +\def\verbatim{\begingroup\setupverbatim\doverbatim}% +%---------- +\def\dodoubleverbatim#1#2{\def\next##1#1#2{##1\endgroup}\next}% +\def\doubleverbatim{\begingroup\setupverbatim\dodoubleverbatim}% +%---------- +\def\dotripleverbatim#1#2#3{\def\next##1#1#2#3{##1\endgroup}\next}% +\def\tripleverbatim{\begingroup\setupverbatim\dotripleverbatim}% +%--------------------------------------------- +\endinput + -- cgit v1.2.3