|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
xmlns:exsl="http://exslt.org/common"
|
|
Packit Service |
76cb02 |
exclude-result-prefixes="exsl" version='1.0'>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit Service |
76cb02 |
############################################################################ -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:param name="seg.item.separator">, </xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="variablelist.term.separator">, </xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="term.breakline">0</xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="segmentedlist.as.table" select="0"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
orderedlist/title | itemizedlist/title | simplelist/title">
|
|
Packit Service |
76cb02 |
<xsl:text>
{\sc </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="label.id">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="object" select=".."/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\nopagebreak
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
order to prevent from compilation crash. If the depth is correct
|
|
Packit Service |
76cb02 |
the templates that actually do the work are called.
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
<xsl:template match="itemizedlist|orderedlist|variablelist">
|
|
Packit Service |
76cb02 |
<xsl:variable name="ditem" select="count(ancestor-or-self::itemizedlist)"/>
|
|
Packit Service |
76cb02 |
<xsl:variable name="dorder" select="count(ancestor-or-self::orderedlist)"/>
|
|
Packit Service |
76cb02 |
<xsl:variable name="dvar" select="count(ancestor-or-self::variablelist)"/>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$ditem > 4">
|
|
Packit Service |
76cb02 |
<xsl:message>*** Error: itemizedlist too deeply nested (> 4)</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:text>[Error: itemizedlist too deeply nested]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$dorder > 4">
|
|
Packit Service |
76cb02 |
<xsl:message>*** Error: orderedlist too deeply nested (> 4)</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:text>[Error: orderedlist too deeply nested]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="($ditem+$dorder+$dvar) > 6">
|
|
Packit Service |
76cb02 |
<xsl:message>*** Error: lists too deeply nested (> 6)</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:text>[Error: lists too deeply nested]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="print"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="itemizedlist" mode="print">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="title"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
self::titleabbrev or
|
|
Packit Service |
76cb02 |
self::listitem)]"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{itemize}</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="opt.group">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="opts" select="@spacing"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="mode" select="'enumitem'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="listitem"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\end{itemize}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="orderedlist" mode="print">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="title"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
self::titleabbrev or
|
|
Packit Service |
76cb02 |
self::listitem)]"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{enumerate}</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="opt.group">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="opts" select="@numeration|@continuation|@spacing"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="mode" select="'enumitem'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="listitem"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\end{enumerate}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="variablelist" mode="print">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="title"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
self::titleabbrev or
|
|
Packit Service |
76cb02 |
self::varlistentry)]"/>
|
|
Packit Service |
76cb02 |
<xsl:text>
\noindent
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{description}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="varlistentry"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\end{description}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="listitem">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>
\item{}</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="label.id"/>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="varlistentry">
|
|
Packit Service |
76cb02 |
<xsl:text>\item[{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="term"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}] </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="label.id">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="object" select="."/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="label.id">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="object" select="term"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="term" mode="foottext"/>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="listitem"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="varlistentry/term">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:if test="position()!=last()">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$variablelist.term.separator"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="varlistentry/listitem">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
self::orderedlist or
|
|
Packit Service |
76cb02 |
self::variablelist][not(child::title)]">
|
|
Packit Service |
76cb02 |
<xsl:text>~</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="child::*[1][self::programlisting][not(child::title)]">
|
|
Packit Service |
76cb02 |
<xsl:text>~</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="child::*[not(self::indexterm)][1][self::figure]">
|
|
Packit Service |
76cb02 |
<xsl:text>~ </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
with immediate following brackets [...]-->
|
|
Packit Service |
76cb02 |
<xsl:when test="$term.breakline='1'">
|
|
Packit Service |
76cb02 |
<xsl:text>\hspace{0em}\\~
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
# List Options #
|
|
Packit Service |
76cb02 |
################ -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="opt.group">
|
|
Packit Service |
76cb02 |
<xsl:param name="opts"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="mode" select="'opt'"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="left" select="'['"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="right" select="']'"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="result">
|
|
Packit Service |
76cb02 |
<xsl:for-each select="$opts">
|
|
Packit Service |
76cb02 |
<xsl:variable name="str">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="enumitem"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="$str!='' and position()!=1">
|
|
Packit Service |
76cb02 |
<xsl:text>,</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$str"/>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="$result != ''">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$left"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="starts-with($result, ',')">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="substring-after($result, ',')"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$result"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$right"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="@numeration" mode="enumitem">
|
|
Packit Service |
76cb02 |
<xsl:text>label=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test=".='arabic'">\arabic*.</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test=".='upperalpha'">\Alph*.</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test=".='loweralpha'">\alph*.</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test=".='upperroman'">\Roman*.</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test=".='lowerroman'">\roman*.</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>\arabic*.</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="@continuation" mode="enumitem">
|
|
Packit Service |
76cb02 |
<xsl:if test=". = 'continues'">
|
|
Packit Service |
76cb02 |
<xsl:text>resume</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="@spacing" mode="enumitem">
|
|
Packit Service |
76cb02 |
<xsl:if test=". = 'compact'">
|
|
Packit Service |
76cb02 |
<xsl:text>itemsep=0pt</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
# Simplelist #
|
|
Packit Service |
76cb02 |
############## -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="tabular.string">
|
|
Packit Service |
76cb02 |
<xsl:param name="cols" select="1"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="i" select="1"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$i <= $cols">
|
|
Packit Service |
76cb02 |
<xsl:text>l</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="tabular.string">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="i" select="$i+1"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="cols" select="$cols"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="member">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="simplelist[@type='inline']">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="simplelist[@type='inline']/member">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:if test="position()!=last()">
|
|
Packit Service |
76cb02 |
<xsl:text>, </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="simplelist[@type='horiz']">
|
|
Packit Service |
76cb02 |
<xsl:variable name="cols">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@columns">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="@columns"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>1</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:text>
\begin{tabular*}{\linewidth}{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="tabular.string">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="cols" select="$cols"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:for-each select="member">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="."/>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="position()=last()">
|
|
Packit Service |
76cb02 |
<xsl:text> \\
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="position() mod $cols">
|
|
Packit Service |
76cb02 |
<xsl:text> & </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text> \\
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
<xsl:text>
\end{tabular*}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="simplelist|simplelist[@type='vert']">
|
|
Packit Service |
76cb02 |
<xsl:variable name="cols">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@columns">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="@columns"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>1</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:text>
\begin{tabular*}{\linewidth}{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="tabular.string">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="cols" select="$cols"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="simplelist.vert.row">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="rows" select="floor((count(member)+$cols - 1) div $cols)"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>
\end{tabular*}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="simplelist.vert.row">
|
|
Packit Service |
76cb02 |
<xsl:param name="cell">0</xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="rows"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$cell < $rows">
|
|
Packit Service |
76cb02 |
<xsl:for-each select="member[((position()-1) mod $rows) = $cell]">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="."/>
|
|
Packit Service |
76cb02 |
<xsl:if test="position()!=last()">
|
|
Packit Service |
76cb02 |
<xsl:text> & </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
<xsl:text> \\
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="simplelist.vert.row">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="cell" select="$cell+1"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="rows" select="$rows"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segmentedlist">
|
|
Packit Service |
76cb02 |
<xsl:variable name="presentation">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="pi.dblatex_list-presentation"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$presentation = 'table'">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="seglist-table"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$presentation = 'list'">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="seglist-inline"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$segmentedlist.as.table != 0">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="seglist-table"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="seglist-inline"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segmentedlist" mode="seglist-inline">
|
|
Packit Service |
76cb02 |
<xsl:text>\noindent </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segmentedlist/title">
|
|
Packit Service |
76cb02 |
<xsl:text>{\bf </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>}\\
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segtitle">
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segtitle" mode="segtitle-in-seg">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="seglistitem">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:if test="following-sibling::seglistitem">
|
|
Packit Service |
76cb02 |
<xsl:text> \\</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="seg">
|
|
Packit Service |
76cb02 |
<xsl:variable name="segnum" select="count(preceding-sibling::seg)+1"/>
|
|
Packit Service |
76cb02 |
<xsl:variable name="seglist" select="ancestor::segmentedlist"/>
|
|
Packit Service |
76cb02 |
<xsl:variable name="segtitles" select="$seglist/segtitle"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
Note: segtitle is only going to be the right thing in a well formed
|
|
Packit Service |
76cb02 |
SegmentedList. If there are too many Segs or too few SegTitles,
|
|
Packit Service |
76cb02 |
you'll get something odd...maybe an error
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\emph{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
mode="segtitle-in-seg"/>
|
|
Packit Service |
76cb02 |
<xsl:text>:} </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:if test="following-sibling::seg">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$seg.item.separator"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
To make a LaTeX table we want to know:
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
A) How much overall columnar space there is so we can equally
|
|
Packit Service |
76cb02 |
apportion any leftover space using the proportional space
|
|
Packit Service |
76cb02 |
allocator, '*'.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
B) Whether to autosize columns, letting LaTeX base the width on
|
|
Packit Service |
76cb02 |
content, and B.1) which ones to autosize.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
Unfortunately these 2 types of information may be transmitted to
|
|
Packit Service |
76cb02 |
us via one value, either the default.table.width param or the
|
|
Packit Service |
76cb02 |
dblatex table-width PI. We operate on the principal that the
|
|
Packit Service |
76cb02 |
dblatex table-width PI completely overrides the
|
|
Packit Service |
76cb02 |
default.table.width param, so we've really only one value to
|
|
Packit Service |
76cb02 |
work with at any one time. Since we get a single value we
|
|
Packit Service |
76cb02 |
receive only one of A or B and must assume the other.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
We may or may not receive additional information regards A or B
|
|
Packit Service |
76cb02 |
via the newtbl.autowidth param or the dblatex newtbl-autowidth
|
|
Packit Service |
76cb02 |
PI or the dblatex colwidth PI.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
This is resolved as follows:
|
|
Packit Service |
76cb02 |
o When B is specified, assume page width for A.
|
|
Packit Service |
76cb02 |
o When A is specified, assume every column is equally apportioned.
|
|
Packit Service |
76cb02 |
o When nothing is specified, assume page width for A and
|
|
Packit Service |
76cb02 |
autosizing of every column.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
Note that page width is not a universally good default for
|
|
Packit Service |
76cb02 |
table width. Proportionally spaced columns will "appropriately"
|
|
Packit Service |
76cb02 |
fill the page, but adding any fixed width columns or
|
|
Packit Service |
76cb02 |
autowidth columns will result in a table that's wider than
|
|
Packit Service |
76cb02 |
a page.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
To gain complete control the user must specify A, the overall
|
|
Packit Service |
76cb02 |
table width, using param or PI above. Then specify the width of
|
|
Packit Service |
76cb02 |
each column, whether fixed, proportional, proportional + fixed,
|
|
Packit Service |
76cb02 |
or autosized, via other methods.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
This works because the PIs and params that otherwise control
|
|
Packit Service |
76cb02 |
table layout have precedence over the table width controls. The
|
|
Packit Service |
76cb02 |
dblatex colwidth PI only occurs within a lexically "inner"
|
|
Packit Service |
76cb02 |
portion of the document so it always has priority.
|
|
Packit Service |
76cb02 |
newtbl.autowidth (and the newtbl-autowidth PI) is defined to
|
|
Packit Service |
76cb02 |
have priority over table.width (and it's PI).
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="segtable.table-width">
|
|
Packit Service |
76cb02 |
<xsl:variable name="table-width">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="pi.dblatex_table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$table-width = ''">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$default.table.width"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="segtable.autocols">
|
|
Packit Service |
76cb02 |
<xsl:param name="autowidth-pi"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="table-width"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($autowidth-pi, 'column:')">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$autowidth-pi"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
and contains($table-width, 'column:')">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="segtable.autowidth">
|
|
Packit Service |
76cb02 |
<xsl:param name="autowidth.pi"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="table-width"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="autowidth">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$autowidth.pi = ''">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$newtbl.autowidth"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$autowidth.pi"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$autowidth = ''">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$table-width = ''">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>1</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($table-width, 'auto')">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
or contains($table-width, 'column:')">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>none</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>1</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>0</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($autowidth, 'column:')">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>0</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$autowidth = 'none'">
|
|
Packit Service |
76cb02 |
<xsl:text>0</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>1</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="proportional.column">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
colwidth="\newtblstarfactor"
|
|
Packit Service |
76cb02 |
star="1"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="autowidth.column">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
autowidth="1"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="user.specified.column">
|
|
Packit Service |
76cb02 |
<xsl:param name="colwidth.pi"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="fixed">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="colfixed.get">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="width" select="$colwidth.pi"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<colspec>
|
|
Packit Service |
76cb02 |
<xsl:if test="$fixed != ''">
|
|
Packit Service |
76cb02 |
<xsl:attribute name="fixedwidth">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$fixed"/>
|
|
Packit Service |
76cb02 |
</xsl:attribute>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($colwidth.pi, '*')">
|
|
Packit Service |
76cb02 |
<xsl:attribute name="colwidth">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="replace-string">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="text" select="$colwidth.pi"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="replace">*</xsl:with-param>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="with">\newtblstarfactor</xsl:with-param>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:attribute>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:attribute name="star">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="colstar.get">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
name="width"
|
|
Packit Service |
76cb02 |
select="substring-before($colwidth.pi, '*')"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:attribute>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:attribute name="colwidth">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$colwidth.pi"/>
|
|
Packit Service |
76cb02 |
</xsl:attribute>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</colspec>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
- tbl.sizes wants colspecs so build a set of fake colspec elements.
|
|
Packit Service |
76cb02 |
-
|
|
Packit Service |
76cb02 |
- tbl.sizes takes a collection of colspec elements, each having
|
|
Packit Service |
76cb02 |
- the following (optional) attributes:
|
|
Packit Service |
76cb02 |
-
|
|
Packit Service |
76cb02 |
- fixedwidth
|
|
Packit Service |
76cb02 |
- String. The fixed part (from colfixed.get) of a specified
|
|
Packit Service |
76cb02 |
- column width.
|
|
Packit Service |
76cb02 |
-
|
|
Packit Service |
76cb02 |
- star
|
|
Packit Service |
76cb02 |
- String (that we know can be converted to a number).
|
|
Packit Service |
76cb02 |
- The "prefix count" of the * (from colstar.get).
|
|
Packit Service |
76cb02 |
-
|
|
Packit Service |
76cb02 |
- colwidth
|
|
Packit Service |
76cb02 |
- String. The user-specified column width with * replaced with
|
|
Packit Service |
76cb02 |
- "\newtblstarfactor".
|
|
Packit Service |
76cb02 |
-
|
|
Packit Service |
76cb02 |
- The code in this file uses the (optional) attributes:
|
|
Packit Service |
76cb02 |
- colwidth
|
|
Packit Service |
76cb02 |
- autowidth
|
|
Packit Service |
76cb02 |
- String (always "1"). When present (regardless of value!)
|
|
Packit Service |
76cb02 |
- autowidth means the column is latex spaced.
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="segtable.colspecs">
|
|
Packit Service |
76cb02 |
<xsl:param name="table-width"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="autowidth.pi">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="pi.dblatex_autowidth"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="autowidth">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segtable.autowidth">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="autowidth.pi" select="$autowidth.pi"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="table-width" select="$table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="autocols">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segtable.autocols">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="autowidth.pi" select="$autowidth.pi"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="table-width" select="$table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:for-each select="segtitle">
|
|
Packit Service |
76cb02 |
<xsl:variable name="colwidth.pi">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="pi.dblatex_colwidth"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$colwidth.pi = ''">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
concat(' ', position(), ' '))
|
|
Packit Service |
76cb02 |
or $autowidth = '1'">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="autowidth.column"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="proportional.column"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
or $colwidth.pi = 'autowidth.all'">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="autowidth.column"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="$colwidth.pi = 'autowidth.none'">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="proportional.column"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="user.specified.column">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colwidth.pi" select="$colwidth.pi"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="segtable.length.setup">
|
|
Packit Service |
76cb02 |
<xsl:param name="table-width"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="colspecs"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="width">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="fullwidth">\linewidth-2\tabcolsep</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
or contains($table-width, 'auto')">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$fullwidth"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($table-width, '%')">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
div 100"/>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$fullwidth"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="tbl.sizes">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspec" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="width" select="$width"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segmentedlist" mode="seglist-table">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="table-width">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segtable.table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="colspecs-text">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segtable.colspecs">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="table-width" select="$table-width"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="colspecs" select="exsl:node-set($colspecs-text)"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>
{\raggedright\savetablecounter</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\begingroup%
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segtable.length.setup">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="table-width" select="$table-width"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\setlength{\LTpre}{\parskip}</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\setlength{\LTpost}{\parskip-\fontcharht\font`i}%
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{longtable}[l]{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:for-each select="$colspecs/colspec">
|
|
Packit Service |
76cb02 |
<xsl:text>l</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="title|info/title|titleabbrev|info/titleabbrev">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates mode="seg-table" select="segtitle">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates mode="seg-table" select="seglistitem">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\end{longtable}\endgroup%
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\restoretablecounter%
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="title|titleabbrev" mode="seglist-title">
|
|
Packit Service |
76cb02 |
<xsl:text>{\bf </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
| segmentedlist/info/title
|
|
Packit Service |
76cb02 |
| segmentedlist/titleabbrev[not(../title)]
|
|
Packit Service |
76cb02 |
| segmentedlist/info/titleabbrev[not(../title)]"
|
|
Packit Service |
76cb02 |
mode="seg-table">
|
|
Packit Service |
76cb02 |
<xsl:param name="colspecs"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\multicolumn{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="count($colspecs/colspec)"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$colspecs/colspec/@autowidth">
|
|
Packit Service |
76cb02 |
<xsl:text>l</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>p{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:for-each select="$colspecs/colspec">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="@colwidth"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="following-sibling::colspec">
|
|
Packit Service |
76cb02 |
<xsl:text>+\tabcolsep+</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>}{\raggedright%
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="seglist-title"/>
|
|
Packit Service |
76cb02 |
<xsl:text>%
}\tabularnewline
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="segmentedlist.col">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:param name="colspecs"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="format"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="heading" select="0"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="position">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="position()"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="$colspecs/colspec[position()=$position]"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="colwidth">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$colspec/@colwidth"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
- but we want to know about the _existance_ of the attribute,
|
|
Packit Service |
76cb02 |
- not it's content, and testing for "" is ugly.
|
|
Packit Service |
76cb02 |
- So "select=..." in variable. -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="$colspec/@autowidth"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\multicolumn{1}{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$autowidth">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$format = 'p'">
|
|
Packit Service |
76cb02 |
<xsl:text>l</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>c</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>}{%
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$format"/>
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$colwidth"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}}{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$format = 'p'">
|
|
Packit Service |
76cb02 |
<xsl:text>\raggedright</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>\centering</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>%
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$heading">
|
|
Packit Service |
76cb02 |
<xsl:text>\emph{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
mode="segtitle-in-seg"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>%
}</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="position() != last()">
|
|
Packit Service |
76cb02 |
<xsl:text>&</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
test="self::segtitle
|
|
Packit Service |
76cb02 |
or parent::seglistitem[following-sibling::seglistitem]">
|
|
Packit Service |
76cb02 |
<xsl:text>\tabularnewline</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>%</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="segtitle" mode="seg-table">
|
|
Packit Service |
76cb02 |
<xsl:param name="colspecs"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segmentedlist.col">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="format">m</xsl:with-param>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="heading" select="1"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:if test="not(following-sibling::segtitle)">
|
|
Packit Service |
76cb02 |
<xsl:text>\endhead
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="seglistitem" mode="seg-table">
|
|
Packit Service |
76cb02 |
<xsl:param name="colspecs"/>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates mode="seg-table">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="seg" mode="seg-table">
|
|
Packit Service |
76cb02 |
<xsl:param name="colspecs"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="segmentedlist.col">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="colspecs" select="$colspecs"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="format">p</xsl:with-param>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
</xsl:stylesheet>
|
|
Packit Service |
76cb02 |
|