| 1 |
###################################################### |
| 2 |
# |
| 3 |
# generated with the docstrip utility. |
| 4 |
# |
| 5 |
# Copyright Boris Veytsman 1998 |
| 6 |
# |
| 7 |
# You are *not* allowed to modify this file. |
| 8 |
# |
| 9 |
# You are *not* allowed to distribute this file. |
| 10 |
# For distribution of the original source see |
| 11 |
# the terms for copying and modification in the file |
| 12 |
# foilhtml.dtx |
| 13 |
# |
| 14 |
$FOILHEADLEVEL = 4 unless defined($FOILHEADLEVEL); |
| 15 |
%section_commands=('foilhead',$FOILHEADLEVEL, |
| 16 |
'rotatefoilhead',$FOILHEADLEVEL,%section_commands); |
| 17 |
|
| 18 |
%new_section_headings = ('foilhead', 'H1','rotatefoilhead','H1'); |
| 19 |
&generate_new_sectioning_subs; |
| 20 |
|
| 21 |
sub generate_new_sectioning_subs{ |
| 22 |
local($key, $val); |
| 23 |
while ( ($key, $val) = each %new_section_headings) { |
| 24 |
eval "sub do_cmd_$key {" |
| 25 |
. 'local($after) = @_;' |
| 26 |
. '&do_cmd_section_helper(' . $val . ');}'; |
| 27 |
%section_commands=($key,$val,%section_commands); |
| 28 |
} |
| 29 |
}; |
| 30 |
$FOILCLASS = 'article' unless defined $FOILCLASS; |
| 31 |
$FOILOPTIONS = '10pt' unless defined $FOILOPTIONS; |
| 32 |
sub make_latex{ |
| 33 |
# This is the environment in which to process constructs that cannot be |
| 34 |
# translated to HTML. |
| 35 |
# The environment tex2html_wrap will be wrapped around any shorthand |
| 36 |
# environments (e.g. $, \(, \[). |
| 37 |
# The tex2html_wrap environment will be treated as an unrecognised |
| 38 |
# evironment by the translator and its contents (i.e. the 'shorthand' |
| 39 |
# environment) will be passed to latex for processing as usual. |
| 40 |
local($contents) = @_; |
| 41 |
local($preamble) = $preamble; |
| 42 |
local($preamble_aux) = $preamble_aux; |
| 43 |
# Make the @ character a normal letter ... |
| 44 |
$preamble =~ |
| 45 |
s/\\documentclass.*/ |
| 46 |
\\documentclass\[$FOILOPTIONS\]{$FOILCLASS}\\makeatletter/; |
| 47 |
# ... and make it special again after the preamble |
| 48 |
# remove the \begin/\end for tex2html_nowrap and tex2html_deferred environments |
| 49 |
$preamble =~s/\\(begin|end)\s*\{(tex2html_(nowrap|deferred|nomath)[_a-z]*|imagesonly)\}//g; |
| 50 |
$preamble = "\\documentclass\{article\}%\\usepackage{html}%\n\\makeatletter" |
| 51 |
unless ($preamble); |
| 52 |
$preamble_aux = '' unless (($preamble_aux)&&($contents =~ /\\(hyper)?(ref|cite)/)); |
| 53 |
|
| 54 |
local($paperwidth) = ''; |
| 55 |
if ($PAPERSIZE) { $paperwidth = &adjust_textwidth($PAPERSIZE); } |
| 56 |
else { $paperwidth = &adjust_textwidth("a5"); } |
| 57 |
local($kern) = ($EXTRA_IMAGE_SCALE ? $EXTRA_IMAGE_SCALE/2 : ".5" ); |
| 58 |
$kern = $kern * $MATH_SCALE_FACTOR; |
| 59 |
($DEBUG ? "\\nonstopmode" : "\\batchmode") . |
| 60 |
"\n$preamble\n$preamble_aux\\makeatother\n" . |
| 61 |
"\\ifx\\AtBeginDocument\\undefined \\newcommand{\\AtBeginDocument}[1]{}\\fi\n" . |
| 62 |
"\\newenvironment{tex2html_wrap}{}{}\n" . |
| 63 |
"\\newbox\\sizebox\n" . "$paperwidth" . |
| 64 |
"\\newwrite\\lthtmlwrite\n" . "\\makeatletter\n" . |
| 65 |
"\\let\\realnormalsize=\\normalsize\n\\topskip=0pt\n\\def\\preveqno{}" . |
| 66 |
"\\let\\real\@float=\\\@float \\let\\realend\@float=\\end\@float\n" . |
| 67 |
"\\def\\\@float{\\let\\\@savefreelist\\\@freelist\\real\@float}\n" . |
| 68 |
# "\\def\\\@float{\\\@dbflt}\n" . |
| 69 |
"\\def\\end\@float{\\realend\@float\\global\\let\\\@freelist\\\@savefreelist}\n" . |
| 70 |
"\\let\\real\@dbflt=\\\@dbflt \\let\\end\@dblfloat=\\end\@float\n" . |
| 71 |
"\\let\\\@largefloatcheck=\\relax\n" . |
| 72 |
"\\def\\\@dbflt{\\let\\\@savefreelist\\\@freelist\\real\@dbflt}\n" . |
| 73 |
"\\def\\adjustnormalsize{\\def\\normalsize{\\mathsurround=0pt \\realnormalsize" . |
| 74 |
"\\parindent=0pt\\abovedisplayskip=0pt\\belowdisplayskip=0pt}\\normalsize}\n" . |
| 75 |
"\\def\\lthtmltypeout#1{{\\let\\protect\\string\\immediate\\write\\lthtmlwrite{#1}}}%\n" . |
| 76 |
"\\newcommand\\lthtmlhboxmathA{\\adjustnormalsize\\setbox\\sizebox=\\hbox\\bgroup}%\n" . |
| 77 |
"\\newcommand\\lthtmlvboxmathA{\\adjustnormalsize\\setbox\\sizebox=\\vbox\\bgroup%\n". |
| 78 |
" \\let\\ifinner=\\iffalse }%\n" . |
| 79 |
"\\newcommand\\lthtmlboxmathZ{\\\@next\\next\\\@currlist{}{\\def\\next{\\voidb\@x}}%\n" . |
| 80 |
# " \\expandafter\\box\\next\\edef\\next{\\egroup\\def\\noexpand\\thiseqn{\\theequation}}\\next}%\n" . |
| 81 |
" \\expandafter\\box\\next\\egroup}%\n" . |
| 82 |
"\\newcommand\\lthtmlmathtype[1]{\\def\\lthtmlmathenv{#1}}%\n" . |
| 83 |
# "\\newcommand\\lthtmllogmath{\\lthtmltypeout{latex2htmlSize%\n" . |
| 84 |
"\\newcommand\\lthtmllogmath{\\lthtmltypeout{l2hSize %\n" . |
| 85 |
":\\lthtmlmathenv:\\the\\ht\\sizebox::\\the\\dp\\sizebox::\\the\\wd\\sizebox.\\preveqno}}%\n" . |
| 86 |
"\\newcommand\\lthtmlfigureA[1]{\\let\\\@savefreelist\\\@freelist |
| 87 |
\\lthtmlmathtype{#1}\\lthtmlvboxmathA}%\n" . |
| 88 |
"\\newcommand\\lthtmlfigureZ{\\lthtmlboxmathZ\\lthtmllogmath\\copy\\sizebox |
| 89 |
\\global\\let\\\@freelist\\\@savefreelist}%\n" . |
| 90 |
"\\newcommand\\lthtmldisplayA[1]{\\lthtmlmathtype{#1}\\lthtmlvboxmathA}%\n" . |
| 91 |
"\\newcommand\\lthtmldisplayB[1]{\\edef\\preveqno{(\\theequation)}%\n" . |
| 92 |
" \\lthtmldisplayA{#1}\\let\\\@eqnnum\\relax}%\n" . |
| 93 |
"\\newcommand\\lthtmldisplayZ{\\lthtmlboxmathZ\\lthtmllogmath\\lthtmlsetmath}%\n" . |
| 94 |
"\\newcommand\\lthtmlinlinemathA[1]{\\lthtmlmathtype{#1}\\lthtmlhboxmathA" . |
| 95 |
" \\vrule height1.5ex width0pt }%\n" . |
| 96 |
"\\newcommand\\lthtmlinlinemathZ{\\egroup\\expandafter\\ifdim\\dp\\sizebox>0pt %\n" . |
| 97 |
" \\expandafter\\centerinlinemath\\fi\\lthtmllogmath\\lthtmlsetmath}\n" . |
| 98 |
"\\def\\lthtmlsetmath{\\hbox{\\vrule width.5pt\\vtop{\\vbox{%\n" . |
| 99 |
" \\kern.5pt\\kern$kern pt\\hbox{\\hglue.5pt\\copy\\sizebox\\hglue$kern pt}\\kern.5pt%\n" . |
| 100 |
" \\ifdim\\dp\\sizebox>0pt\\kern$kern pt\\fi}%\n" . |
| 101 |
" \\ifdim\\hsize>\\wd\\sizebox \\hrule depth1pt\\fi}}}\n" . |
| 102 |
"\\def\\centerinlinemath{\\dimen1=\\ht\\sizebox\n" . |
| 103 |
" \\ifdim\\dimen1<\\dp\\sizebox \\ht\\sizebox=\\dp\\sizebox\n" . |
| 104 |
" \\else \\dp\\sizebox=\\ht\\sizebox \\fi}\n\n" . |
| 105 |
"\\def\\lthtmlcheckvsize{\\ifdim\\ht\\sizebox<\\vsize\\expandafter\\vfill\n" . |
| 106 |
" \\else\\expandafter\\vss\\fi}%\n" . |
| 107 |
# "\\def\\\@enddocumenthook{\\ifnum\\count0>1 \\ifvoid\\\@cclv\\penalty-\\\@MM\\fi\\fi}\n" . |
| 108 |
"\\makeatletter\n" . |
| 109 |
$LaTeXmacros . "\n" . # macros defined in extension files |
| 110 |
# "\\usepackage{lthimages}\n" . |
| 111 |
"\n\\begin{document}\n" . |
| 112 |
"\\pagestyle{empty}\\thispagestyle{empty}%\n" . |
| 113 |
"\\lthtmltypeout{latex2htmlLength hsize=\\the\\hsize}%\n" . |
| 114 |
"\\lthtmltypeout{latex2htmlLength vsize=\\the\\vsize}%\n" . |
| 115 |
"\\lthtmltypeout{latex2htmlLength hoffset=\\the\\hoffset}%\n" . |
| 116 |
"\\lthtmltypeout{latex2htmlLength voffset=\\the\\voffset}%\n" . |
| 117 |
"\\lthtmltypeout{latex2htmlLength topmargin=\\the\\topmargin}%\n" . |
| 118 |
"\\lthtmltypeout{latex2htmlLength topskip=\\the\\topskip}%\n" . |
| 119 |
"\\lthtmltypeout{latex2htmlLength headheight=\\the\\headheight}%\n" . |
| 120 |
"\\lthtmltypeout{latex2htmlLength headsep=\\the\\headsep}%\n" . |
| 121 |
"\\lthtmltypeout{latex2htmlLength parskip=\\the\\parskip}%\n" . |
| 122 |
"\\lthtmltypeout{latex2htmlLength oddsidemargin=\\the\\oddsidemargin}%\n" . |
| 123 |
"\\makeatletter\n" . |
| 124 |
"\\if\@twoside\\lthtmltypeout{latex2htmlLength evensidemargin=\\the\\evensidemargin}%\n" . |
| 125 |
"\\else\\lthtmltypeout{latex2htmlLength evensidemargin=\\the\\oddsidemargin}\\fi%\n" . |
| 126 |
"\\makeatother\n" . |
| 127 |
"$contents\n". |
| 128 |
# "\\clearpage\n" . |
| 129 |
"\\end{document}"; |
| 130 |
} |
| 131 |
$DONT_INCLUDE = "foilhtml:".$DONT_INCLUDE; |
| 132 |
&ignore_commands( <<_IGNORED_CMDS_); |
| 133 |
portraitfoils |
| 134 |
lanscapefoils |
| 135 |
MyLogo # {} |
| 136 |
Restriction # {} |
| 137 |
LogoOff |
| 138 |
LogoOn |
| 139 |
rightfooter # {} |
| 140 |
rightheader # {} |
| 141 |
leftheader # {} |
| 142 |
newnonfloat #{} #{} |
| 143 |
foilheadskip # &ignore_numeric_argument |
| 144 |
abovefloatskip # &ignore_numeric_argument |
| 145 |
captionwidth # &ignore_numeric_argument |
| 146 |
titleauthorskip # &ignore_numeric_argument |
| 147 |
authorauthorskip # &ignore_numeric_argument |
| 148 |
authordateskip # &ignore_numeric_argument |
| 149 |
dateabstractskip # &ignore_numeric_argument |
| 150 |
zerolistvertdimens |
| 151 |
_IGNORED_CMDS_ |
| 152 |
1; # This should be the last line |