# Jade TeX Backend

#### with table extensions

## Current version is 1.0b5
(based on Jade 1.1)

#### Released: June 15th, 1998

Recent Changes Source Code Precompiled Binaries Compiling Table Processing Specification

### Recent Changes

Multi-column cell processing: added new macro (/multicolumn{}{}{}) and \def\MultiPar{} definition.

### Source Code

Tested with the version 1.1 of James Clark's Jade.

Source Code Changes
File | Subdirectory | Status
--- | --- | ---
jade.mak | . | changed
Makefile.sub | jade | changed
TeXFOTBuilder.cxx | jade | changed
TeXFOTBuilder_ins.m4 | jade | new
TeXFOTBuilder_ins.cxx | jade | new (auto)
TmpOutputByteStream.h | jade | new

Zipped James Clark's distribution of Jade 1.1: [download (1077 KB)]
Zipped source code of new TeX backend (contains subdirectories: use pkunzip -d under DOS): [download (33 KB)]

### Compiling

##### Compiling under UNIX

1. Unzip on top of the original Jade 1.1 distribution - use the unzip's option -a.
2. "make -f Makefile.jade depend"
3. "make -f Makefile.jade"

##### Compiling under Windows95/NT (using Visual C++ 4.2)

1. Unzip on top of the original Jade 1.1 distribution - use the pkunzip's option -d.
2. Open SP.mak and build the "lib - Win32 Release" configuration
3. Open jade.mak and build the "jade - Win32 Release" configuration

### Precompiled Binaries

Zipped Win95/NT binary: jade.exe [download (107 KB)]
Zipped James Clark's distribution of Jade 1.1 (windows binaries and DLLs that the jade.exe will need - you may have it already installed) [download (1159 KB)]

### Table Processing Specification

##### Structure

On output the components of `Table` flow objects are reaarranged in the following manner:

Contents of the `header` port of the `table-part` flow object are moved just before the contents of the principal port of the `table-part` flow object. The surrounding `\TablePartHeader` and `\endTablePartHeader` TeX macro calls are preserved.

Contents of the `footer` port of the `table-part` flow object are moved just after the contents of the principal port of the `table-part` flow object. The surrounding `\TablePartFooter` and `\endTablePartFooter` TeX macro calls are preserved.

Contents of the `footer` port of the `table-part` flow object are moved just after the contents of the principal port of the `table-part` flow object. The surrounding `\TablePartFooter` and `\endTablePartFooter` TeX macro calls are preserved.

The `table-cell` flow objects are rearranged in the sequential order according to the `column-number` characteristic. Cells overlapped by cells that span multiple rows and/or columns are not reported. Missing cells are reported.

Contents of every `table-part` flow object, and contents of every `table` flow object with no nested `table-part` flow objects, are surrounded by the `/TeXTable{}{}{}` and `/endTeXTable` TeX macro calls (see below).

The `Node` information surrounding moved elements (rows, and cells), moves with them.

The `table-border` and `table-column` flow objects are not reported.

##### Border Resolution

Border resolution takes in account conflicts between adjacent cell borders and adjacent table and cell borders. Such conflicts are resolved using the `border-priority` characteristic. The border resolution occurs after table headers and footers has been moved into their correct place - for the border resolution purposes they are considered part of the table body. The resolution of before/after table borders (borders that surround table as a whole) takes in account existence of table parts.

##### Table/Column Width Computation

The backend has internal inherited characteristics stack that keeps track of the display width changes. Columns, margins, intercolumn spacing, etc. are taken into account. At the point when TeX table is being generated its width will be reported in points. In the case the `table-width` characteristic is equal to `#f` (minimal table width), the full available display width will be reported (TeX macros can decide what to do in such situation by examining the actual characteristic value.)

Width of columns with the `width` characteristic set are reported in points after appropriate processing of `table-unit` values. In a situation where columns with proportional width are mixed with columns with no width, the width of the columns with no width will be assumed equal to one table-unit.

##### TeX Tables

In order to facilitate creation of the TeX table, backend will generate TeX macro calls of the form:

`\TexTable{[width]}{[number_of_columns]}{[column_template]}`

where:

`[width]` | is table width in points.
`[number_of_columns]` | is the number of columns in the table.
`[column_template]` | is the template representing table column information

The `[column_template]` provides column information using the following strings:

`l` | default display alignment is start or inside, width of the column determined by content
`c` | default display alignment is center, width of the column determined by content
`r` | default display alignment is end or outside, width of the column determined by content
`L{[width]}` | default display alignment is start or inside, width of the column given in points
`C{[width]}` | default display alignment is center, width of the column given in points
`R{[width]}` | default display alignment is end or outside, width of the column given in points
The above strings can be interwoven by "pipe" characters (|) representing presence/absence of default vertical borders.

If the effective display alignment of an individual cell differs form the default provided by template, a:

`\def\TeXTableCellDisplayAlignment{[align_char]}}`

definition is appended to the cell's characteristics list. `[align_char]` may be one of `l```, `c`, and r with the meanings as in the table above.

If the effective left\right borders of an individual cell differs form the default provided by template, a:

`\def\TeXTableCellBeforeColumnBorder{[border_present]}`
and/or
`\def\TeXTableCellAfterColumnBorder{[border_present]}`

definitions are appended to the cell's characteristics list. `[border_char]` may be 1 for border present, and 0 for no border.

The horizontal borders of a table are represented by the following calls occuring in-between each row and at the beginning/end of a TeX table:

`\Hline` | border spanning all columns
`\Cline{n-m}` | border spanning columns `n` to `m`
In the above column numbering starts at 1.

Here's an example of TeX table macro call:

`\Hline \TeXTable{174\p@}{3}{|C{50\p@}|l|C{50\p@}|} ... \endTeXTable \Hline`