summaryrefslogtreecommitdiff
path: root/Build/source/texk/tex4htk/demo.tex
blob: d05b994669ed3f2bcf39aa4c33a5d7c36fc6f9da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
% \def\CALL{{tex}{latex}}
% \let\PC=Y
% \let\DOS=Y
% \def\WWW{XXX}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% test.tex                                                  %
%                                                           %
% Please DON'T try to understand the code of this file---it %
% can be harmful to your eyes and brain!                    %
%                                                           %
%                                gurari@cis.ohio-state.edu  %
%                    http://www.cis.ohio-state.edu/~gurari  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\ifx \SCRIPT\UnDef
   \ifx \PC\UnDef
       \def\SCRIPT{
          \Needs{cp \FN.tex \WWW \FN.txt}
          \Needs{chmod 644 \WWW \FN.txt}
          \Needs{ht \TEX\space
                 \FN\space
                 \ifx\WWW\empty \else ' -d\WWW\space
                 -m644'\fi}
       }
   \else          % dos batch file
       \def\SCRIPT{
             \Needs{call ht \TEX\space  \FN}
             \Needs{if exist \FN.txt del \FN.txt}
             \Needs{ren \FN.tex \FN.txt}
       }
\fi\fi

%       \def\SCRIPT{
%             \Needs{call ht \TEX\space  \FN}
%             \Needs{if exist \FN.txt del /q \FN.txt}
%             \Needs{ren /q \FN.tex \FN.txt}
%       }




\ifx \PC\UnDef
\else

\openin15=clean.bat
\ifeof15
\closein15
\immediate\openout15=clean.bat
\immediate\write15{DEL hti.bat}
\immediate\write15{DEL htii.bat}
\immediate\write15{DEL htiii.bat}
\immediate\write15{DEL htiv.bat}
\immediate\write15{DEL htv.bat}
\immediate\write15{DEL htvi.bat}
\immediate\write15{DEL htvii.bat}
\immediate\write15{DEL httest.bat}
\immediate\write15{DEL i.*}
\immediate\write15{DEL ia.*}
\immediate\write15{DEL ii.*}
\immediate\write15{DEL iia.*}
\immediate\write15{DEL iii.*}
\immediate\write15{DEL iiia.*}
\immediate\write15{DEL iv.*}
\immediate\write15{DEL iv2.*}
\immediate\write15{DEL iva2.*}
\immediate\write15{DEL iva.*}
\immediate\write15{DEL test*.aux}
\immediate\write15{DEL test*.bat}
\immediate\write15{DEL test*.dvi}
\immediate\write15{DEL test*.htm*}
\immediate\write15{DEL test*.css}
\immediate\write15{DEL test*.lg}
\immediate\write15{DEL test*.idv}
\immediate\write15{DEL test*.log}
\immediate\write15{DEL test*.otc}
\immediate\write15{DEL test*.toc}
\immediate\write15{DEL test*.txt}
\immediate\write15{DEL test*.xre*}
\immediate\write15{DEL tex4ht.ps}
\immediate\write15{DEL v.*}
\immediate\write15{DEL va.*}
\immediate\write15{DEL vi.*}
\immediate\write15{DEL viIa.*}
\immediate\write15{DEL via.*}
\immediate\write15{DEL vii.*}
\immediate\write15{DEL viia.*}
\immediate\write15{DEL clean.bat}
\immediate\closeout15
\else \closein15 \fi

\fi

\ifx \DOS\UnDef
       \def\HTML{html}  \def\ARG{}
 \else \def\HTML{htm}   \def\ARG{[htm]}
 \fi

\ifx \documentclass\undef \else
   \documentclass{article}
\fi
\input tex4ht.sty
\def\temp{htm}\ifx \HTML\temp
   \Preamble{htm,no_,no^}
\else
   \Preamble{html,no_,no^}
\fi
   \ifx \documentclass\undef \else
      \begin{document}
   \fi

   \Configure{Needs}{l. \the\inputlineno\space--- needs --- "#1" ---}


\newlinechar=`\^^J

\ifx \WWW\UnDef \let\WWW=\empty \fi
\ifx \DOS\UnDef\else
%      \Needs{CLS} % clear screen
\fi


\ifx \CALL\UnDef
   \def\TEX{\ifx \documentclass\undef \else la\fi tex}
\else
   \def\TEX#1#2{\def\TEX{\ifx \documentclass\undef #1\else #2\fi}}
   \expandafter\TEX\CALL
\fi

\edef\type{\ifx \documentclass\undef \else  a\fi}

\def\\#1\\{\expandafter\noexpand\csname#1\endcsname}
\catcode`\#=11 \def\Sharp{#} \catcode`\#=6
\def\source#1#2{
   \def\doc##1##2##3{#2}
   \HAdvance\FileNo by 1
   \NextFileName
   \immediate\openout15=\FN.tex
   \immediate\write16{--- Writing file \FN.tex}%
   \SCRIPT
   \immediate\write15{\ifx \documentclass\undef
      \noexpand \input tex4ht.sty                            ^^J
      \noexpand \Preamble{\HTML#1}                            ^^J
      \noexpand \EndPreamble                              ^^J^^J\else
      \noexpand \documentclass{article}                ^^J
      \noexpand \usepackage\ARG{tex4ht}                            ^^J
      \noexpand \begin{document}                           ^^J^^J\fi
      \doc{PSALMS (131:1)}
          {My heart is not haughty, nor                      ^^J
             mine eyes lofty:}
          {neither do I                                      ^^J
             exercise  myself in great                       ^^J
             matters, or in things too high                  ^^J
            for me.}                                      ^^J^^J
      {\\it\\ Example \FileNo\space (out of \examples)}   ^^J^^J
      \noexpand \end\ifx \documentclass\undef \else
          {document}\fi    }
   \immediate\closeout15
   \Link[\jobname\FileNo\type f.\HTML\space TARGET="X"]{}{}\FileNo\EndLink
   \File+{\jobname\FileNo\type f.\HTML}
      \HorFrames{*,*}
         \Frame[\romannumeral\FileNo\type.txt]{}
         \Frame[\romannumeral\FileNo\type.\HTML]{}
      \EndPreamble
         \Link[\romannumeral\FileNo\type.txt]{}{}outcome\EndLink{} /
         \Link[\romannumeral\FileNo\type.\HTML]{}{}source\EndLink{} /
         \Link{1}{}pointers\EndLink
   \EndFile{\jobname\FileNo\type f.\HTML}
}

\def\NextFileName{\edef\FN{\romannumeral\FileNo\type}}

\HAssign\examples=0\LikeRef{count}
\HAssign\FileNo=1  \NextFileName

  \VerFrames{7*,*}
  \Frame[\jobname\FileNo\type f.\HTML\space NAME="X"]{}
  \Frame[ NAME="Y"]{1}

\EndPreamble

\Link[\FN.txt]{}{}source\EndLink{}  /
\Link[\FN.\HTML]{}{}outcome\EndLink{} /

\HAssign\FileNo=0

\edef\temp{\noexpand\HPage<\jobname p.\HTML>}
\temp{Pointers}\Link{}{1}~\EndLink


Goto to Example:
\source{%,fonts
}{#1^^J^^J#2^^J^^J#3}
  \def\HR{^^J\\HCode\\{<HR>}^^J}
\source{%,fonts
}{\HR #1 \HR #2 \HR #3 \HR}
\source{%,fonts
}{{\\bf\\#1}^^J^^J{\\it\\#2}^^J^^J{\\tt\\#3}}
\source{%,fonts
}{\\HPage\\{#1}^^J^^J#2^^J^^J#3^^J^^J
    \\ExitHPage\\{}\\EndHPage\\{}}
%
\ifx \documentclass\undef
\source{%,fonts
}{\\Contribute\\{halign}{BORDER<>0 1 < 0 2 - 0 3 > }^^J
\\halign\\{&\Sharp\\cr\\#1^^J&^^J#2^^J&^^J#3\\cr\\}}
\else
\source{%,fonts
}{\string\begin{tabular}{|l|c|r|}^^J
#1^^J&^^J#2^^J&^^J#3^^J
\string\end{tabular}}
\fi
%

  \def\d{\\scriptstyle\\ \\diamondsuit\\
    \\diamondsuit\\ \\diamondsuit\\ }
\ifx \documentclass\undef
\source{%,fonts
}{^^J
\\settabs\\ 6 \\columns\\^^J
\\+\\PSALMS & (131:1)\\cr\\^^J
\\+\\My heart & is not haughty,\\cr\\ ^^J
\\+\\nor mine &  eyes lofty:\\cr\\^^J
\\settabs\\ \\+\\ neither & do I exercise & \\cr\\^^J
\\+\\neither & do I exercise \\cr\\^^J
\\+\\        & myself in & great matters, \\cr\\^^J
\\+\\or      & in things & too high for me. \\cr\\^^J
}
\else
\source{%,fonts
}{^^J
\\begin\\{tabbing}^^J
XXXXXXXXX \\=\\\\kill\\^^J
PSALMS \\>\\ (131:1) \string\\^^J
My heart \\>\\ is not haughty, \string\\^^J
nor mine \\>\\  eyes lofty:\string\\^^J
neither \\=\\ do I exercise \\=\\ \\kill\\^^J
neither \\>\\ do I exercise \string\\^^J
        \\>\\ myself in \\>\\ great matters, \string\\^^J
or      \\>\\ in things \\>\\ too high for me. \string\\^^J
\\end\\{tabbing}^^J
}
\fi
%
\source{%,fonts
}{\ifx \documentclass\undef\space
   \string\def\string\(\string{\string\Picture+\string{\string}\string
   $\string}^^J
   \string\def\string\)\string{\string$\string\EndPicture\string}^^J
\fi
\\Picture\\+{ ALIGN="LEFT"}\\vtop\\{\\hsize\\=2in^^J
     \\hrule\\\\smallskip\\ #1\\smallskip\\\\hrule\\}\string
     \EndPicture^^J #2^^J\\(\\ \d \\)\\ ^^J#3 $\d$}
\EndHPage{}

 \Tag{count}{\FileNo}

\end{document}
\endinput