summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/foilhtml/foils-97.perl
blob: eaabee63cac7f4af3593e343f033f106623c1272 (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

######################################################
#
# generated with the docstrip utility.
#
# Copyright Boris Veytsman 1998
#
#  You are *not* allowed to modify this file.
#
#  You are *not* allowed to distribute this file.
# For distribution of the original source see
# the terms for copying and modification in the file
# foilhtml.dtx
#
 $FOILHEADLEVEL = 4 unless defined($FOILHEADLEVEL);
 %section_commands=('foilhead',$FOILHEADLEVEL,
   'rotatefoilhead',$FOILHEADLEVEL,%section_commands);

 %new_section_headings = ('foilhead', 'H1','rotatefoilhead','H1');
 &generate_new_sectioning_subs;

 sub generate_new_sectioning_subs{
    local($key, $val);
    while ( ($key, $val) = each %new_section_headings) {
        eval "sub do_cmd_$key {"
            . 'local($after) = @_;'
                . '&do_cmd_section_helper(' . $val . ');}';
        %section_commands=($key,$val,%section_commands);
    }
 };
 $FOILCLASS = 'article' unless defined $FOILCLASS;
 $FOILOPTIONS = '10pt' unless defined $FOILOPTIONS;
 sub make_latex{
 # This is the environment in which to process constructs that cannot be
 # translated to HTML.
 # The environment tex2html_wrap will be wrapped around any shorthand
 # environments (e.g. $, \(, \[).
 # The tex2html_wrap environment will be treated as an unrecognised
 # evironment by the translator and its contents (i.e. the 'shorthand'
 # environment) will be passed to latex for processing as usual.
     local($contents) = @_;
     local($preamble) = $preamble;
     local($preamble_aux) = $preamble_aux;
     # Make the @ character a normal letter ...
     $preamble =~
       s/\\documentclass.*/
       \\documentclass\[$FOILOPTIONS\]{$FOILCLASS}\\makeatletter/;
     # ... and make it special again after the preamble
     # remove the  \begin/\end  for  tex2html_nowrap and tex2html_deferred environments
     $preamble =~s/\\(begin|end)\s*\{(tex2html_(nowrap|deferred|nomath)[_a-z]*|imagesonly)\}//g;
     $preamble = "\\documentclass\{article\}%\\usepackage{html}%\n\\makeatletter"
         unless ($preamble);
     $preamble_aux = '' unless (($preamble_aux)&&($contents =~ /\\(hyper)?(ref|cite)/));

     local($paperwidth) = '';
     if ($PAPERSIZE) { $paperwidth = &adjust_textwidth($PAPERSIZE); }
     else { $paperwidth = &adjust_textwidth("a5"); }
     local($kern) = ($EXTRA_IMAGE_SCALE ? $EXTRA_IMAGE_SCALE/2 : ".5" );
     $kern = $kern * $MATH_SCALE_FACTOR;
     ($DEBUG ? "\\nonstopmode" : "\\batchmode") .
     "\n$preamble\n$preamble_aux\\makeatother\n" .
     "\\ifx\\AtBeginDocument\\undefined \\newcommand{\\AtBeginDocument}[1]{}\\fi\n" .
     "\\newenvironment{tex2html_wrap}{}{}\n" .
     "\\newbox\\sizebox\n" . "$paperwidth" .
     "\\newwrite\\lthtmlwrite\n" . "\\makeatletter\n" .
     "\\let\\realnormalsize=\\normalsize\n\\topskip=0pt\n\\def\\preveqno{}" .
     "\\let\\real\@float=\\\@float \\let\\realend\@float=\\end\@float\n" .
     "\\def\\\@float{\\let\\\@savefreelist\\\@freelist\\real\@float}\n" .
 #    "\\def\\\@float{\\\@dbflt}\n" .
     "\\def\\end\@float{\\realend\@float\\global\\let\\\@freelist\\\@savefreelist}\n" .
     "\\let\\real\@dbflt=\\\@dbflt \\let\\end\@dblfloat=\\end\@float\n" .
     "\\let\\\@largefloatcheck=\\relax\n" .
     "\\def\\\@dbflt{\\let\\\@savefreelist\\\@freelist\\real\@dbflt}\n" .
     "\\def\\adjustnormalsize{\\def\\normalsize{\\mathsurround=0pt \\realnormalsize" .
     "\\parindent=0pt\\abovedisplayskip=0pt\\belowdisplayskip=0pt}\\normalsize}\n" .
     "\\def\\lthtmltypeout#1{{\\let\\protect\\string\\immediate\\write\\lthtmlwrite{#1}}}%\n" .
     "\\newcommand\\lthtmlhboxmathA{\\adjustnormalsize\\setbox\\sizebox=\\hbox\\bgroup}%\n" .
     "\\newcommand\\lthtmlvboxmathA{\\adjustnormalsize\\setbox\\sizebox=\\vbox\\bgroup%\n".
     " \\let\\ifinner=\\iffalse }%\n" .
     "\\newcommand\\lthtmlboxmathZ{\\\@next\\next\\\@currlist{}{\\def\\next{\\voidb\@x}}%\n" .
 #    " \\expandafter\\box\\next\\edef\\next{\\egroup\\def\\noexpand\\thiseqn{\\theequation}}\\next}%\n" .
     " \\expandafter\\box\\next\\egroup}%\n" .
     "\\newcommand\\lthtmlmathtype[1]{\\def\\lthtmlmathenv{#1}}%\n" .
 #    "\\newcommand\\lthtmllogmath{\\lthtmltypeout{latex2htmlSize%\n" .
     "\\newcommand\\lthtmllogmath{\\lthtmltypeout{l2hSize %\n" .
     ":\\lthtmlmathenv:\\the\\ht\\sizebox::\\the\\dp\\sizebox::\\the\\wd\\sizebox.\\preveqno}}%\n" .
     "\\newcommand\\lthtmlfigureA[1]{\\let\\\@savefreelist\\\@freelist
        \\lthtmlmathtype{#1}\\lthtmlvboxmathA}%\n" .
     "\\newcommand\\lthtmlfigureZ{\\lthtmlboxmathZ\\lthtmllogmath\\copy\\sizebox
        \\global\\let\\\@freelist\\\@savefreelist}%\n" .
     "\\newcommand\\lthtmldisplayA[1]{\\lthtmlmathtype{#1}\\lthtmlvboxmathA}%\n" .
     "\\newcommand\\lthtmldisplayB[1]{\\edef\\preveqno{(\\theequation)}%\n" .
     "  \\lthtmldisplayA{#1}\\let\\\@eqnnum\\relax}%\n" .
     "\\newcommand\\lthtmldisplayZ{\\lthtmlboxmathZ\\lthtmllogmath\\lthtmlsetmath}%\n" .
     "\\newcommand\\lthtmlinlinemathA[1]{\\lthtmlmathtype{#1}\\lthtmlhboxmathA" .
     "  \\vrule height1.5ex width0pt }%\n" .
     "\\newcommand\\lthtmlinlinemathZ{\\egroup\\expandafter\\ifdim\\dp\\sizebox>0pt %\n" .
     "  \\expandafter\\centerinlinemath\\fi\\lthtmllogmath\\lthtmlsetmath}\n" .
     "\\def\\lthtmlsetmath{\\hbox{\\vrule width.5pt\\vtop{\\vbox{%\n" .
     "  \\kern.5pt\\kern$kern pt\\hbox{\\hglue.5pt\\copy\\sizebox\\hglue$kern pt}\\kern.5pt%\n" .
     "  \\ifdim\\dp\\sizebox>0pt\\kern$kern pt\\fi}%\n" .
     "  \\ifdim\\hsize>\\wd\\sizebox \\hrule depth1pt\\fi}}}\n" .
     "\\def\\centerinlinemath{\\dimen1=\\ht\\sizebox\n" .
     "  \\ifdim\\dimen1<\\dp\\sizebox \\ht\\sizebox=\\dp\\sizebox\n" .
     "  \\else \\dp\\sizebox=\\ht\\sizebox \\fi}\n\n" .
     "\\def\\lthtmlcheckvsize{\\ifdim\\ht\\sizebox<\\vsize\\expandafter\\vfill\n" .
     "  \\else\\expandafter\\vss\\fi}%\n" .
 #    "\\def\\\@enddocumenthook{\\ifnum\\count0>1 \\ifvoid\\\@cclv\\penalty-\\\@MM\\fi\\fi}\n" .
     "\\makeatletter\n" .
     $LaTeXmacros . "\n" .  # macros defined in extension files
 #    "\\usepackage{lthimages}\n" .
     "\n\\begin{document}\n" .
     "\\pagestyle{empty}\\thispagestyle{empty}%\n" .
     "\\lthtmltypeout{latex2htmlLength hsize=\\the\\hsize}%\n" .
     "\\lthtmltypeout{latex2htmlLength vsize=\\the\\vsize}%\n" .
     "\\lthtmltypeout{latex2htmlLength hoffset=\\the\\hoffset}%\n" .
     "\\lthtmltypeout{latex2htmlLength voffset=\\the\\voffset}%\n" .
     "\\lthtmltypeout{latex2htmlLength topmargin=\\the\\topmargin}%\n" .
     "\\lthtmltypeout{latex2htmlLength topskip=\\the\\topskip}%\n" .
     "\\lthtmltypeout{latex2htmlLength headheight=\\the\\headheight}%\n" .
     "\\lthtmltypeout{latex2htmlLength headsep=\\the\\headsep}%\n" .
     "\\lthtmltypeout{latex2htmlLength parskip=\\the\\parskip}%\n" .
     "\\lthtmltypeout{latex2htmlLength oddsidemargin=\\the\\oddsidemargin}%\n" .
     "\\makeatletter\n" .
     "\\if\@twoside\\lthtmltypeout{latex2htmlLength evensidemargin=\\the\\evensidemargin}%\n" .
     "\\else\\lthtmltypeout{latex2htmlLength evensidemargin=\\the\\oddsidemargin}\\fi%\n" .
     "\\makeatother\n" .
     "$contents\n".
 #    "\\clearpage\n" .
     "\\end{document}";
 }
 $DONT_INCLUDE = "foilhtml:".$DONT_INCLUDE;
&ignore_commands( <<_IGNORED_CMDS_);
portraitfoils
lanscapefoils
MyLogo # {}
Restriction # {}
LogoOff
LogoOn
rightfooter # {}
rightheader # {}
leftheader # {}
newnonfloat #{} #{}
foilheadskip # &ignore_numeric_argument
abovefloatskip # &ignore_numeric_argument
captionwidth # &ignore_numeric_argument
titleauthorskip # &ignore_numeric_argument
authorauthorskip # &ignore_numeric_argument
authordateskip # &ignore_numeric_argument
dateabstractskip # &ignore_numeric_argument
zerolistvertdimens
_IGNORED_CMDS_
 1; # This should be the last line