Legacy Documentation

Publicon® (2004)

This is documentation for an obsolete product.
Current products and services

Documentation  / Publicon  / User Guide  / Advanced Features  / Customizing LaTeX Output  /

Customizing Output

Conversion Rules

Conversion rules specify how the content of specific cells is processed when exporting a Publicon document. To see the conversion rules for any cell style, unformat the appropriate style definition cell in the style sheet by using one of the following keyboard shortcuts: ShiftKeyKeyBarControlKeyLeftModifiedeRightModified (Windows); ShiftKeyKeyBarCommandKeyLeftModifiedeRightModified (Macintosh); ShiftKeyKeyBarMod1KeyLeftModifiedeRightModified (X).

Here is part of the cell expression for the cell defining the style of Title cells in the default style sheet.

Cell[StyleData["Title"], ...

ConversionRulesRuleDelayed{"TeX" Rule {"\\title{", "}\n"}},

...]

The conversion rule here specifies that when a Title cell is exported as , the content of the cell should be inserted into the output literally, preceded by the string "\title" and followed by the string "}\n".

Each conversion rule has the following syntax:

ConversionRulesRuleDelayed{format Rule {str1, fn, str1}}

The arguments in the above conversion rule have the following meanings:

format specifies the export format (such as "TeX" or "HTML") for which the conversion rule applies.

str1 is a string that is pasted into the output just before the result of processing the current cell.

str2 is a string that is pasted into the output just after the result of processing the current cell.

fn is a function to be applied to the content of the cell. The result of applying the function is pasted into the output. If the function is not specified explicitly, the content of the cell is pasted literally, that is without any special processing.

Let us look at some examples of conversion rules for other types of cell styles. The following examples are all taken from the AMS_Journal style sheet.

Headings

Here is the conversion rule for Section cells. It is similar to the conversion rule for Title cells shown above.

ConversionRulesRuleDelayed{"TeX" Rule {"\\section{", "}\n"}}

The effect of this rule is to wrap the content of the Section cell in a \section{} command.

Figures

Here is the conversion rule for Figure cells. The fn argument of the conversion rule has the explicit value ExtractFigure[]. This is a specially defined conversion function that converts the figure in the cell into an EPS file.

ConversionRulesRuleDelayed{"TeX" Rule {"\\begin{figure}[h]\n\\includegraphics{", ExtractFigure[],"}\n"}}

The effect of this rule is to insert the following markup in the output:

\begin{figure}[h]
\includegraphics{file}

where file is the name of the EPS file produced as a result of applying the ExtractFigure[] function to the graphic present in the Figure cell.

Figure Captions

Here is the conversion rule for FigureCaption cells.

ConversionRulesRuleDelayed{"TeX" Rule {"\\caption{","}\n\\end{figure}"}}

The effect of this rule is to insert the following markup in the output:

\caption{text}
\end{figure}

where text is the content of the FigureCaption cell.

Notes

Here is the conversion rule for Note cells. The rule contains a compound conversion function that extracts the content of the note.

ConversionRulesRuleDelayed{"TeX" Rule {" \\footnote{", ExtractElement[][ExtractButtonData[][#]]&, "}"}}

The effect of this rule is to insert the following markup in the output:

\footnote{text}

where text is the content of the note.

Text

The style definition cell for Text cells does not include any special conversion rules. This is because the content of Text cells is pasted directly into the output without any extra processing. Hence, no conversion rule is required.