570
The following code defines \`'\ifOption' just for flags defined in the
571
comamnd line (that is, flags known the first time tex4ht.sty is
572
loaded). It doesn't yet see those options introduced by \`'\Preamble'
576
\<def early latex ifOption\><<<
577
\ifx \config:opt\:UnDef \else
578
\ifx\tmp:toks\:UnDeF \csname newtoks\endcsname\tmp:toks\fi
579
\def\:temp{\def\ifOption##1}
580
\expandafter\expandafter\expandafter\:temp
581
\expandafter{\config:opt,,//\if:Option
582
|<ifOption true|>\else |<ifOption false|>\fi \tmp:toks=}
583
\pend:defI\ifOption{\def\:temp{##1}\:Optionfalse\:ScanOptions}
565
588
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
566
589
\Section{LaTeX at First Pass}
567
590
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1734
1757
\<first pass\><<<
1735
\NewConfigure{html}[1]{\edef\:html{#1}}
1736
\Configure{html}{html}
1758
\NewConfigure{ext}[1]{%
1759
\def\:temp##1ext=##2,##3|<par del|>{%
1760
\if !##2!\edef\:html{#1}%
1761
\else \edef\:html{##2}\fi}%
1762
\expandafter\:temp\Preamble ,ext=,|<par del|>
1764
\Configure{ext}{html}
1739
1767
\<base 2 names for htm\><<<
2015
2043
\<general utilities\><<<
2016
2044
\def\SaveEverypar{%
2017
\expand:after{\expandafter\gdef\csname \n:list L\endcsname }%
2045
\expandafter\ifx\csname ht:everypar\endcsname\relax
2046
\expand:after{\expandafter\gdef\csname \n:list L\endcsname }%
2047
\expandafter{\expandafter\everypar
2048
\expandafter{\the\everypar}}%
2050
\expand:after{\expandafter\gdef\csname \n:list L\endcsname }%
2018
2051
\expandafter{\expandafter\ht:everypar
2019
2052
\expandafter{\the\ht:everypar}}%
2020
2054
\expandafter\xdef\csname \n:list X\endcsname{%
2021
2055
\if:removeindent \global\noexpand\:removeindenttrue
2022
2056
\else \global\noexpand\:removeindentfalse \fi
2174
2208
\edef\re:call{\catcode`\noexpand\:|=\the\catcode`\: }%
2175
2209
\catcode`\:|=11
2176
2210
\let\sv:crs|=\:CrossWord
2177
\def\:CrossWord{\bgroup \catcode`\:|=12 \catcode`\@|=11
2211
\def\:CrossWord{\bgroup
2212
\no:catcodes{128}{255}{12}%
2213
\catcode`\:|=12 \catcode`\@|=11
2178
2214
\catcode`\^^M|=11 \:CrsWrd}%
2179
2215
\def\:CrsWrd##1##2##3{\egroup \sv:crs{##1}{##2}{##3}}%
3847
3883
|<front/tail button|>%
3848
3884
\def\:temp{#8}\ifx \:temp\empty \else
3849
3885
\ifx \cond:bt\:gobbleIII
3850
\else \def\CLB:up{#1\ExitHPage{#8}#2}\fi\fi
3886
\else \def\CLB:up{\def\:temp{#8}#1\ExitHPage{#8}#2}\fi\fi
3851
3887
|<insert cross link buttons|>%
3852
3888
|<restore cond buttons|>%
3853
3889
\def\:temp{##1}\ifx \:temp\empty \aa:crsbt\else \bb:crsbt\fi
3983
4019
\ifx \:temp\empty
3984
4020
\def\:temp{#6}%
3985
4021
\ifx \:temp\empty \else
3986
\def\CLB:tail{#1\Link[\RefFileNumber\file:id]{}{}#6\EndLink #2}\fi
4022
\def\CLB:tail{\def\:temp{#6}#1\Link[\RefFileNumber\file:id]{}{}#6\EndLink #2}\fi
3988
4024
\def\:temp{#7}%
3989
4025
\ifx \:temp\empty \else
3990
\def\CLB:front{#1\Link{##2\RefFileNumber\file:id}{}#7\EndLink #2}\fi
3995
\def\:temp{##1}\def\:te:mp{##2}%
3998
\ifx \:te:mp\empty [\RefFileNumber\file:id]\fi
3999
{\ifx \:te:mp\empty \else ##2\RefFileNumber\file:id\fi}{}}%
4002
\ifx \:te:mp\empty \else
4003
\def\CLB:tail{#1\expandafter\:temp \:te:mp \EndLink #2}\fi
4006
\ifx \:te:mp\empty \else
4007
\def\CLB:front{#1\expandafter\:temp \:te:mp \EndLink #2}\fi
4026
\def\CLB:front{\def\:temp{#7}#1\Link{##2\RefFileNumber\file:id}{}#7\EndLink #2}\fi
4141
4160
\Recall:HPageTag\HP:file \Save:HPageTag\HP:file
4142
4161
\def\:temp{#4}\ifx \:temp\empty \else
4143
4162
\def\CLB:prevup{%
4144
#1\Link[\RefFile{|<fr bt fl|>\HP:file}]{}{}#4\EndLink #2}%
4163
\def\:temp{#4}#1\Link[\RefFile{|<fr bt fl|>\HP:file}]{}{}#4\EndLink #2}%
4146
4165
\def\:temp{#5}\ifx \:temp\empty \else
4147
4166
\def\CLB:prevtailup{%
4148
#1\Link[\RefFile{|<fr bt fl|>\HP:file}]{tail\Jobname
4167
\def\:temp{#5}#1\Link[\RefFile{|<fr bt fl|>\HP:file}]{tail\Jobname
4149
4168
}{}#5\EndLink #2}%
4151
4170
|<next button in root of `next' option|>%
4162
4181
\def\:temp{#3}\ifx \:temp\empty
4163
4182
\Link{}{tail\Jobname}\EndLink
4165
\expandafter\ifx \csname a:next\endcsname\relax #1\else
4166
\a:next \fi \Link[####1]{}{tail\Jobname}#3\EndLink
4167
\expandafter\ifx \csname b:next\endcsname\relax #2\else
4184
\expandafter\ifx \csname a:next+\endcsname\relax #1\else
4185
\csname a:next+\endcsname \fi
4186
\expandafter\ifx \csname a:next\endcsname\relax
4188
\else \let\:next\a:next \fi
4190
\Link{}{tail\Jobname}\EndLink
4192
\Link[####1]{}{tail\Jobname}\:next\EndLink
4194
\expandafter\ifx \csname b:next+\endcsname\relax #2\else
4195
\csname b:next+\endcsname \fi
4170
4197
\edef\:temp{\noexpand\:tempb
4171
4198
{\RefFileNumber\file:id}{\RefFile{|<fr bt fl|>\HP:file}}}%
4180
4207
\<html config util\><<<
4181
\NewConfigure{next}[2]{\def\a:next{#1}\def\b:next{#2}}
4208
\NewConfigure{next}[1]{\def\a:next{#1}}
4209
\NewConfigure{next+}[2]{%
4210
\expandafter\def\csname a:next+\endcsname{#1}%
4211
\expandafter\def\csname b:next+\endcsname{#2}}
4476
4506
\if:notempty{#3}{\exprt:tag{#1}#3,|<par del|>}}
4509
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4480
4510
\SubSection{Overide Previous Files}
4511
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4483
4514
The \''\:clearpage' is needed below to clear the old tags and xref
5150
5181
\expandafter\let\csname IF:#2toc\expandafter\endcsname
5151
5182
\csname if:#2toc\endcsname
5152
5183
\expandafter\let\csname if:#2toc\endcsname\:gobble
5153
\else \edef\:temp{@}\edef\:tempa{#1}%
5184
\else \edef\:temp{\string @}\edef\:tempa{\string#1}%
5154
5185
\ifx \:temp\:tempa
5155
5186
\expandafter\let\csname if:#2toc\endcsname\empty
5156
\else \edef\:temp{?}%
5187
\else \edef\:temp{\string ?}%
5157
5188
\ifx \:temp\:tempa
5158
5189
\expandafter\let\csname if:#2toc\expandafter\endcsname
5159
5190
\csname IF:#2toc\endcsname
6007
6038
\''\b:halign', \''\c:halign', and \`'d:halign'. The \`'#' in the
6008
6039
pattern can be any character of category code 13. The \`'&' charaters
6009
6040
shouldn't be within braces. The \''\RecallTeXcr' should appear
6010
before \''\MkHalign'; if it appears within the patter, we loose
6041
before \''\MkHalign'; if it appears within the pattern, we loose
6011
6042
the row breaks.
6173
6204
\<html config util\><<<
6174
6205
\def\halignTD{\ifx \:mALIGN\empty \hT:D \else \:mALIGN \fi}
6175
\def\halignTB#1{\global\expandafter\let\expandafter\:MkHalign:
6176
\csname :#1:\endcsname \a:halignTB \expandafter\expandafter
6177
\expandafter\halign:TB \csname :#1:\endcsname|<par del|>\b:halignTB}
6207
\expandafter\ifx \csname :#1:\endcsname\relax
6208
\:warning{Missing \string\Configure{halignTB<>}{#1}}%
6210
\global\expandafter\let\expandafter\:MkHalign:
6211
\csname :#1:\endcsname \a:halignTB \expandafter\expandafter
6212
\expandafter\halign:TB \csname :#1:\endcsname|<par del|>\b:halignTB
6178
6214
\NewConfigure{halignTB}{2}
6179
6215
\NewConfigure{halignTB<>}[2]{%
6180
6216
\expandafter\def\csname :#1:\endcsname{#2}}
7324
7362
\def\DefScript:#1#2#3#4#5{\def#1{\call:script{#2}{#3}{#4}{#5}}}
7325
7363
\def\call:script#1#2#3#4{\begingroup \vrb:tt
7326
7364
\leftskip|=\z@ \parindent|=\z@
7327
\Configure{HVerbatim}{\empty}{\empty}{\empty}{\empty}%
7365
\Configure{HVerbatim}{\empty}{\empty}%
7366
{\special{t4ht=}\empty}{\empty}%
7328
7367
\Configure{HVerbatim+}{\z@}{\hbox{ }}%
7329
7368
#3\ht:special{t4ht@@}%
7330
7369
\let\Verb:atim|=#1\let\Ver:batim|=#2%
7340
7379
A \`'\Configure{HVerbatim}{}{}{}{}' above will be problematic for
7341
the \`'hooks' option.
7380
the \`'hooks' option. The \`'\special{t4ht=}'is to ensure
7381
pseudo code at empty lines.
7384
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7343
7385
\Section{Cascade Style Sheets}
7386
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8957
9017
\fi \fi \:next }
8958
9018
|<cats early latex subs/sups|>
8959
9019
\let\:CheckOption|=\:UnDef
8960
\let\:ScanOptions|=\:UnDef
8964
9024
\<cats early latex subs/sups\><<<
8965
9025
\let\early:sub=\empty
8966
9026
\:CheckOption{early_} \if:Option
9141
9201
\def\::limits{\expandafter\ifx \blank:spc\:temp
9142
9202
\afterassignment\:l:mits \tmp:cnt0%
9143
\else\expandafter\:limits \fi}
9204
\ifx \limits\:temp\else
9205
\expandafter\expandafter\expandafter\:limits
9144
9208
\def\:l:mits{\futurelet\:temp\::limits}
9145
9209
\catcode`\ =13\relax\def\blank:spc{\let\blank:spc= }\blank:spc%
9146
9210
\catcode`\ =10\relax
9214
Test case to check: \Verb=\[\sum\nolimits\limits_a^b u_s^2 \]=
9149
9217
The assignment \`'\tmp:cnt0%' also consumes the space that follows.
9154
9222
\<math classes\><<<
9155
9223
\NewConfigure{displaylimits}[1]{\def\:temp{#1}\ifx \:temp\empty
9156
9224
\let\displaylimits|=\o:displaylimits: \else
9157
\def\:displaylimits{\ifx \:temp\nolimits \else#1\fi}%
9225
\def\:displaylimits{\ifx \:temp\nolimits \else
9226
\ifx \:temp\limits \else #1\fi\fi}%
9158
9227
\def\:temp{\o:displaylimits:\display:l:mits}%
9159
9228
\HLet\displaylimits|=\:temp \fi}
9160
9229
\let\o:displaylimits:|=\displaylimits
9351
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9283
9352
\Section{Renewed Commands}
9353
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9355
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9285
9356
\SubSection{Math Symbols from Macros}
9357
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9287
The \`'\MathSymbol' works on empty when the symbol come sfrom a font.
9288
That is, when the macro is defined as \`'\mathchar"xxxx'.
9359
The \`'\MathSymbol' works on empty when the symbol comes from a font.
9360
That is, when the macro is defined as \`'\mathchar"xxxx'. A
9361
\`'\MathSymbol+' variant may be applied to force definitions. Warning
9362
messages are not helpful as the symbols may have nultiple definitions
9363
dependent on the style files being loaded.
9290
9365
\<built-in tex math ops\><<<
9291
\def\MathSymbol#1#2{%
9366
\def\MathSymbol{\futurelet\:temp\:::MathSymbol}
9367
\def\:::MathSymbol{\if +\:temp
9368
\expandafter\:MathSymbol \else
9369
\expandafter\::MathSymbol \fi
9371
\def\::MathSymbol#1#2{%
9292
9372
\def\:tempb##1"##2///{##1}%
9293
9373
\edef\:tempa{\expandafter\expandafter\expandafter\:tempb
9294
9374
\expandafter\meaning\csname#2\endcsname"///}%
9295
9375
\edef\:tempc{\string\mathchar}%
9296
\ifx \:tempa\:tempc \else
9297
\def\:temp{{\math:sym#1{#2}}}%
9298
\expandafter\HLet\csname #2\endcsname|=\:temp
9377
\NewConfigure{#2}{1}\Configure{#2}{\csname o:#2:\endcsname}%
9379
\:MathSymbol{}{#1}{#2}%
9300
\NewConfigure{#2}{1}\Configure{#2}{\csname o:#2:\endcsname}}
9382
\def\:MathSymbol#1#2#3{%
9383
\def\:temp{{\math:sym#2{#3}}}%
9384
\expandafter\HLet\csname #3\endcsname\:temp
9385
\NewConfigure{#3}{1}\Configure{#3}{\csname o:#3:\endcsname}%
9301
9387
\def\math:sym#1#2{{\relax\ifmmode \expandafter#1\fi
9302
9388
{\csname a:#2\endcsname}}}
9391
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9305
9392
\SubSection{/left and /right}
9393
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9307
9395
Again, we don't want line breaks from \''<PRE>'s within
9308
9396
formulas in visual browsers.
10108
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10021
10109
\Section{Symbols}
10110
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10023
10112
Check that all the symbols belong to TeX and LaTeX
10026
10115
\<shared config\><<<
10027
\def\HChar#1{{\leavevmode\ht:special{t4ht@#1}\ifnum #1>-1 \a:HChar\fi}}
10116
\def\HChar#1{{\leavevmode |%\ifmmode\else\expandafter\immediate\fi|%
10117
\ht:special{t4ht@#1}\ifnum #1>-1 \a:HChar\fi}}
10028
10118
\NewConfigure{HChar}{1}
10029
10119
\Configure{HChar}{x}
10033
10124
There is a boundary case of \''\HChar{0}' we didn't
10034
10125
handle above. Do we want to take care of it?
10044
10135
presence of regular and pictorial symbols, we should be careful
10045
10136
not to get here into a mess.
10138
Without checking for the math mode the immediate becomes problematic in math mode (why?).
10141
\documentclass{article}
10148
Same problem for tables (why?)
10151
\documentclass{article}
10153
\begin{tabular}{l} \_ \end{tabular}
10159
%%%%%%%%%%%%%%%%%%%%%%%%%
10049
10160
\SubSection{Symbols}
10161
%%%%%%%%%%%%%%%%%%%%%%%%%%
10051
10163
% After |<dvi-based hooks|>
10640
10752
\expandafter\expandafter\expandafter\expandafter
10641
10753
\expandafter\expandafter\expandafter\:tempa
10642
10754
\expandafter\expandafter\expandafter{\expandafter\:temp #1}}
10755
\long\def\pend:defI#1#2{%
10756
\def\:tempa{\def#1####1}%
10757
\ex:pend{#2}{\expandafter\:temp #1{##1}}}
10758
\long\def\ex:pend#1{\def\:temp{#1}%
10759
\expandafter\expandafter\expandafter\expandafter
10760
\expandafter\expandafter\expandafter\:tempa
10761
\expandafter\expandafter\expandafter}
10645
10764
\<utilities\><<<
10646
10765
\long\def\append:defI#1#2{%
10647
10766
\def\:temp{\def#1####1}%
10648
10767
\expandafter\expandafter\expandafter\:temp\expandafter{#1{##1}#2}}
10649
\long\def\pend:defI#1#2{%
10650
\def\:tempa{\def#1####1}%
10651
\ex:pend{#2}{\expandafter\:temp #1{##1}}}
10652
10768
\long\def\pend:defII#1#2{%
10653
10769
\def\:tempa{\def#1####1####2}%
10654
10770
\ex:pend{#2}{\expandafter\:temp #1{##1}{##2}}}
10658
10774
\long\def\pend:defIII#1#2{%
10659
10775
\def\:tempa{\def#1####1####2####3}%
10660
10776
\ex:pend{#2}{\expandafter\:temp #1{##1}{##2}{##3}}}
10661
\long\def\ex:pend#1{\def\:temp{#1}%
10662
\expandafter\expandafter\expandafter\expandafter
10663
\expandafter\expandafter\expandafter\:tempa
10664
\expandafter\expandafter\expandafter}
10665
10777
\long\def\append:defIII#1#2{%
10666
10778
\def\:temp{\def#1####1####2####3}%
10667
10779
\expandafter\expandafter\expandafter
10751
10863
\expandafter\edef\csname
10752
10864
End\expandafter\:gobble\string #9\endcsname{%
10753
10865
\ifx\:tempd\empty \noexpand\HCode
10754
{</\ifx\:tempa\empty \tag:A\else#2\fi>}\fi }%
10866
{\Hbrakets</\ifx\:tempa\empty \tag:A\else#2\fi>}\fi }%
10755
10867
\edef\:temp{%
10756
10868
\noexpand\Odef\noexpand#1[####1]####2####3{{%
10757
10869
\def\noexpand\tag:A{\ifx\:tempa\empty\tag:A\else#2\fi}%