# HTMTEX Introduction
# Marjan Divjak / 2012-10-01


HTMTEX INTRODUCTION

The hand-coding problem - Document authoring - Document
conversion


The hand-coding problem

    Hand-coding HTML documents - using any ASCII editor - is both
    easy and rewarding. Author is in the full command of the
    markup. However, this is only true for rather simple documents.
    As soon as documents get complicated the markup line noise
    becomes detrimental to hand-coding. This happens in three main
    cases:

      * when entering non-ASCII characters, 

      * when constructing tables, and 

      * when writing mathematics. 

    All these cases are dealt with beautifully in TEX documents.
    Wouldn't it be nice if one could hand-code - inside the HTML
    document and in the HTML-compliant syntax - TEX-like markup
    islands, run a simple processor on a file, and produce a fully
    fledged HTML document ready for publishing on the Web?


Document authoring

    This is possible with HTMTEX. HTMTEX is both a TEX-like
    HTML-compliant markup langugage and a processor to convert
    HTML+TEX sources into fully fledged HTML documents. Its
    capabilities are best illustrated with some examples.

    (i) Slovenian special characters are coded as c's'z', Greek
    characters as \alpha or \Omega, mathematical symbols as \root
    or \Int, and various typesetting symbols as --- or ... or
    whatever.

    (ii) Tables are coded in the following proto-form:

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

    (iii) Mathematics can be expressed in a line mode as 
    $c^2 = a^2 + b^2$. In a display mode, one writes:

        <div class="math">
        <p>$F = {dG : dt}$</p>
        <p>$G = {mv : \root(1 - v^2 / c^2)}$</p>
        </div>    

    If you are fancy you can denote scalars as `s, vectors as ~v,
    and tensors as ~~T. The markup gets more cluttered but the
    results are visually much better. You may notice that although
    the code is TEX-like as close as practical, the overall syntax
    is still fully HTML-compliant.


Document conversion

    A terse HTML+TEX document is converted into the expanded HTML
    document by filtering it through the processor - a simple sed
    script. It runs under the operating system Unix / Linux but can
    easily be modified to run under other operating systems where
    sed is available.

    What are the results after conversion?

      * The quote- and backslash-escaped strings are replaced by
        corresponding Unicode UTF-8 characters,

      * proto-tables are converted into explicit tables,

      * line mathematics is transformed into mathematical spans,
        and

      * in the displayed mathematics, every math line is elaborated
        into an explicit table.

    Visual layout of the resulting spans and tables is regulated
    via the customized style sheet. So any general purpose browser
    - supporting tables and style sheets - can be used to view the
    documents. Of course, appropriate fonts are required as well.
    DejaVu fonts are a good choice.

# end

