% $Id: wripro.tex 1558 2024-09-24 17:22:45Z karl $ % Used in tex4ht.sty. Not installed in runtime. % % Copyright 2009-2024 TeX Users Group % Copyright 1996-2009 Eitan M. Gurari % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3c of this license or (at your option) any % later version. The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions % of LaTeX version 2005/12/01 or later. % % This work has the LPPL maintenance status "maintained". % % The Current Maintainer of this work % is the TeX4ht Project . % % If you modify this program, changing the % version identification would be appreciated. \immediate\write-1{version 2024-09-23-15:43} %\openin15= wripro.tex %\ifeof15 \closein15 \else \closein15 \input wripro.tex \fi \Section{Root Point} \<<< \ifx\html:addr\:UnDeF | \Htmltrue \fi >>> \ifalprotex \<<< | | | >>> \fi \<<< | >>> \SubSection{Directory for Files} \<<< \writesixteen{--- needs --- tex4ht \jobname\space ---}% >>> \<<< \ifx\HDir\:UnDef \let\HDir=\empty \fi \let\:HDir=\HDir \immediate\write16{--- needs --- TeX4ht \ifx\HDir\empty \else-d \HDir\space\space\fi \jobname\space ---}% >>> \SubSection{Identifiers and Counters} \<<< \ifx \Htmltrue\:UnDef \def\:temp{\csname newif\endcsname} \expandafter\:temp \csname ifHtml\endcsname \Htmlfalse \fi >>> \<<< \ifx\tmp:cnt\:UnDeF \csname newcount\endcsname\tmp:cnt \fi \def\g:advance#1{\bgroup \def\:temp{#1}% \tmp:cnt=#1\afterassignment\:gplus \advance\tmp:cnt} \def\:gplus{\expandafter\xdef\:temp{\the\tmp:cnt}\egroup} \def\html:lbl{1} \def\html:addr{\xdef\last:haddr{\file:id-\html:lbl}% \g:advance\html:lbl by 1\relax } >>> \<<< \ifx \file:id\:UnDef \gdef\file:id{|} \global\let\maxfile:id=\file:id \fi >>> \<<< 1>>> \SubSection{Relax Right Margin} \<<< \hbadness=10000 \vbadness=10000 \:CheckOption{fussy} \if:Option \else \hfuzz=99in \vfuzz=\hfuzz \fi \hyphenpenalty=1000 \exhyphenpenalty=1000 \def\html:rightskip{\rightskip = 0pt plus 0.5\hsize minus0.5\hsize } \html:rightskip >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \SubSection{Foot and Head Lines} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \<<< \<<< \ifx \footline\:UnDef \else \footline={\hfil} \headline={\hfil} \fi >>> \Section{Html Commmands From Users} The \''\let\ht:special=\special' is for protection against redefinitions of the \''\special', as is the case in french.sty. \<<< \ifx \ht:special\:UnDef \let\ht:special=\special \fi \def\HCode#1{\ifx \EndPicture\:UnDef \relax\ifvmode\leavevmode\fi\ht:special{t4ht=#1}\fi} \let\:HCode=\HCode \let\Hbrakets\empty \def\NewLineChar{\bgroup \catcode`\^=7 \:NewLineChar} \def\:NewLineChar#1{\egroup \def\:newlnch{ #1}} \NewLineChar{^^J} >>> \<<< \def\HCode#1{} >>> The \`+\HCode+' starts a new paragraph if introduced in vertical mode. The \`+\leavevmode+' is included for proper spacing in dviht. \Section{Cross References within Html} - NCSA Mosaic can't handle the end-of-anchor {\tt} tag if it is not on one line. For instance, in {\tt ...}, Mosaic paints everything blue until the next {\tt }it finds that is entirely on one line. \<<< \def\EndLink{\ifx \empty:lnk\empty \HCode{\Hbrakets}\fi} \def\:HRef{\ifx [\:temp \expandafter\::HRef \else \expandafter\:::HRef \fi } \def\HT:tag{\ifx -\let:val \expandafter\H:Tag \else \expandafter\HTa:g\fi } \def\HTa:g{\H:Tag-} \def\Link{\let\:attr\empty \futurelet\let:val\HRefT:ag} \def\HRefT:ag{\ifx -\let:val \expandafter\H:RefTag \else \expandafter\HRefTa:g\fi } \def\HRefTa:g{\H:RefTag-} \def\H:RefTag#1{\futurelet\:temp\:HRefTag} \def\:HRefTag{\ifx [\:temp \expandafter\::HRefTag \else \expandafter\:::HRefTag \fi } >>> A \`'\Link-{..}{b}' asks that a \''\Tag' will not be produced for `b'. A \`'\Link[\empty]{b}{..}' asks that a \''\XRef' will not be produced for `a'. The same is true for any other non-empty replacement to \''\empty' A `b' for which we neither have a \''\Tag' and a \''\XRef' provides a memory save in `strings out of', `string characters out of', and `multiletter control sequences' (see log files). \<<< \def\::HRef[#1]{\get:attr{#1}\::hRef\:::HRef} \def\::HRefTag[#1]{\get:attr{#1}\::hRefTag\:::HRefTag} \def\get:attr#1{\edef\:attr{\noexpand\get:atr #1 |}\:attr} \def\get:atr#1 #2|#3#4{\def\:attr{\space#2}% \def\:te:mpa{#1}\ifx \:te:mpa\empty \let\:te:mpa#4\else \def\:te:mpa{#3[#1]}\fi \:te:mpa} >>> \<<< \def\H:Tag#1#2{\:TagHTag{#2}\HCode{\Hbrakets<\tag:A\:newlnch \NAME:"#2"\empty:lnk>}} \def\::hRef[#1]#2{% \HCode{\Hbrakets<\tag:A\:newlnch \if\relax#1#2\relax \NOHREF:{}\else \HREF:"#1\if\relax#1\relax \else\:sharp #2\fi"\fi \:attr \empty:lnk>}} \def\:::HRef#1{% \HCode{\Hbrakets<\tag:A\:newlnch \if\relax#1\relax \NOHREF:{}\else \HREF:"\get:hfile{#1}\:sharp #1"\fi \:attr \empty:lnk>}} >>> \<\><<< \def\::hRef[#1]#2{\def\:te:mp{#1}\def\:te:mpa{#1#2}% \HCode{<\tag:A\:newlnch \ifx\:te:mpa\empty \NOHREF: \else \HREF:"#1\ifx\:te:mp\empty \else\:sharp #2\fi"\fi \:attr \empty:lnk>}} \def\:::HRef#1{\def\:te:mpa{#1}% \HCode{<\tag:A\:newlnch \ifx\:te:mpa\empty \NOHREF: \else \HREF:"\get:hfile{#1}\:sharp #1"\fi \:attr \empty:lnk>}} >>> \<<< \def\::hRefTag[#1]#2#3{% \if\relax#3\relax\else\:TagHTag{#3}\fi \HCode{\Hbrakets<\tag:A\:newlnch \if\relax#1#2\relax \NOHREF:{#3}\else \HREF:"#1\if\relax#2\relax \else\:sharp #2\fi"\fi \if\relax#3\relax\else\space \NAME:"#3"\fi \:attr \empty:lnk>}} \def\:::HRefTag#1#2{% \if\relax#2\relax\else\:TagHTag{#2}\fi \HCode{\Hbrakets<\tag:A\:newlnch \if\relax#1\relax \NOHREF:{#2}% \else\HREF:"\get:hfile{#1}\:sharp #1"\fi \if\relax#2\relax\else\space \NAME:"#2"\fi \:attr \empty:lnk>}} \let\empty:lnk=\empty \def\NOHREF#1{\space} >>> \<\><<< \def\::hRefTag[#1]#2#3{\def\:te:mp{#2}\def\:te:mpa{#1#2}\def\:te:mpb{#3}% \ifx\:te:mpb\empty\else\:TagHTag{#3}\fi \HCode{<\tag:A\:newlnch \ifx\:te:mpa\empty \NOHREF: \else \HREF:"#1\ifx\:te:mp\empty \else\:sharp #2\fi"\fi \ifx\:te:mpb\empty\else\space \NAME:"#3"\fi \:attr \empty:lnk>}} \def\:::HRefTag#1#2{\def\:te:mp{#1}\def\:te:mpa{#2}% \ifx\:te:mpa\empty\else\:TagHTag{#2}\fi \HCode{<\tag:A\:newlnch \ifx\:te:mp\empty \NOHREF: \else\HREF:"\get:hfile{#1}\:sharp #1"\fi \ifx\:te:mpa\empty\else\space \NAME:"#2"\fi \:attr \empty:lnk>}} >>> \''\def\NOHREF:#1{\ifx \hrEF:\HREF: \space NOHREF \fi}' is not part of html! \<<< \def\HREF:{ href=} \def\tag:A{a} \def\NAME:{ name=} >>> % \let\hrEF:=\HREF: We don't use \`'^^J' to break lines in \''\write' because user may change it, and because I had unexplained problem with it in emtex. \<<< \def\:TagHTag#1{\ifx -\let:val\else \Tag{|#1}{\file:id}\fi} >>> \<<< \def\H:Tag#1#2{} \def\::HRef[#1]#2{} \def\:::HRef#1{} \def\::HRefTag[#1]#2#3{} \def\:::HRefTag#1#2{} \def\:TagHTag#1{} >>> \Section{Html Addresses} \SubSection{Retrieving for HREF} \<<< \def\get:href{\expandafter\get::href} \def\get::href#1-#2-{\ifnum #1=\file:id\space \else |\fi \:sharp |} >>> \<<< \def\get:href{\expandafter\get::href} \def\get::href#1-#2-{\ifnum #1=\file:id\space \else \:HDir |\fi \:sharp |} >>> \SubSection{Retrieving for NAME} \<<< \def\get:htag{\expandafter\get::htag} \def\get::htag#1-#2-{|} >>> \SubSection{Generating} \<<< \make:addr{#2}>>> \<<< \def\make:addr#1{% \ifnum\clearcode:id>0 \romannumeral\clearcode:id Q\else PrTx\fi |#1} \ifx\clearcode:id\:UnDef \def\clearcode::id{0} \def\clearcode:id{0} \fi >>> We had before \`'\space' after \`'#1'. It was not a problem because \`'|<<< \def\make:addr#1{% \ifnum\clearcode:id>0 \romannumeral\clearcode:id Q\fi |#1\space} \ifx\clearcode:id\:UnDef \def\clearcode::id{0} \def\clearcode:id{0} \fi >>> \<<< >>> Originally, we had \`'\romannumeral' for tail, but it created named that are too long, and cause memory overflow. The condition \`'\ifnum\clearcode:id>0' is set to hold only for references to code fragments. Romannumeral might be better tags then just numerals because they might be less likely to be generater manually. \SubSection{File Names} \`=\Ref= and \`=\Tag= are mechanisms to exchange information. The following can be used to connect locations. (Note, however, that \`=\Tag= may appear in more than one location sending a sequences of tags separated by comma. In such cases, we arbitrarily go for the first choise.) \<<< \ifx \aXrefFile\:UnDef \let\aXrefFile=\empty \fi >>> \<<< | \def\get:hfile#1{% \expandafter\ifx\csname ||#1\endcsname\relax \get@hfile{#1}% \else \expandafter\expandafter\expandafter\get::hfile \csname ||#1\endcsname,//% \fi } \def\get::hfile#1,#2//{% \ifnum \file:id=0#1 \else |% \fi } \ifx\get@hfile\:Undef \let\get@hfile=\:gobble \fi >>> \<<< \expandafter\ifx \csname ||#1% | file-name|>\endcsname\relax \else \:LikeRef{|#1| file-name|>}% \fi >>> \<<< \expandafter\ifx \csname ||#1% | file-name|>\endcsname\relax \else \:HDir \:LikeRef{|#1| file-name|>}% \fi >>> \<<< \:LikeRef{|#1| file-name|>}>>> The following alternative can act as basis for retrieving all the file names, instead of just the first one. \<<< \def\get:hfile#1{% \expandafter\ifx\csname cw:|#1\endcsname\relax \get@hfile{#1}% \else \expandafter\expandafter\expandafter\get::hfile \csname cw:|#1\endcsname,\empty end:Links,/ \fi } \def\end:Links#1//{} \def\get::hfile#1,#2//{% \expandafter \ifx \csname #1\endcsname\end:Links \expandafter\end:Links \else \ifnum \file:id=0#1 \FileName\else \expandafter\ifx \csname cw:|#1% \empty F-\endcsname\relax \else \:LikeRef{|#1\empty F-}% \fi % \fi \expandafter\get::hfileA \fi #2//} \def\get::hfileA#1{% \ifx #1\space \expandafter\get::hfile\else \ifx #1\empty \else \space\fi% \expandafter\get::hfile\expandafter#1\fi} >>> \Section{Other} Dviht produce new line only after nonempty lines. The following can be used to force non empty lines. \<<< |%\def\HComment#1{\def\html:src{#1}} \HComment{} |% \let\html:src=\empty \catcode`\#=12 \def\:sharp{#} \catcode`\#=6 >>> \<<< \ifx \html:par\:UnDef \def\html:par{\HCode{

}} \fi \def\html:invisible{\string&\#x00A0;} >>> The \`' ' is needed for blank lines in \`'

'
within netscape. Opposite order of comment and non-breaking-space will
not work, and the same if one of the entities is sliminates. On the
other other, mosaic show the nobreaking space as strin. Well, ...

\<<<
|%\def\HComment#1{}|%
>>>

\`'\HComment' seems to have no real value, unless we want to
trace the input for debugging.


\SubSection{Tags}

\FreeCode\  % to ensure agains duplication

\<<<
 cw:>>>

\<<<
|Q\aXrefFile >>>



\ file-name\><<<
\empty F->>>

\<<<
)>>>

\<<<
|F\aXrefFile >>>


\FreeCode\

\<<<
!*?: >>>