- Curse you, LaTeX tabulars and your special cases!! Ensured that a \\ is
included when the final row is followed by a row-rule.
1 parent 00f046c commit 54d3a6be6a105731a65963fcc15b5b43d7f5b03b
nstanger authored on 20 Jun 2012
Showing 1 changed file
View
16
modules/tabular.xml
</common>
</template>
<!--
The last row of a tabular in (Xe)LaTeX shouldn't have a \\ at the end (it still works, but I think you end up with too much white space after the tabular).
Case 1: There's no tabular-footer, so apply this to the last row of the tabular-body.
Case 2: Last row of the tabular-footer, if it exists.
-->
<template name="last-row-body" match="tabular-body/row[( position() = last() ) and not( ../following-sibling::tabular-footer )]|tabular-footer/row[position() = last()]">
This template handles the following cases:
The last row of a tabular in (Xe)LaTeX shouldn't have a \\ at the end, /unless/ you want a horizontal rule (\hline) under the last row (Lamport, p. 62). This template handles the following cases:
 
Case 1: The last row of a tabular-body, without a row-rule following it, and no tabular-footer.
Case 2: The last row of a tabular-footer, without a row-rule following it.
-->
<template name="last-row-body" match="tabular-body/row[( position() = last() ) and not( following-sibling::row-rule ) and not( ancestor::tabular/tabular-footer )]|tabular-footer/row[position() = last() and not( following-sibling::row-rule )]">
<common formats="/latex/xelatex/">
<xsl:apply-templates />
<xsl:text> </xsl:text>
</common>