# HTMTEX Markup
# Marjan Divjak / 2014-10-01


HTMTEX MARKUP

Markup characters - Slovenian characters - Greek characters -
Mathematical symbols - Typographic symbols - Diacritics -
Scalars, vectors, tensors - Subscripts, superscripts - Line
mathematics - Displayed mathematics - Matrices - Tables - 
Caveats


Markup characters

    In an HTML document, some characters have special meaning:

        & < >

    These characters are used for HTML structure markup (entities
    and tags) and cannot be displayed directly by web browsers. To
    be displayable, they must be authored as entities:

        &amp; &lt; &gt;

    An HTML+TEX document has additional characters for markup:

        \ ' $ { } _ ^ ` ~

    These characters are interpreted by the HTMTEX processor. To
    override their markup meaning, they must be backslash-escaped:

        \\ \' \$ \{ \} \_ \^ \` \~


Slovenian characters
   
    Slovenian language has some characters that are not included in
    7-bit ASCII. They are authored as quote-escaped ASCII
    characters:

        C' c' S' s' Z' z' 


Greek characters

    Greek characters are authored as backslash-escaped ASCII
    strings:

        \Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Phi \Psi
        \Omega

        \alpha \beta \gamma \delta \epsilon \zeta \eta \theta
        \kappa \lambda \mu \nu \xi \pi \rho \sigma \tau \phi
        \varphi \chi \psi \omega


Mathematical symbols
  
    A handful of ASCII characters can be used as math symbols
    directly:

        + = ( ) [ ] % 

    Two "mathematical" ASCII characters having an HTML markup
    function must be authored as HTML entities:

        &gt; &lt;

    All other mathematical symbols can be entered as
    backslash-escaped strings:

        \infty \hbar \Lag \Ham
        \permil \deg \min \sec \prime \pprime
        \minus \middot \times \divide \bull \fras \root 
        \sum \Sum \prod \Prod 
        \partial \del \int \Int \oint \Oint 
        \pm \mp \ne \equiv \approx \sim \propto \perp \parto
        \ge \gg \le \ll \isin
        \larr \uarr \rarr \darr \harr \varr
        \lArr \uArr \rArr \dArr \hArr \vArr
        \LArr \RArr \HArr
        \bra \ket

    For easy authoring, the following syntactical sugar is
    available:

        -            stands for \minus
        @                       \partial
        +-                      \pm
        -+                      \mp
        !=                      \ne
        ==                      \equiv
        %=                      \approx
        ~=                      \sim
        :=                      \propto
        -|                      \perp
        ||                      \parto
        SPACE . SPACE           SPACE \middot SPACE
        SPACE * SPACE           SPACE \times SPACE
        SPACE / SPACE           SPACE \divide SPACE

    To override single-character candies, they must be
    backslash-escaped:

        \- \@ \. \* \/


Typographic symbols

    Typographic symbols are entered as backslash-escaped strings:

        \figdash \endash \emdash \hellip
        \oline \sect \copyright \registered 
        \wsquare \square \wdiamond \diamond \loz

    Appropriate syntactical sugar is available as well:

        --                     \endash
        ---                    \emdash
        ...                    \hellip


Diacritics

    Diacritics to a symbol X are entered as backslash-escaped
    suffixes:

        X\hat
        X\tld 
        X\bar
        X\dot
        X\ddot


Subscripts and superscripts

    Subscripts and superscripts to a symbol X are authored using
    the _ ^ operators. They operate on a single character or a { }
    string:

        X_i
        X_{ij}
        X_{\phi}

        X^i
        X^{i + j}
        X^{\pi\phi}


Scalars, vectors, tensors

    Any symbol X, be it a single character, backslash-escaped
    string, diacritic compound, subscript, or superscript, can be
    explicitly denoted as scalar, vector, or tensor via the ` ~
    operators. Examples:

        `c
        ~v
        ~~M
        `{\rho}
        `{x\hat}
        x_{`i}
        x^{`i`j}
        x_{`{\mu\nu}}


Line mathematics

    Line mathematics is enclosed between two $ characters, for
    example $`c^2 = `a^2 + `b^2$. It is essentialy one-dimensional,
    including subscripts and superscripts, but no explicit
    fractions. It can be split between lines by ending a line with
    the backslash \.


Displayed mathematics

    Displayed mathematics is authored as follows:

        <div class="math">
        <p>$     $</p>
        <p>$     $</p>
        </div>    
        
    Each interior line contains mathematics. It can be a simple
    line mathematics or it can contain fractions and
    "three-deckers". A fraction is typeset as { : }, and a
    three-decker via the { : : } construct. No nesting is allowed.
    For example:

        F = m{dv : dt}
        f(b) - f(a) = {b:\Int:a} f\dot(t) dt
    

Matrices

    Displayed mathematics can include matrices. How they are coded
    is best seen in the following example of the 3 x 3 matrix:

        ~~A = [[11|21|31][12|22|32][13|23|33]]

    The first element [||] is the first column etc. In this
    construct, special meaning is given to characters [ ] |, so
    matrix elements shall not contain them.


Tables

    Tables take the following form:

        <div class="data">
        <pre>[A | B ! C]</pre>
        <pre>(a | b ! c)</pre>
        <pre> d | e ! f </pre>
        </div>

    Characters [ ] ( ) denote the header and the body section.
    Cells are separated via | or ! indicating left or right flushed
    content. Since these characters have special meanings, they
    should not be used inside cells.


Caveats

    Comments between <!-- and --> tags in the input file are not
    included in the output file.

    A math span between two dollar signs can occupy two or more
    physical lines only if they are ended by backslashes.

    A math division shall include lines starting with <p>$ and
    ending with $</p> without anything between the dollar and
    paragraph tags. No line outside the math division is allowed to
    start this way, otherwise it will be wrongly interpreted. To
    prohibit this, a blank may be inserted.

    A data division shall include lines starting with the <pre>
    tag, followed immediately by [, (, or blank space. The blank
    shall not be ommited. Similar rules must be observed for the
    ending tags.

    The user's HTML+TEX document shall include a link to the main
    CSS file (made by user) followed with a link to the
    "mathematical" CSS file htmtex.css. The main CSS file shall
    reference a font containing Unicode characters needed, for
    example DejaVu.

    Any ASCII "minus" (-) will be interpreted as UNICODE minus
    unless it is escaped as \-. In the HTML document header there
    is usually a charset reference "UTF-8". This reference has to
    be coded as UTF\-8". The same applies to the stylesheet file
    link. Instead of href="my-stylesheet.css", for example,
    one has to code href="my\-stylesheet.css".

# end
