Unicorn Formatting Objects (UFO), Version 1.00.01
Specification for TeX Back-End
Created: 04-Sep-2000
Revised: 15-Sep-2000
Last revision: 29-Sep-2000
Copyright (C) 2000, Unicorn Enterprises SA
All rights reserved
1 Introduction
--------------
This document describes the LaTeX package 'uxttex'. This package
contains definitions for TeX macros that define interface between
the XSL front-end and the TeX-based back-end.
The source code for the package can be found in the file UXTTEX.STY
included in the product distribution. 
The additional package CHRDEF.STY is introduced starting with version
1.00.01. It contains TeX definitions for many Unicode characters.
This package is used by UXTTEX.STY.
In this document, each TeX macro is described. If any macro requires
arguments, the number of arguments appears after the macro name in 
brackets, and the meaning of each argument is described as well.
This specification should be considered as work in progress.
We are actively working on the product, and the newly implemented
features may lead to the frequent updates of this specification.
2 Setting fonts
---------------
The following macros are provided to set the current font.
Each command requires exactly one argument that specifies the
font size. In the following list, fonts that do not belong
to 35 standard PostScript fonts but are supported by NFSS
are marked with the * sign. Fonts of 'Utopia' family might 
be not available in some TeX distributions, this fonts are
marked with the double * sign.
\pagd             AvantGarde-Demi
\pagdo            AvantGarde-DemiOblique
\pagk             AvantGarde-Book
\pagko            AvantGarde-BookOblique
\pbkd             Bookman-Demi
\pbkdi            Bookman-DemiItalic
\pbkdo            Bookman-DemiOblique (*)
\pbkl             Bookman-Light
\pbkli            Bookman-LightItalic
\pbklo            Bookman-LightOblique (*)
\pcrb             Courier-Bold
\pcrbo            Courier-BoldOblique
\pcrr             Courier
\pcrro            Courier-Oblique
\phvb             Helvetica-Bold
\phvbo            Helvetica-BoldOblique
\phvbrn           Helvetica-Narrow-Bold
\phvbon           Helvetica-Narrow-BoldOblique
\phvr             Helvetica
\phvro            Helvetica-Oblique
\phvrrn           Helvetica-Narrow
\phvron           Helvetica-Narrow-Oblique
\pncb             NewCenturySchlbk-Bold
\pncbi            NewCenturySchlbk-BoldItalic
\pncbo            NewCenturySchlbk-Oblique (*)
\pncr             NewCenturySchlbk-Roman
\pncri            NewCenturySchlbk-Italic
\pncro            NewCenturySchlbk-Oblique (*)
\pplb             Palatino-Bold
\pplbi            Palatino-BoldItalic
\pplbo            Palatino-BoldOblique (*)
\pplr             Palatino-Roman
\pplri            Palatino-Italic
\pplro            Palatino-Oblique (*)
\psyr             Symbol
\ptmb             Times-Bold
\ptmbi            Times-BoldItalic
\ptmbo            Times-BoldOblique (*)
\ptmr             Times-Roman
\ptmri            Times-Italic
\ptmro            Times-Oblique (*)
\putb             Utopia-Bold (**)
\putbi            Utopia-BoldItalic (**)
\putbo            Utopia-BoldOblique (**)
\putr             Utopia-Roman (**)
\putri            Utopia-Italic (**)
\putro            Utopia-Oblique (**)
\pzcmi            ZapfChancery-MediumItalic
\pzdr             ZapfDingbats
3 Setting Color
---------------
\clr [1]          Set text color
    This macro requires a single argument that specifies
    the RGB color. The argument format is
        r,g,b
    where 'r', 'g' and 'b' are numbers between 0 and 1 that specify 
    the intensity for red, green and blue color components. The
    components must be separated using ',' (comma) sign.
    Examples:
        \clr{1,0,0}    % red
        \clr{1,1,1}    % black
4 Setting Properties, Generic
-----------------------------
The following macros are used to set properties for the formatting
objects other than table cell. These macros are usually called
before the macro corresponding to the start of the formatting object.
\bgc [1]          Set background color
    This macro requires a single argument that specifies
    the RGB background color. See section 'Setting Color' for the
    argument syntax. A single letter 't' should be specified
    for the transparent background.
    Examples:
        \clr{0,0,1}    % blue
        \clr{t}        % transparent
\bct  [1]         Set border-top-color
\bcb  [1]         Set border-bottom-color
\bcl  [1]         Set border-left-color
\bcr  [1]         Set border-right-color
\bctb [1]         Set border-top-color and border-bottom-color
                    to the same value
\bclr [1]         Set border-left-color and border-right-color
                    to the same value
\bcx  [1]         Set border-top-color, border-bottom-color,
                    border-left-color and border-right-color
                    to the same value
    These macros require a single argument that specifies
    the RGB border color. See section 'Setting Color' for the
    argument syntax.
\bwt  [1]         Set border-top-width
\bwb  [1]         Set border-bottom-width
\bwl  [1]         Set border-left-width
\bwr  [1]         Set border-right-width
\bwtb [1]         Set border-top-width and border-bottom-width
                    to the same value
\bwlr [1]         Set border-left-width and border-right-width
                    to the same value
\bwx  [1]         Set border-top-width, border-bottom-width,
                    border-left-width, border-right-width
                    to the same value
    These macros require a single length argument that specifies 
    the border width.
\pt   [1]         Set padding-top
\pb   [1]         Set padding-bottom
\pl   [1]         Set padding-left
\pr   [1]         Set padding-right
\ptb  [1]         Set padding-top and padding-bottom to the same value
\plr  [1]         Set padding-left and padding-right to the same value
\px   [1]         Set padding-top, padding-bottom, padding-left
                    and padding-right to the same value
    These macros require a single length argument that specifies 
    the padding.
\mt   [1]         Set margin-top
\mb   [1]         Set margin-bottom
\ml   [1]         Set margin-left
\mr   [1]         Set margin-right
\mtb  [1]         Set margin-top and margin-bottom to the same value
\mlr  [1]         Set margin-left and margin-right to the same value
\mx   [1]         Set margin-top, margin-bottom, margin-left and
                    margin-right to the same value
    These macros require a single length argument that specifies 
    the margin.
    The \ml and \mr macros have the special interpretation for
    tables of type A (tables outside boxes, translated to the
    LaTeX 'longtable' environment). In this case \ml sets the
    absolute distance from the left side page margin to the
    left edge of the table. The value set by \mr is ignored in
    this case (the front-end usually generates zero value).
\rah  [1]        Set "reference area" height
\raw  [2]        Set "reference area" width
    These macros require a single length argument.
    The "reference area" height is calculated by the front-end based
    on the calculated formatting object properties as
        margin-top +
            border-top-width +
            padding-top +
            height +
            padding-bottom +
            border-bottom-width +
            margin-bottom
    The "reference area" width is calculated by the front-end based
    on the calculated formatting object properties as
        margin-left +
            border-left-width +
            padding-left +
            width +
            padding-right +
            border-right-width +
            margin-right
\lfp  [1]         Set "linefeed preserve" flag
\spp  [1]         Set "space preserve" flag
    These macros require a single argument. The argument must
    be a single letter 't' if linefeeds/spaces are to be 
    preserved and a single letter 'f' otherwise.
\ta   [1]         Set table alignment
    This macro requires a single argument. The argument must be 
    represented by a single letter:
        l    left
        r    right
        c    center
        j    justify
\ti   [1]        Set text-indent
    This macro requires a single length argument that specifies
    text indentation.
\ch   [1]        Set content-height
\cw   [1]        Set content-width
    These macros are used to set content height and content width
    for the external graphic object. The argument value must be 
    either the length, the number or the single '!'
    character. The length argument means the absolute length.
    The number argument means the scale factor. The '!' character
    means the 'auto' value. If one of 'content-height' or
    'content-width' properties is specified as a scale factor,
    the other must be specified either as a scale factor or as 'auto'.
\chwp
    This macro with no arguments must be called if and only if at least
    one of 'content-height' or 'content-width' properties was assigned
    a percentage value (and therefore at least one of \ch or \cw 
    specifies the scale factor).
\rs   [1]        Set rule-style
     This macro requires a single argument. The argument must be
     represented by a single digit:
         0    none
         1    dotted
         2    dashed
         3    solid, double, groove, ridge
\rt   [1]        Set rule-thickness
    This macro requires a single length argument that specifies
    the rule thickness.
\pls  [1]        Set provisory-label-separation
\pdbs [1]        Set provisory-distance-between-starts
    These macros require a single length argument that specifies
    the appropriate property value.
\va   [1]        Set vertical-align
     This macro requires a single argument. The argument must be
     represented by a single letter:
         t    top
         b    bottom
         m    middle
5 Setting Properties, Table Cell
--------------------------------
The separate set of macros is used to set properties for table
cells. The separate set of properties is maintained by the
back-end for each active column. For each table, every column
is assigned a unique identifier by the front-end. Identifiers
are letter sequences that represent integer column indexes 
in radix 52, where
    'A' stands for 0 
    'B' stands for 1
        ...
    'Z' stands for 25
    'a' stands for 26
    'b' stands for 27
        ...
    'z' stands for 51
Columns for a table that is not a descendant of any other table
are numbered starting with 0. For example, if such table has
5 columns, the first column will be assigned an identifier of 'A'
and the last column will be assigned an identifier 'E'.
Columns for a table that is a descendant of another table
are numbered starting with the value equal to the sum of
numbers of columns for all table ancestors. For example, if the
table with 5 columns mentioned in the previous paragraph has
a descendant table with 3 columns, then columns of this
descendant table will receive identifiers from 'F' to 'H'.
Therefore, at any time each column of each active table
(i.e., the table for which formatting was started but not yet
finished) receives the unique identifier.
For each identifier the separate set of properties is maintained.
Property values defined for each color are transitional between
rows. For each new row of the table, only the properties that
were changed in comparison with the previous row should be
specified.
Each macro of this group requires two arguments. The first
argument specifies the column identifier, the second argument
specifies the property value. The property value syntax is the
same as for corresponding generic property setting commands.
\gbgc  [2]        Set background property
\gbct  [2]        Set border-top-color
\gbcb  [2]        Set border-bottom-color
\gbcl  [2]        Set border-left-color
\gbcr  [2]        Set border-right-color
\gbctb [2]        Set border-top-color and border-right-color
                    to the same value
\gblr  [2]        Set border-left-color and border-right-color
                    to the same value
\gbcx  [2]        Set border-top-color, border-bottom-color,
                    border-left-color and border-right-color
                    to the same value
\gbwt  [2]        Set border-top-width
\gbwb  [2]        Set border-bottom-width
\gbwl  [2]        Set border-left-width
\gbwr  [2]        Set border-right-width
\gbwtb [2]        Set border-top-width and border-bottom-width
                    to the same value
\gbwlr [2]        Set border-left-width and border-right-width
                    to the same value
\gbx   [2]        Set border-top-width, border-bottom-width,
                    border-left-width and border-right-width
                    to the same value
\gpt   [2]        Set padding-top
\gpb   [2]        Set padding-bottom
\gbl   [2]        Set padding-left
\gbr   [2]        Set padding-right
\gptb  [2]        Set padding-top and padding-bottom to the same value
\gplr  [2]        Set padding-left and padding-right to the same value
\gpx   [2]        Set padding-top, padding-bottom, padding-left
                    and padding-right to the same value
\graw  [2]        Set "reference area" width
\glfp  [2]        Set "linefeed preserve" flag
\gspp  [2]        Set "space preserve" flag
\gta   [2]        Set text-align
\gti   [2]        Set text-indent
\gva   [2]        Set vertical-align
    The "reference area" width is calculated by the front-end based
    on the calculated formatting object properties as
        border-left-width +
            padding-left +
            column-width +
            padding-right +
            border-right-width
6 Flow Formatting Object
------------------------
\fls  [2]         Start flow
\fle              End flow
    The macro \fls marks start of the formatting object. It requires
    exactly two arguments. The first argument is a length that
    specifies the left margin - the distance from the left page margin
    to the left side of the body region corresponding to the flow.
    The second argument is a length that specifies the right margin -
    the distance from the right page margin to the right side of the 
    body region corresponding to the flow.
    The macro \fle marks end of the formatting object.
7 Static Content Formatting Objects
-----------------------------------
There are two types of static content formatting objects:
    type A - static content corresponding to region before
    type B - static content corresponding to region after
\scsA [2]         Start static content, type A
\scsB [2]         Start static content, type B
\sceA             End static content, type A
\sceB             End static content, type B
    Macros \scsA and \scsB mark start of the formatting object.
    They require exactly two arguments. The first argument
    is a length that specifies the height of the corresponding
    region. The second argument is a length that specifies the width
    of the corresponding region.
    Macros \sceA and \sceB mark end of the formatting object.
8 Block Formatting Object
-------------------------
There are three types of block formatting objects:
    type A - block with the fixed height
    type B - block with the 'auto' height that either:
                 has background-color property other than transparent
                 has left and/or right border
    type C - block with the 'auto' height that does not
             belong to type B
\bliA             Initialize block properties, type A
\bliB             Initialize block properties, type B
\bliC             Initialize block properties, type C
    These set block-related properties to there "default" values, 
    in particular:
        - background color is set to transparent
        - border colors are set to black
        - border widths are set to zero
        - padding values are set to zero
        - margin values are set to zero
\blsA             Start block, type A
\blsB             Start block, type B
\blsC             Start block, type C
    These macros mark start of the block.
\bleA             End block, type A
\bleB             End block, type B
\bleC             End block, type C
    These macros mark end of the block.
The typical calling sequence looks as follows (block of type A
is used as an example):
    \bliA
      %
      %    Set default properties here
      %
    \blsA
      %
      %    Set font and color here
      %
      %
      %    Put code for the block content here
      %
    \bleA
9 Table Formatting Object
-------------------------
There are two types of table formatting objects:
    Type A - table outside the TeX box
    Type B - table inside the TeX box
\tbsA             Start table, type A
\tbsB             Start table, type B
    These macros mark start of the table.
\tbeA             End table, type A
\tbeB             End table, type B
    These macros mark end of the table.
10 Table Header and Table Footer Formatting Objects
---------------------------------------------------
There is only one type A for both header and footer objects.
This type corresponds to tables outside the TeX box. 
For tables that are inside the TeX box, headers and footers
are treated by the front-end the same way as table bodies
and no special macro calls are generated.
\thsA             Start table header, type A
\tfsA             Start table footer, type A
    These macros mark start of the table header/footer.
\theA             End table header, type A
\tfeB             End table footer, type A
    These macros mark end of the table header/footer.
11 Table Row Formatting Object
------------------------------
There are two types of table formatting objects:
    Type A - row with the fixed height
    Type B - row with the variable (auto) height
\trsA             Start table row, type A
\trsB             Start table row, type B
    These macros mark start of the table row.
\treA             End table row, type A
\treB             End table row, type B
    These macros mark start of the table row.
12 Table Cell Formatting Object
-------------------------------
In the current implementation, only cells with the fixed width
and the collapsing borders are supported. These cells are assigned
the type A.
The special macros are implemented to mark start and end of
a table cell. These macros require exactly one argument. This argument
must be equal to the radix-52 alphabetic column identifier assigned
by the front-end (see the section "Setting Properties, Table Cell"
for definition of column identifiers).
\tcsA [1]       Start table cell, type A
\tceA [1]       End table cell, type A
The code corresponding to the content of the cell object, as well as
macro calls that set font and color should be placed between cell 
start and end marks. The cell properties should be specified 
immediately before the cell start mark using table cell property 
macros. The cell height should be specified before the cell mark
using the common \rah macro.
The typical calling sequence looks as follows (the first column
of the topmost table is used in this example)
    \rah{20mm}    % Set cell height
    %
    %    Set cell properties here, for instance:
    %
    %    \gpx{A}{2mm}    % Set all padding values to 2mm
    %
    \tcsA{A}
      %
      %    Set font and color here
      %
      %
      %    Put code for the table cell content here
      %
    \tceA{A}
If a property of the given cell has the same value as for the
cell that belongs to the previous row and the same column, there
is no need to set this property again.
13 List Block Formatting Object
-------------------------------
In the current implementation, only list blocks having no
borders and background color are supported. These list blocks
are assigned the type A.
\lbiA           Initialize list block properties, type A
\lbsA           Start list block, type A
\lbeA           End list block, type A
The typical calling sequence looks as follows:
    \lbiA
      %
      %    Set default properties here
      %
    \lbsA
      %
      %    Put code for the list block content here
      %
    \lbeA
14 List Item Formatting Object
------------------------------
In the current implementation, only list items having no
borders and background color are supported. These list items
are assigned the type A.
\liiA           Initialize list item properties, type A
\lisA           Start list item, type A
\lieA           End list item, type A
The typical calling sequence looks as follows:
    \liiA
      %
      %    Set default properties here
      %
    \lisA
      %
      %    Put code for the list item content here
      %
    \lieA
15 List Item Label Formatting Object
------------------------------------
In the current implementation, all list item labels are assigned
the type A.
\lilsA          Start list item label, type A
\lileA          End list item label, type A
These macros mark start and end of the list item label.
16 List Item Body Formatting Object
-----------------------------------
In the current implementation, all list item bodies are assigned
the type A.
\libsA          Start list item body, type A
\libeA          End list item body, type A
These macros mark start and end of the list item body.
17 Leader Formatting Object
---------------------------
\ldr            Leader
    The macro \ldr is used to render a leader.
18 External Graphic Formatting Object
-------------------------------------
\xgri           Initialize the external graphic properties
    This macro sets properties related to the external graphic 
    object to their "default" values.
\xgr  [1]       Include external graphic
    The macro \xgr marks the inclusion point for the external
    graphic object. It requires a single argument, which must be
    equal to the graphic object file path. Since this macro
    is implemented using the standard LaTeX2e graphics bundle,
    the file path syntax and semantic should correspond to
    those supported by LaTeX2e.
The typical calling sequence looks as follows:
    \xgri
      %
      %    Set properties here
      %
    \xgr
19 Page Number Formatting Object
--------------------------------
\pno
    The macro \pno marks the inclusion point for the page number.
20 Initialize Page Sequence
---------------------------
\psqi [1]
    The macro \psqi marks the start of a new page sequence.
    It requires exactly one argument that specifies the initial
    page number. This argument may be either an integer value
    or on of the following single letters:
        a    auto
        e    auto-even
        o    auto-odd
21 Render a Unicode Character
-----------------------------
\chr  [1]
    The macro \chr is used to render a single Unicode character.
    It requires exactly one argument that specifies the decimal
    character code. The character code must be greater than 127.
    This macro is defined in a separate package CHRDEF.STY.
    This package supports rendering of many Unicode characters
    in TeX. The file CHRDEF.STY was generated using the source
    XML document
    http://www.tug.org/applications/jadetex/unicode.xml
    created by Sebastian Rahtz and David Carlisle. 
    The XSL stylesheet used to generate CHRDEF.STY is included
    in the UFO distribution (see UTIL\UNITEX.XSL). This stylesheet
    can be used to generate a new version of CHRDEF.STY each
    time the source XML definition is updated.