diff --git a/modules/tabular.xml b/modules/tabular.xml index e972bcc..2db4cf2 100644 --- a/modules/tabular.xml +++ b/modules/tabular.xml @@ -25,6 +25,12 @@ @scale (LaTeX only): Scaling factor for the tabular. @rotate (LaTeX only): Rotation angle of tabular in degrees anti-clockwise. + + @long-table (LaTeX only): Use the longtable environment instead of tabular so it can span multiple pages. + 'no' [default] + 'yes' + + @caption (LaTeX only): Only valid for long tables (@long-table = 'yes'); ignored otherwise. --> <template name="tabular" match="tabular"> <common formats="/latex/xelatex/"> @@ -60,7 +66,11 @@ <xsl:text>}{</xsl:text> </xsl:if> - <xsl:text>\begin{tabular}</xsl:text> + <xsl:text>\begin{</xsl:text> + <xsl:value-of select=" + if (@long-table = ('yes', 'y', 'true', 't', '1')) then 'longtable' + else 'tabular'" /> + <xsl:text>}</xsl:text> <!-- vertical alignment --> <xsl:if test="@valign = ('top', 'bottom')"> <xsl:text>[</xsl:text> @@ -70,10 +80,19 @@ <xsl:text>{</xsl:text> <xsl:apply-templates select="tabular-columns" /> <xsl:text>}</xsl:text> + <xsl:if test="(@long-table = ('yes', 'y', 'true', 't', '1')) and @caption"> + <xsl:text>\caption{</xsl:text> + <xsl:value-of select="@caption" /> + <xsl:text>} \\</xsl:text> + </xsl:if> <xsl:apply-templates select="tabular-header" /> <xsl:apply-templates select="tabular-body" /> <xsl:apply-templates select="tabular-footer" /> - <xsl:text>\end{tabular}</xsl:text> + <xsl:text>\end{</xsl:text> + <xsl:value-of select=" + if (@long-table = ('yes', 'y', 'true', 't', '1')) then 'longtable' + else 'tabular'" /> + <xsl:text>}</xsl:text> <xsl:if test="@scale"><xsl:text>}</xsl:text></xsl:if> @@ -194,13 +213,13 @@ <!-- A single row of a tabular. - @no-page-break: Inhibit page breaks after this row (LaTeX only). + @page-break: Inhibit page breaks after this row (LaTeX only). --> <template name="row" match="row"> <common formats="/latex/xelatex/"> <xsl:apply-templates /> <xsl:text> \\</xsl:text> - <xsl:if test="@no-page-break = ('yes', 'y', 'true', 't', '1')"><xsl:text>*</xsl:text></xsl:if> + <xsl:if test="@page-break = ('no', 'n', 'false', 'f', '0')"><xsl:text>*</xsl:text></xsl:if> <xsl:text> </xsl:text> </common> <common formats="/html/xhtml/">