"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/html/hevea.hva" (16 Jan 2021, 32536 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 %%%% Une précaution.
    2 \ifhtml\else\hva@warn{html/hevea is for html mode !!!}\endinput\fi
    3 %%%% package used by all packages
    4 \input{plain.hva}
    5 \newif\ififthen\ifthenfalse
    6 \input{ifthen.hva}
    7 %%%%%%%%%%%%%%%%%%%%%%%
    8 %%Style-sheet support %
    9 %%%%%%%%%%%%%%%%%%%%%%%
   10 %% External/internal style declarations are accumulated into approriate
   11 %% token registers
   12 % Linking to external style sheets
   13 \newtokens{\css@link}%
   14 \newcommand{\addcssfile}[1]{\addtokens{\css@link}{#1}}%
   15 \newcommand{\loadcssfile}[1]{\addcssfile{\@print{<}\@getprint{link rel="stylesheet" type=\char34 text/css\char34\@print{ }href=\char34#1\char34\char62\@print{
   16 }}}}%
   17 %%%%%%
   18 % Styles definition in the <HEAD> element
   19 \newtokens{\hevea@css}%
   20 \newcommand{\addstyle}[1]{\addtokens{\hevea@css}{#1}}%
   21 \newcommand{\newstyle}[2]{\addstyle{\@getprint{#1\char123#2\char125\@print{
   22 }}}}%
   23 \newif\ifexternalcss\externalcssfalse
   24 %
   25 %%Style attributes are normaly set through an indirection.
   26 %% Ie the class of the BLOCK elt that translates environment 'env' is
   27 %%    \'env'@class
   28 \newcommand{\class@attr}[2]{\ife#1\else\@getprint{class="#1"#2}\fi}
   29 \newcommand{\setenvclass}[3][]{#1\def\csname{}#2@class\endcsname{#3}}
   30 \newcommand{\getenvclass}[1]{\csname{}#1@class\endcsname}
   31 \newcommand{\envclass@attr}[2][]{\class@attr{\getenvclass{#2}}{#1}}
   32 %% Packages
   33 \input{packages.hva}
   34 %%%%%% Spacing
   35 \input{spaces.hva}
   36 \input{latexcommon.hva}
   37 %%% Basic symbols
   38 %%% Logos
   39 \def\TeX{\@print{T<sub>E</sub>X}}
   40 \def\LaTeX{\@print{L<sup>A</sup>T<sub>E</sub>X}}
   41 \def\LaTeXe{\mbox{\@print{L<sup>A</sup>T<sub>E</sub>X}~$2\epsilon$}}
   42 \newcommand{\hevea}{\@print{H}{\@incsize{-1}\@print{<sup>E</sup>}}\@print{V}%
   43 {\@incsize{-1}\@print{<sup>E</sup>}}\@print{A}}
   44 \newcommand{\hacha}{\@print{H}{\@incsize{-1}\@print{<sup>A</sup>}}\@print{C}%
   45 {\@incsize{-1}\@print{<sup>H</sup>}}\@print{A}}
   46 \newcommand{\html}{html}
   47 %%% HTML related stuff (TEX equivalents are in the hevea.sty file)
   48 %separate opening & closing of a elements (for cleveref)
   49 \newcommand{\@openlocref}[1]{{\@nostyle\@print{<a href="#}\@getprint{\@tr@url{#1}}\@print{">}}}
   50 \newcommand{\@closelocref}{{\@nostyle\@print{</a>}}}
   51 %usual a elements
   52 \newcommand{\@doaelement}[3][]
   53 {{\@nostyle\@print{<a }\@getprint{#1}\@getprint{#2}\@print{>}}{#3}{\@nostyle\@print{</a>}}}
   54 \newcommand{\@nestedaelement}[3][]{\hva@warn{Suppressing nested a element}#3}
   55 \newcommand{\@aelement}[3][]
   56 {\bgroup%
   57 \let\@aelement\@nestedaelement%
   58 \let\@openlocref\@gooble%
   59 \let\@closelocref\relax%
   60 \@doaelement[#1]{#2}{#3}\egroup}
   61 %high level, html vision
   62 \newcommand{\ahref}[3][]{\@aelement[#1]{href="#2"}{#3}}
   63 \newcommand{\ahrefurl}[2][]{\@aelement[#1]{href="#2"}{\texttt{#2}}}
   64 \let\footahref\ahref
   65 \newcommand{\mailto}[2][]{\@aelement[#1]{href="mailto:#2"}{#2}}
   66 \newcommand{\imgsrc}[2][]
   67 {\@print{<img src="}\@getprint{#2}\ifpedantic\@print{" alt="}\@getprint{#2}\fi
   68 \ifthenelse{\equal{#1}{}}{\@print{"}}{\@print{" }\@getprint{#1}}\@print{>}}
   69 %% Hyper-text references inside the document, internal usage
   70 \newcommand{\@locref}[3][]{\@aelement[#1]{href="\@print{#}\@tr@url{#2}"}{#3}}
   71 \newcommand{\@locname}[3][]{\@aelement[#1]{id="#2"}{#3}}
   72 \newcommand{\@locnameref}[4][]{\@aelement[#1]{id="#2" href="\@print{#}\@tr@url{#3}"}{#4}}
   73 %% Two exported commands
   74 \let\ahrefloc\@locref
   75 \let\aname\@locname
   76 \newcommand{\anchor}[2][]{\@locname[#1]{#2}{}}
   77 %% Html footer, header and prefix for titles
   78 \newsavebox{\@htmlhead}
   79 \newsavebox{\@htmlfoot}
   80 \newsavebox{\@htmlprefix}
   81 \newcommand{\htmlhead}[1]{\sbox{\@htmlhead}{#1}}
   82 \newcommand{\htmlfoot}[1]{\sbox{\@htmlfoot}{#1}}
   83 \newcommand{\htmlprefix}[1]{\sbox{\@htmlprefix}{#1}}
   84 \AtEndDocument
   85 {\@close@par{\@nostyle\@print{<!--HTMLFOOT-->
   86 }}%
   87 \usebox{\@htmlfoot}%
   88 {\@nostyle\@print{<!--ENDHTML-->
   89 }}}
   90 %%%%% Footnotes, html dependant part
   91 \newcommand{\@noteref}[4]{\@locnameref{#2#3}{#1#3}{#4}}
   92 \newcommand{\@notepointer}[3]{\@locref{#1#2}{#3}}
   93 \newcommand{\@notetextstyle}[1]
   94   {{\@nostyle\@print{<sup>}}#1{{\@nostyle\@print{</sup>}}}}
   95 \newcommand{\@notenotestyle}[1]{{\@clearstyle{}#1}}
   96 %Styling fotnote text: use div because of possible \par in it
   97 \newcommand{\@open@footnotetext}{\@open{div}{class="footnotetext"}}
   98 \newcommand{\@close@footnotetext}{\@close{div}}
   99 \newstyle{.footnotetext}{margin:0ex; padding:0ex;}
  100 \newstyle{div.footnotetext P}{margin:0px; text-indent:1em;}
  101 %Other styles
  102 \setenvclass{thefootnotes}{thefootnotes}
  103 \setenvclass{dt-thefootnotes}{dt-thefootnotes}
  104 \setenvclass{dd-thefootnotes}{dd-thefootnotes}
  105 \setenvclass{footnoterule}{footnoterule}
  106 \newstyle{.thefootnotes}{text-align:left;margin:0ex;}
  107 \newstyle{.dt-thefootnotes}{margin:0em;}
  108 \newstyle{.dd-thefootnotes}{margin:0em 0em 0em 2em;}
  109 \newstyle{.footnoterule}{background-color: black; border: none; height: 1px; margin: 1em auto 1em 0px; width: 40\%}
  110 \newcommand{\footnoterule}{\@hr[\envclass@attr{footnoterule}]{}{}}
  111 \newenvironment{thefootnotes}[2][]
  112   {\@out@par{{\@nostyle\@print{<!--BEGIN }\@getprint{#1}\@print{NOTES }\@getprint{\@footnotelevel}\@print{-->
  113 }}}\footnoterule%
  114   \setlistclass{thefootnotes}%
  115   \begin{list}{}{\renewcommand{\makelabel}[1]{##1}}}
  116   {\end{list}\@out@par{{\@nostyle\@print{
  117 <!--END NOTES-->
  118 }}}}
  119 %%% Captions html dependent part
  120 \newstyle{.caption}
  121 {padding-left:2ex; padding-right:2ex; margin-left:auto; margin-right:auto}
  122 \setenvclass{caption}{caption}
  123 \newenvironment{hva@capted}
  124   {\@open{div}{\envclass@attr{caption}}\begin{tabular}{p{\linewidth}}}
  125   {\end{tabular}\@close{div}}
  126 %%% for HaChA
  127 \newcounter{cuttingdepth}
  128 \setcounter{cuttingdepth}{1}
  129 %% Old cutdef/cutend, no footnote managment
  130 \newcommand{\cutdef*}[2][]
  131 {\@out@par{{\@nostyle\@print{<!--CUT DEF }#2\@print{ }#1\@print{ -->}}}}
  132 \newcommand{\cutend*}
  133 {\@out@par{{\@nostyle\@print{<!--CUT END -->
  134 }}}}
  135 %%% New cutdef/cutend, with footnote managment
  136 \hva@newstack{@foot}
  137 \newcommand{\cutdef}[2][]{%
  138 \@footnotesub\@push@foot{\@footnotelevel}\flushdef{#2}%
  139 \@out@par{{\@nostyle\@print{<!--CUT DEF }#2\@print{ }#1\@print{ -->}}}}
  140 \newcommand{\cutend}{%
  141 \footnoteflush{\@footnotelevel}%
  142 \@out@par{{\@nostyle\@print{<!--CUT END -->
  143 }}}%
  144 \@endfootnotesub\@pop@foot{\@footnotelevel}}
  145 %%%Close/Re-open toplevel pars
  146 \newcommand{\@secbegin}{\@close@par}
  147 \newcommand{\@secend}{{\@nostyle\@print{<!--SEC END -->}}\@open@par}
  148 \newcommand{\@secanchor}{}
  149 %{{\@nostyle\@print{<!--SEC ANCHOR }\@fmt@sec\@print{-->}}}
  150 \newcommand{\cuthere}[2]{%
  151 \@footnoteflush{#1}%
  152 {\@out@par{{\@nostyle\@print{<!--TOC }\@getprint{#1}\@print{ }}%
  153 {\@nostyle{}\@print{id="}\@getprint{\@sec@id@attr}\@print{" }}%
  154 \begin{@norefs}#2\end{@norefs}{\@nostyle\@print{-->
  155 }}}}}
  156 \newcommand{\@hacha@arg}[2]
  157 {{\@nostyle\@print{<arg }\@getprint{#1}\@print{>}{#2}\@print{</arg>}}}
  158 \newenvironment{@cutflow}[2]
  159 {\@out@par{\@printnostyle{<!--FLOW }%
  160 \@hacha@arg{footer}{#1}%
  161 \@hacha@arg{title}{#2}%
  162 \@printnostyle{-->
  163 }}}
  164 {\@out@par{\@printnostyle{<!--END FLOW-->
  165 }}}
  166 \newenvironment{cutflow}[1]{\begin{@cutflow}{YES}{#1}}{\end{@cutflow}}
  167 \newenvironment{cutflow*}[1]{\begin{@cutflow}{NO}{#1}}{\end{@cutflow}}
  168 \newcommand{\cutname}[1]
  169 {\@out@par{{\@nostyle\@print{<!--NAME }\@getprint{#1}\@print{-->
  170 }}}}
  171 \newcommand{\@link@arg}[2]
  172   {\ifthenelse{\equal{#2}{}}{}
  173   {\@hacha@arg{#1}{#2}}}
  174 \newsavebox{\@toplinks}
  175 \newcommand{\toplinks}[3]
  176   {\sbox{\@toplinks}
  177     {\@printnostyle{<!--LINKS }%
  178     \@link@arg{PREV}{#1}%
  179     \@link@arg{UP}{#2}%
  180     \@link@arg{NEXT}{#3}%
  181     \@printnostyle{-->
  182 }}}
  183 \newsavebox{\@linkstext}
  184 \newcommand{\setlinkstext}[3]
  185   {\sbox{\@linkstext}
  186     {\@printnostyle{<!--SETENV }%
  187     \@link@arg{PREVTXT}{#1}%
  188     \@link@arg{UPTXT}{#2}%
  189     \@link@arg{NEXTTXT}{#3}%
  190     \@printnostyle{-->
  191 }}}
  192 %%Pass some information to hacha
  193 \newtokens{\@hacha@defs}
  194 \newcommand{\@add@hacha@def}[2]{\addtokens{\@hacha@defs}{\@hacha@arg{#1}{#2}}}
  195 \newcommand{\formatlinks}[4]
  196 {\@add@hacha@def{LINKS}{#1{VAR}}\@add@hacha@def{PREVLINK}{#2{VAR}}%
  197 \@add@hacha@def{UPLINK}{#3{VAR}}\@add@hacha@def{NEXTLINK}{#4{VAR}}}
  198 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  199 % Using style CLASSES with DIV for local style-setting   %
  200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  201 %
  202 \newenvironment{divstyle}[1]
  203   {\@open{div}{\class@attr{#1}{}}}{\@close{div}}%
  204 \newenvironment{cellstyle}[2]
  205   {\@open{table}{\class@attr{#1}{}}\@open{tr}{}\@open{td}{\class@attr{#2}{}}}
  206   {\@close{td}\@close{tr}\@close{table}}
  207 %
  208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  209 % Echoing to the image file %
  210 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  211 %
  212 \def\@iopt@def{!*!}
  213 \newcommand{\@imageopt}[1][!*!]
  214 {\def\@itmp{#1}\ifx\@itmp\@iopt@def\else\begin{toimage}[#1]\end{toimage}\fi}
  215 \newcommand{\@imagearg}[1]{\begin{toimage}{#1}\end{toimage}}
  216 \newcommand{\@imagecommand}[2]
  217   {\@forcecommand{#1}{\begin{toimage}#1\end{toimage}#2}}
  218 %
  219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  220 %   \maketitle (is no longer redefined by fancysection)		%
  221 %   Thus defining different styles explicitly will have to 	%
  222 %     be done using the respective classes :			%
  223 %     .title     : table containing the title and supplements   %
  224 %     .titlemain : h1 containing title name		        %
  225 %     .titlerest : h3 containing other fields (author,date,etc.)%
  226 %   'checkbox' now takes three instead of two arguments,        %
  227 %     one for the class.					%
  228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229 %
  230 \newcommand{\title@tohaux}[1]
  231 {\@auxdowrite{\@print{\@titleaux}\{\@subst{#1}\}
  232 }}
  233 \newstyle{.title}{margin:2ex auto;text-align:center}
  234 \newstyle{.titlemain}{margin:1ex 2ex 2ex 1ex;}
  235 \newstyle{.titlerest}{margin:0ex 2ex;}
  236 \let\title@flush@hook\relax
  237 \newcommand{\maketitle}{%
  238   \bgroup
  239   \newcommand{\checkcmd}[4]
  240     {\@ifundefined{@##3}{##4{No ##3 given}}
  241      {\@open{##1}{\class@attr{##2}{}}%
  242       \@fmt@title{\csname @##3\endcsname}%
  243       \@close{##1}}}%
  244   \@opencell{class=\@print{"title"}}{}{style=\@print{"padding:1ex"}}%
  245   \checkcmd{h1}{titlemain}{title}{\hva@warn}%
  246   \checkcmd{h3}{titlerest}{author}{\hva@warn}%
  247   \checkcmd{h3}{titlerest}{date}{\@gooble}%
  248   \@closecell%
  249   \egroup%
  250   \ifthenelse{\equal{\@footnotelevel}{document}}{}
  251   {\@footnotesub%
  252    \gdef\title@flush@hook{\@endfootnotesub\@footnoteflush@sticky{document}}}%
  253 \let\maketitle\relax}%
  254 %
  255 %%%%%%%%%
  256 % Maths %
  257 %%%%%%%%%
  258 \ifmathml
  259 \input{html/symb-mathml.hva}
  260 \else
  261 \ifsymbtext\input{iso-text.hva}\else\input{iso-html.hva}\fi
  262 \fi
  263 \renewcommand{\&}{\ifraw\@print{&}\else\@print{&amp;}\fi}
  264 \renewcommand{\textless}{\ifraw\@print{<}\else\@print{&lt;}\fi}
  265 \renewcommand{\textgreater}{\ifraw\@print{>}\else\@print{&gt;}\fi}
  266 %%%%%%%%%%%% Bibliography
  267 \newcommand{\@bibtagstyle}{}
  268 \newcommand{\@bibref}[3]
  269   {\@locref{#1}{\ifx#2\@empty\@verbarg{#1}\else#2\fi}\@bib@post{#3}}
  270 \newsavebox{\@bibbox}
  271 \newcommand{\@biblabel}[1]{\@locname{\bibtaghook{#1}}{\@bibtagstyle[\@bibread{\bibtaghook{#1}}]}}
  272 %%%%%%%%%%%% Language translation
  273 \input{html/lang.hva}
  274 %%% Environment document.
  275 \newcommand{\@charset}{US-ASCII}
  276 \newcommand{\@def@charset}[1]
  277 {\renewcommand{\@charset}{#1}\@set@out@translator{mappings/#1.map}}
  278 \newcommand{\@bodyargs}{}
  279 \newcommand{\@htmlargs}{}
  280 \newcommand{\@meta}
  281 {\@print{<meta http-equiv="Content-Type" content="text/html; charset=}%
  282 \@getprint{\@charset}%
  283 \@print{">
  284 <meta name="generator" content="hevea }%
  285 \@getprint{\usebox{\@heveaversion}}\@print{">
  286 }%
  287 \ife\hevea@css\else
  288 \ifexternalcss\loadcssfile{\hva@dump@css}\else
  289 \@print{<style type="text/css">}
  290 \hevea@css\@print{</style>
  291 }\fi\fi
  292 \ife\css@link\else\css@link\fi
  293 \undef\hevea@css\undef\newstyle}
  294 \newenvironment{document}{%
  295 \@end{document}%
  296 \@atbegindocument%
  297 \@restartoutput\unskip%
  298 \@print{<!DOCTYPE html>
  299 }\@print{<html }\@getprint{\@htmlargs}\@print{>
  300 <head>}
  301 \@meta%
  302 \@print{<title>}%
  303 \ifu\@title\jobname\else
  304 \@notags{\begin{@norefs}\let\@print@u\@print@u@default\@getprint{\@title}\end{@norefs}}
  305 \fi
  306 \@print{</title>
  307 }%
  308 \ifmathml\@print{<style type="text/css">
  309   math.centered { text-align: center}
  310 </style>
  311 }\fi
  312 \@print{</head>
  313 }%
  314 \@print{<body }\@notags{\@bodyargs}\@print{>
  315 }%
  316 \@print{<!--HEVEA command line is: }\usebox{\@heveacomline}\@print{-->
  317 }%
  318 {\@nostyle\@print{<!--CUT STYLE }\hacha@style\@print{-->}}%
  319 \ife\@htmlhead\else{\@nostyle\@print{<!--HTMLHEAD-->
  320 }}%
  321 \usebox{\@htmlhead}%
  322 {\@nostyle\@print{<!--ENDHTML-->
  323 }}\fi%
  324 \ife\@htmlprefix\else\@printnostyle{<!--PREFIX }%
  325 \@hacha@arg{}{\usebox{\@htmlprefix}}%
  326 \@printnostyle{-->
  327 }\fi%
  328 \usebox{\@toplinks}\usebox{\@linkstext}%
  329 \cutdef*[\thecuttingdepth]{\cuttingunit}%
  330 \ife\@hacha@defs\else\@printnostyle{<!--SETENV }\@hacha@defs\@printnostyle{-->
  331 }\undef\@hacha@defs\fi
  332 \renewcommand{\addstyle}[1]{\hva@warn{\addstyle{} must be used in document preamble}}%
  333 \@open@par%Open first paragraph
  334 }{%
  335 \@clearstyle\@footnoteflush{\@footnotelevel}\cutend*\title@flush@hook%
  336 \@atenddocument%
  337 \@final@footer%
  338 \@clearstyle%
  339 \@print{</body>
  340 </html>
  341 }\@raise@enddocument}
  342 \newstyle{.center}{text-align:center;margin-left:auto;margin-right:auto;}%
  343 \newstyle{.flushleft}{text-align:left;margin-left:0ex;margin-right:auto;}%
  344 \newstyle{.flushright}{text-align:right;margin-left:auto;margin-right:0ex;}%
  345 % Avoid consecutive tables being stuck together
  346 \newstyle{div table}{margin-left:inherit;margin-right:inherit;margin-bottom:2px;margin-top:2px}
  347 \newstyle{td table}{margin:auto;}
  348 \newstyle{table}{border-collapse:collapse;}
  349 \newstyle{td}{padding:0;}
  350 \newstyle{.cellpadding0 tr td}{padding:0;}
  351 \newstyle{.cellpadding1 tr td}{padding:1px;}
  352 \newstyle{pre}{text-align:left;margin-left:0ex;margin-right:auto;}
  353 \newstyle{blockquote}{margin-left:4ex;margin-right:4ex;text-align:left;}
  354 %Paragraphs in table cells are special (close to latex rendering)
  355 \newstyle{td p}{margin:0px;}
  356 \setenvclass{center}{center}%
  357 \newenvironment{center}{\@open{div}{\envclass@attr{center}}}{\@close{div}}
  358 \setenvclass{flushleft}{flushleft}
  359 \newenvironment{flushleft}
  360   {\@open{div}{\envclass@attr{flushleft}}}
  361   {\@close{div}}
  362 \setenvclass{flushright}{flushright}%
  363 \newenvironment{flushright}
  364   {\@open{div}{\envclass@attr{flushright}}}
  365   {\@close{div}}%
  366 \newcommand{\centerline}[1]{\begin{center}#1\end{center}}
  367 %%quotations env.
  368 \newstyle{.quote}{margin-left:3em;margin-right:3em;text-align:inherit;text-indent:0pt}
  369 \setenvclass{quote}{quote}%
  370 \newenvironment{quote}
  371 {\@close{}\@open{blockquote}{\envclass@attr{quote}}}
  372 {\@close{blockquote}\@open{}{}}%
  373 \newstyle{.quotation}{margin-left:3em;margin-right:3em;text-align:inherit;text-indent:1.5em}
  374 \setenvclass{quotation}{quotation}%
  375 \newenvironment{quotation}
  376 {\@open{blockquote}{\envclass@attr{quotation}}}{\@close{blockquote}}
  377 \newstyle{.verse}{margin-left:3em;margin-right:3em;text-indent:1.5em hanging each-line}
  378 \setenvclass{verse}{verse}%
  379 \newenvironment{verse}
  380 {\@close{}\@open{blockquote}{\envclass@attr{verse}}}
  381 {\@close{blockquote}\@open{}{}}%
  382 \newcommand{\centering}{\@insert{div}{\envclass@attr{center}}}
  383 \newcommand{\raggedleft}{\@insert{div}{\envclass@attr{flushright}}}
  384 \newcommand{\raggedright}{\@insert{div}{\envclass@attr{flushleft}}}
  385 %%special boxes
  386 \newstyle{.parbox}{
  387   box-sizing: border-box;
  388   display: inline-block;
  389   text-indent: 0;
  390 }
  391 \def\@parbox@alignment@spec@bottom{b}
  392 \def\@parbox@alignment@spec@center{c}
  393 \def\@parbox@alignment@spec@top{t}
  394 \RenewcommandHtml{\parbox}[3][]{%
  395   \def\@align{middle}%
  396   \def\@align@spec{#1}%
  397   \ife#1%
  398     \relax
  399   \else
  400     \ifx\@parbox@alignment@spec@center
  401       \relax
  402     \else
  403       \ifx\@align@spec\@parbox@alignment@spec@bottom
  404         \def\@align{text-bottom}%
  405       \else
  406         \ifx\@align@spec\@parbox@alignment@spec@top
  407           \def\@align{text-top}%
  408         \else
  409           \hva@warn{parbox: unknown alignment}%
  410         \fi
  411       \fi
  412     \fi
  413   \fi
  414   \@open{span@inline@block}{class="parbox" style="vertical-align:\@align;width:\css@length{#2}"}%
  415   #3%
  416   \@close{span@inline@block}%
  417 }
  418 \newstyle{.rule-rect}{fill: black;}
  419 \newcommand{\rule}[3][]{%
  420   \ife#1\relax\else\@open{div}{style="display:inline-block;transform:translateY(calc(0pt - ( \css@length{#1} )))"}\fi
  421   \@open{svg}{height="\css@length{#3}" width="\css@length{#2}"}%
  422   \@print{<rect class="rule-rect" }height="100\%" width="100\%\@print{"></rect>}%
  423   \@close{svg}%
  424   \ife#1\relax\else\@close{div}\fi
  425 }
  426 \RenewcommandHtml{\@raisebox}[4]{%
  427   \def\@height{max-content}%
  428   \ife#2%
  429     \relax
  430   \else
  431     \def\@height{\css@length{#2}}%
  432   \fi
  433   \@open{div}{style="display:inline-block;height:\@height;transform:translateY(calc(0pt - ( \css@length{#1} )))"}%
  434   #4%
  435   \@close{div}%
  436 }
  437 %For figure & tables
  438 \newcommand{\@open@quote}[1]{\@open{blockquote}{#1}}
  439 \newcommand{\@close@quote}{\@close{blockquote}}
  440 %%%%%%%%%%%%%%%% LaTeX 2.09 style declarations
  441 \newenvironment{tt}{\@span{style="font-family:monospace"}}{}
  442 \newenvironment{bf}{\@span{style="font-weight:bold"}}{}
  443 \newenvironment{em}{\@style{em}}{}
  444 \newenvironment{it}{\@span{style="font-style:italic"}}{}
  445 \newenvironment{rm}{\@anti{\it,\bf,\em,\sf,\tt}}{}
  446 \newenvironment{tiny}{\@fontsize{1}}{}
  447 \newenvironment{footnotesize}{\@fontsize{2}}{}
  448 \newenvironment{scriptsize}{\@fontsize{2}}{}
  449 \newenvironment{small}{\@fontsize{2}}{}
  450 \newenvironment{normalsize}{\@fontsize{3}}{}
  451 \newenvironment{large}{\@fontsize{4}}{}
  452 \newenvironment{Large}{\@fontsize{5}}{}
  453 \newenvironment{LARGE}{\@fontsize{5}}{}
  454 \newenvironment{huge}{\@fontsize{6}}{}
  455 \newenvironment{Huge}{\@fontsize{7}\@span{style="font-size:150\%"}}{}
  456 % dirty hack for size 7, blame w3c for making css and html size non-convertible
  457 %%%%%% Colors
  458 \newenvironment{purple}{\@fontcolor{purple}}{}
  459 \newenvironment{black}{\@fontcolor{black}}{}
  460 \newenvironment{silver}{\@fontcolor{silver}}{}
  461 \newenvironment{gray}{\@fontcolor{gray}}{}
  462 \newenvironment{white}{\@fontcolor{white}}{}
  463 \newenvironment{maroon}{\@fontcolor{maroon}}{}
  464 \newenvironment{red}{\@fontcolor{red}}{}
  465 \newenvironment{fuchsia}{\@fontcolor{fuchsia}}{}
  466 \newenvironment{green}{\@fontcolor{green}}{}
  467 \newenvironment{lime}{\@fontcolor{lime}}{}
  468 \newenvironment{olive}{\@fontcolor{olive}}{}
  469 \newenvironment{yellow}{\@fontcolor{yellow}}{}
  470 \newenvironment{navy}{\@fontcolor{navy}}{}
  471 \newenvironment{blue}{\@fontcolor{blue}}{}
  472 \newenvironment{teal}{\@fontcolor{teal}}{}
  473 \newenvironment{aqua}{\@fontcolor{aqua}}{}
  474 \def\cal{\ifmath\ifmathml\@style{font-family: cursive }%
  475 \else\red\fi\else\red\fi}
  476 \def\sf{\ifmath\ifmathml\@style{font-family: sans-serif }%
  477 \else\@span{style="font-family:sans-serif"}\fi\else\@span{style="font-family:sans-serif"}\fi}
  478 \def\sl{\ifmath\ifmathml\@style{font-family: fantasy; font-style: italic }%
  479 \else\@span{style="font-style:oblique"}\fi\else\@span{style="font-style:oblique"}\fi}
  480 \def\sc{\@span{style="font-variant:small-caps"}}%
  481 %%%% LaTeX2e verbose declarations
  482 \newenvironment{mdseries}{\@anti{\bf}}{}
  483 \newenvironment{bfseries}{\bf}{}
  484 \newenvironment{rmfamily}{\rm}{}
  485 \newenvironment{sffamily}{\@anti{\tt}\sf}{}
  486 \newenvironment{ttfamily}{\@anti{\sf}\tt}{}
  487 \newenvironment{upshape}{\@anti{\it,\sl,\sc}}{}
  488 \newenvironment{itshape}{\@anti{\sl,\sc}\it}{}
  489 \newenvironment{slshape}{\@anti{\it,\sc}\sl}{}
  490 \newenvironment{scshape}{\@anti{\it,\sl}\sc}{}
  491 \newenvironment{normalfont}{\rm\mdseries\upshape}{}
  492 %%%%%%%%%%%%%%%%
  493 \def\textrm#1{\mbox{\rmfamily#1}}
  494 \def\textup#1{\mbox{\upshape#1}}
  495 \def\textmd#1{\mbox{\mdseries#1}}
  496 \def\textnormal#1{\mbox{\normalfont#1}}
  497 \def\texttt#1{\mbox{\ttfamily#1}}
  498 \def\textit#1{\mbox{\itshape#1}}
  499 \def\textbf#1{\mbox{\bfseries#1}}
  500 \def\textsf#1{\mbox{\sffamily#1}}
  501 \def\textsl#1{\mbox{\slshape#1}}
  502 \def\textsc#1{\mbox{\scshape#1}}
  503 \newcommand{\emph}[1]{\mbox{\em#1}}
  504 %%%%%%%%%%%% Emulate hyphenation
  505 \newcommand{\soft@hyphen}{\@print{&#173;}}
  506 \newcommand{\zero@width@space}{\@print{&#8203;}}
  507 \newcommand{\zero@width@non@joiner}{\@print{&#8204;}}
  508 \newcommand{\breakable@hyphen}{\@print{&#8208;}}
  509 \newcommand{\zero@width@joiner}{\@print{&#8288;}}
  510 \newcommand{\tag@wordbreak}{\@print{<wbr>}}
  511 \newcommand{\word@break@opportunity}{\tag@wordbreak}% use e.g. `\zero@width@space' or `\tag@wordbreak'
  512 \newcommand{\-}{\soft@hyphen}
  513 \newcommand{\discretionary}[3]{%
  514   \ifthenelse{\equal{#1#2#3}{}}{\word@break@opportunity}{%
  515     \ifthenelse{\equal{#1}{-}\and\equal{#2#3}{}}{\soft@hyphen}{%
  516       \ifthenelse{\equal{#1}{-}\and\equal{#2}{}\and\equal{#3}{-}}{\breakable@hyphen}{%
  517         #3}}}}
  518 %%%%%%%%%%%%%%% Multicolumns index formating
  519 \newcommand{\setindexpos}[2]
  520 {\providesavebox{\csname indexpos#1\endcsname}%
  521 \sbox{\csname indexpos#1\endcsname}{\@nostyle #2}}
  522 \newcommand{\getindexpos}[1]{\usebox{\csname indexpos#1\endcsname}}
  523 \newcounter{indexcols}\setcounter{indexcols}{2}
  524 \newcounter{indexcount}\newcounter{indexdepth}
  525 \newcounter{indexbox}
  526 \newcommand{\indexitem}
  527 {\stepcounter{indexcount}%
  528 \end{lrbox}%
  529 \setindexpos{\theindexbox}{\theindexcount}%
  530 \stepcounter{indexbox}%
  531 \providesavebox{\csname indexbox\theindexbox\endcsname}%
  532 \begin{lrbox}{\csname indexbox\theindexbox\endcsname}}
  533 \newcommand{\indexspace}{\indexitem}
  534 {\stepcounter{indexcount}}
  535 \setenvclass{indexenv}{indexenv}
  536 \setenvclass{li-indexenv}{li-indexenv}
  537 \newenvironment{indexenv}
  538   {\setenvclass{itemize}{\getenvclass{indexenv}}%
  539    \setenvclass{li-itemize}{\getenvclass{li-indexenv}}%
  540    \stepcounter{indexdepth}%
  541 %IF
  542    \ifthenelse{\value{indexdepth}>1}
  543 %THEN
  544      {\begin{itemize}%
  545       \renewcommand{\indexitem}{\stepcounter{indexcount}\item}%
  546       \renewcommand{\indexspace}{\stepcounter{indexcount}\vspace*{2ex}}}
  547 %ELSE
  548      {\setcounter{indexbox}{0}\setcounter{indexcount}{0}%
  549       \providesavebox{\csname indexbox0\endcsname}%
  550       \begin{lrbox}{\csname indexbox0\endcsname}}}
  551 {\ifthenelse{\value{indexdepth}>1}
  552 {\end{itemize}\addtocounter{indexdepth}{-1}}
  553 {\end{lrbox}%
  554 \setindexpos{\theindexbox}{\theindexcount}%
  555 \stepcounter{indexbox}%
  556 \addtocounter{indexdepth}{-1}\printindexboxes}}
  557 \newcounter{indexwork}\newcounter{indexlimit}
  558 \newcounter{indexlines}
  559 \newboolean{spaceallowed}
  560 \newboolean{indexcolseprule}
  561 \newcounter{numsep}
  562 \setcounter{numsep}{\value{indexcols}-1}
  563 \newcounter{indexclines}\newcounter{indexprev}\newcounter{indexnow}%
  564 \newcommand{\printindexboxes}
  565 {\setcounter{indexwork}{1}%
  566 \setcounter{indexlimit}
  567   {(\value{indexcount}+\value{indexcols}-1)/\value{indexcols}}%
  568 \setcounter{indexclines}{0}%
  569 \setcounter{indexprev}{0}%
  570 \setcounter{indexnow}{0}%
  571 \ifthenelse{\boolean{indexcolseprule}}%
  572            {\begin{tabular}{X*{\value{numsep}}{|X}}}%
  573            {\begin{tabular}{*{\value{indexcols}}{X}}}
  574 \begin{itemize}
  575 \whiledo{\value{indexwork}<\value{indexbox}}
  576 {\setcounter{indexnow}{\pushint{\getindexpos{\theindexwork}}}%
  577 \addtocounter{indexclines}{\value{indexnow}-\value{indexprev}}%
  578 \ifthenelse{\equal{\usebox{\csname indexbox\theindexwork\endcsname}}{}}
  579 {\ifthenelse{\boolean{spaceallowed}}{\vspace*{2ex}}{}}
  580 {\item}%
  581 \setboolean{spaceallowed}{true}%
  582 \usebox{\csname indexbox\theindexwork\endcsname}%
  583 \stepcounter{indexwork}%
  584 \ifthenelse{\value{indexclines}>\value{indexlimit}}
  585   {\ifthenelse{\value{indexwork}<\value{indexbox}}
  586      {\end{itemize}&\begin{itemize}\setboolean{spaceallowed}{false}%
  587       \setcounter{indexclines}{0}}
  588      {}}%
  589   {}%
  590 \setcounter{indexprev}{\value{indexnow}}}%
  591 \end{itemize}\end{tabular}}
  592 %%%%%% Default table attribute for array and tabular
  593 \newcommand{\@table@attributes}{style="border-spacing:6px;border-collapse:separate" class="cellpading0"}
  594 \newcommand{\@table@attributes@border}{style="border-spacing:0" class="cellpadding1"}
  595 %
  596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  597 %   Redefining \textoverline of latexcommon.hva			%
  598 %   Here we can use HTML primitives				%
  599 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  600 %
  601 \newcommand{\overlinedbox}[1]%
  602      {{\@styleattr{span}{style="text-decoration:overline"}#1}}% 
  603 \renewcommand{\textoverline}[1]{\overlinedbox{#1}}%
  604 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  605 %   Redefining \fbox of latexcommon.hva	         		%
  606 %   Here we can use HTML primitives				%
  607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  608 \newstyle{.lrbox}{box-sizing:border-box;display:inline-block;overflow:visible;white-space:nowrap;}
  609 \newstyle{.center-lrbox}{display:inline-block;margin-left:50\%;transform:translateX(-50\%);}
  610 \newstyle{.makebox}{}
  611 \newstyle{.framebox}{border:1px solid black;padding:0.25em;}
  612 \def\@lrbox@alignment@spec@center{c}
  613 \def\@lrbox@alignment@spec@left{l}
  614 \def\@lrbox@alignment@spec@right{r}
  615 \newcommand{\@lr@box@attr}[2]{%
  616   \ife#1%
  617     \relax
  618   \else
  619     \def\@flush@alignment{}%
  620     \ife#2%
  621       \relax
  622     \else
  623       \def\@alignment@spec{#2}%
  624       \ifx\@alignment@spec\@lrbox@alignment@spec@center
  625         \relax
  626       \else
  627         \ifx\@alignment@spec\@lrbox@alignment@spec@left
  628           \def\@flush@alignment{text-align:left;}%
  629         \else
  630           \ifx\@alignment@spec\@lrbox@alignment@spec@right
  631             \def\@flush@alignment{text-align:right;direction:rtl;}%
  632           \else
  633             \hva@warn{unknown lr-box alignment}%
  634           \fi
  635         \fi
  636       \fi
  637     \fi
  638     style="width:\css@length{#1};\@flush@alignment"%
  639   \fi
  640 }
  641 \newenvironment{@center@lrbox}%
  642   {\@open{span@inline@block}{class="center-lrbox"}}%
  643   {\@close{span@inline@block}}
  644 \newcommand{\@conditionally@center@lrbox@begin}[2]{%
  645   \ife#1
  646     \relax
  647   \else
  648     \ife#2%
  649       \@center@lrbox
  650     \else
  651       \def\@alignment@spec{#2}%
  652       \ifx\@alignment@spec\@lrbox@alignment@spec@center
  653         \@center@lrbox
  654       \fi
  655     \fi
  656   \fi
  657 }
  658 \newcommand{\@conditionally@center@lrbox@end}[2]{%
  659   \ife#1
  660     \relax
  661   \else
  662     \ife#2%
  663       \end@center@lrbox
  664     \else
  665       \def\@alignment@spec{#2}%
  666       \ifx\@alignment@spec\@lrbox@alignment@spec@center
  667         \end@center@lrbox
  668       \fi
  669     \fi
  670   \fi
  671 }
  672 \newcommand{\@lr@box}[4]{%
  673   \@open{span@inline@block}{\@lr@box@attr{#1}{#2} class="lrbox #4"}%
  674   \@conditionally@center@lrbox@begin{#1}{#2}%
  675   \textnormal{#3}%
  676   \@conditionally@center@lrbox@end{#1}{#2}%
  677   \@close{span@inline@block}%
  678 }
  679 \RenewcommandHtml{\@makebox}[3]{\@lr@box{#1}{#2}{#3}{makebox}}
  680 \RenewcommandHtml{\@framebox}[3]{\@lr@box{#1}{#2}{#3}{framebox}}
  681 \RenewcommandHtml{\fbox}[1]{\framebox{#1}}
  682 %%Style of bars
  683 \def\@barsz{2px}
  684 \def\@@barsz{4px}%2 x
  685 \def\@@@barsz{6px}%3 x
  686 \def\@@@@barsz{8px}%3 x
  687 \newstyle{.vertical-rule}{border:none;width:\@barsz;background-color:black;}
  688 \newstyle{.horizontal-rule}{border:none;background-color:black;}
  689 \newstyle{.hrule}{border:none;height:\@barsz;width:100\%;background-color:black;}
  690 \newstyle{.hfill}{border:none;height:1px;width:200\%;background-color:black;}
  691 %%%Bars with HR
  692 \newcommand{\@hfill}{{\@nostyle\@print{<hr class="hfill"}}}
  693 \newcommand{\@hbar}[1][]{%
  694   {\@clearstyle
  695    \def\@tmp{#1}%
  696    \@print{<hr class="horizontal-rule"}%
  697    \@getprint{\ifx\@tmp\@empty\else{} #1\fi}%
  698    \@print{>}}%
  699 }
  700 \newcommand{\@vbar}[1][]{%
  701   {\@clearstyle
  702    \def\@tmp{#1}%
  703    \@print{<hr class="vertical-rule"}%
  704    \@getprint{\ifx\@tmp\@empty\else{} #1\fi}%
  705    \@print{>}}%
  706 }
  707 %%Bars with div
  708 \newcommand{\@@hbar}[1][]{%
  709   {\@clearstyle
  710    \def\@tmp{#1}%
  711    \@open{div}{class="horizontal-rule"\ifx\@tmp\@empty\else{} #1\fi}%
  712    \@force{div}}%
  713 }
  714 \newcommand{\@@vbar}[1][]{%
  715   {\@clearstyle
  716    \def\@tmp{#1}%
  717    \@open{div}{class="vertical-rule"\ifx\@tmp\@empty\else{} #1\fi}%
  718    \@force{div}}%
  719 }
  720 %%Style of paragraphs
  721 \ifverbd\newstyle{p}{border:1px solid gray}\fi
  722 \ifverbd\newstyle{div}{border:1px dotted gray}\fi
  723 %%Style of display
  724 \def\@orange{\@print{#}FF8000}
  725 \def\@magenta{fuchsia}
  726 \def\@dtstyle{border-collapse:separate;border-spacing:\@barsz;line-height:1.1;width:auto;}
  727 \def\@dcstyle{white-space:nowrap;padding:0px;}%;width:auto;}
  728 \newstyle{.vdisplay}{\@dtstyle{} empty-cells:show; border:2px solid red;}
  729 \newstyle{.vdcell}{\@dcstyle{} border:2px solid green;}
  730 \newstyle{.display}{\@dtstyle{} border:none;}
  731 \newstyle{.dcell}{\@dcstyle{} border:none;}
  732 \newstyle{.dcenter}{margin:0ex auto;}
  733 \newstyle{.vdcenter}{border:solid \@orange{} 2px; margin:0ex auto;}
  734 %%% And we can get something similar for extensible arrows accents.
  735 \newcommand{\@vd}{\ifverbd{}v\fi}
  736 \newcommand{\@dclass}{class="\@vd{}display"}
  737 \DeclareSymbolHtml{\hva@righthead}{X25B8}
  738 \DeclareSymbolHtml{\hva@lefthead}{X25C2}
  739 \DeclareSymbolHtml{\hva@uphead}{X25B4}
  740 \DeclareSymbolHtml{\hva@downhead}{X25BE}
  741 \DeclareSymbolHtml{\hva@lrt}{X25E2}
  742 \DeclareSymbolHtml{\hva@llt}{X25E3}
  743 \DeclareSymbolHtml{\hva@ult}{X25E4}
  744 \DeclareSymbolHtml{\hva@urt}{X25E5}
  745 \DeclareSymbolHtml{\hva@utr}{X25B2}
  746 \DeclareSymbolHtml{\hva@dtr}{X25BC}
  747 \newcommand{\@open@dcell}[1]
  748 {\def\@tmp{#1}%
  749 \@open{td}{class="\@vd{}dcell" \ifx\@tmp\@empty\else{} \@addstyle{text-align:center}{#1}\fi}}
  750 \newcommand{\@close@dcell}{\@close{td}}
  751 \newcommand{\d@cell}[2][]{\@open@dcell{#1}#2\@close@dcell}
  752 \newcommand{\@open@display}
  753 {\@open{table}{class="\@vd{}display" style="width:100\%;"}\@open{tr}{}}
  754 \newcommand{\@close@display}{\@close{tr}\@close{table}}
  755 \newcommand{\@open@sizer}{}
  756 \newcommand{\@close@sizer}{}
  757 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  758 %% Generic positioning of extensible upper accent
  759 %% Beware need to open display inside itemdisplays.
  760 %% Need also to open two displays so as to avoid 100% to
  761 %% mean all page width, in case command is alone in
  762 %% display!
  763 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  764 \newcommand{\@over@arrow}[3][2]
  765 {\@open@sizer\@open@display%
  766 #2%
  767 \@close{tr}\@open{tr}{}%
  768 \d@cell[colspan="#1"]{#3}%
  769 \@close{tr}\@open{tr}{}%
  770 \d@cell[colspan="#1"]{~}%
  771 \@close@display\@close@sizer}
  772 \newcommand{\textoverleftarrow}[1]
  773 {\hva@warn{\overleftarrow outside display mode}#1}
  774 \newcommand{\@overleftarrow}[1]
  775 {\mathop{\@over@arrow
  776   {\d@cell[style="width:10\%"]{\hva@lefthead}%
  777    \d@cell[style="width:90\%"]{\@hbar}}
  778   {#1}}\intlimits}
  779 \newcommand{\overleftarrow}{\DisplayChoose\@overleftarrow\textoverleftarrow}
  780 \newcommand{\textoverrightarrow}[1]
  781 {\hva@warn{\overrightarrow outside display mode}#1}
  782 \newcommand{\@overrightarrow}[1]
  783 {\mathop{\@over@arrow
  784   {\d@cell[style="width:90\%"]{\@hbar}\d@cell[style="width:10\%"]{\hva@righthead}}
  785   {#1}}\intlimits}
  786 \newcommand{\overrightarrow}{\DisplayChoose\@overrightarrow\textoverrightarrow}
  787 \newcommand{\textoverbrace}[1]
  788 {\hva@warn{\overbrace in non-display mode}#1}
  789 \newcommand{\@overbrace}[1]
  790 {\mathop{\@over@arrow[5]
  791   {\d@cell[style="width:5\%"]{\hva@lrt}%
  792    \d@cell[style="width:40\%;"]{\@hbar}%
  793    \d@cell[style="width:10\%"]{\hva@utr}%
  794    \d@cell[style="width:40\%"]{\@hbar}%
  795    \d@cell[style="width:5\%"]{\hva@llt}}
  796   {#1}}}
  797 \newcommand{\overbrace}{\DisplayChoose\@overbrace\textoverbrace}
  798 \newcommand{\@under@arrow}[3][2]
  799 {\@open@sizer\@open@display%
  800 \d@cell[colspan="#1"]{~}\@close{tr}%
  801 \@open{tr}{}\d@cell[colspan="#1"]{#3}\@close{tr}%
  802 \@open{tr}{}#2%
  803 \@close@display\@close@sizer}
  804 \newcommand{\textunderbrace}[1]
  805 {\hva@warn{\underbrace in non-display mode}#1}
  806 \newcommand{\@underbrace}[1]
  807 {\mathop{\@under@arrow[5]
  808   {\d@cell[style="width:5\%"]{\hva@urt}%
  809    \d@cell[style="width:40\%"]{\@hbar}%
  810    \d@cell[style="width:10\%"]{\hva@dtr}%
  811    \d@cell[style="width:40\%"]{\@hbar}%
  812    \d@cell[style="width:5\%"]{\hva@ult}}
  813   {#1}}}
  814 \newcommand{\underbrace}{\DisplayChoose\@underbrace\textunderbrace}
  815 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  816 %%%%%%%%concrete minipage
  817 \newstyle{.minipage}{text-align:left; margin-left:0em; margin-right:auto;}
  818 \setenvclass{minipage}{minipage}
  819 \newenvironment{@minipage}
  820 {\@open{div}{class="\getenvclass{minipage}"}}
  821 {\@close{div}}
  822 %%%%%%%%margin par
  823 \newstyle{.marginpar}{border:solid thin black; margin-bottom:1ex; width:20\%; text-align:left;}
  824 \newstyle{.marginparleft}{float:left; clear:left; margin-left:0ex; margin-right:1ex;}
  825 \newstyle{.marginparright}{float:right; clear:right; margin-left:1ex; margin-right:0ex;}
  826 \newif\ifmarginright\marginrighttrue
  827 \setenvclass{marginpar}{marginpar}
  828 \setenvclass{marginparside}{marginparright}
  829 \newcommand{\normalmarginpar}
  830   {\setenvclass{marginparside}{marginparright}\marginrighttrue}
  831 \newcommand{\reversemarginpar}
  832   {\setenvclass{marginparside}{marginparleft}\marginrightfalse}
  833 \newcommand{\hva@mtemp}{}
  834 \newcommand{\marginpar}[2][]
  835 {\def\hva@mtemp{#1}%
  836 \@open{span@inline@block}{class="\getenvclass{marginpar} \getenvclass{marginparside}"}%
  837 \ifx\hva@mtemp\@empty%
  838 #2%
  839 \else\ifmarginright
  840 #2%
  841 \else
  842 #1%
  843 \fi\fi
  844 \@close{span@inline@block}}
  845 %%%%%%%%Default env classes for verbatim and verb
  846 \setenvclass{verbatim}{verbatim}
  847 \setenvclass{verb}{verb}
  848 %%%%%% format theorems
  849 \newcommand{\set@th@font}[1]{\def\th@font{#1}}
  850 \let\th@font\em
  851 \newstyle{.theorem}{text-align:left;margin:1ex auto 1ex 0ex;}
  852 \newcommand{\set@th}[1]
  853 {\global\let\csname#1@font\endcsname\th@font%
  854 \setenvclass[\global]{#1}{theorem}}
  855 \newenvironment{th@env}[3]
  856 {\@open{div}{class="\getenvclass{#1}"}%
  857 \refstepcounter{#2}\textbf{#3~\csname{}the#2\endcsname}%
  858 \def\th@tmp{#1}\th@kont}
  859 {\@close{div}}
  860 \newcommand{\th@kont}[1][]
  861 {\ifoptarg~\textbf{(#1)}\fi\quad\csname\th@tmp{}@font\endcsname}
  862 %%%%%% Do not load hevea.hva again !
  863 \def\csname hevea@loaded\endcsname{}