• Added rudimentary support for horizontal skip (\hskip).
1 parent 5d10297 commit 27b7d67a53dea5edb70452b94e1fce9cb81a738a
Nigel Stanger authored on 18 Feb 2018
Showing 1 changed file
View
37
modules/basic-page-elements.xml
<xsl:value-of select="@size" />
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Invalid skip expression for LaTeX: "</xsl:text>
<xsl:text>Invalid vertical skip expression for LaTeX: "</xsl:text>
<xsl:value-of select="@size" />
<xsl:text>" (valid values are "small", "medium", "large", "fill", or a LaTeX length, e.g., "24pt")</xsl:text>
</xsl:message>
</xsl:otherwise>
</common>
</template>
<!--
Skip a certain amount of space horizontally. Probably more relevant to LaTeX than HTML. Is it even possible to hskip a set amount in HTML?? I suppose you could create an empty <span> element with a specified width.
@size: the amount of space to skip.
missing => ERROR [default]
'fill' => \hfill
LaTeX length => \hskipxx
-->
<template name="horizontal-skip" match="horizontal-skip|hskip">
<common formats="/latex/xelatex/">
<xsl:choose>
<xsl:when test="@size='fill'">
<xsl:text>\hfill</xsl:text>
</xsl:when>
<!-- Check for valid LaTeX length format, e.g., "2.54cm". -->
<xsl:when test="matches( @size, '^\d*\.?\d+(cm|em|ex|in|pc|pt|mm|bp)$' )">
<xsl:text>\hskip</xsl:text>
<xsl:value-of select="@size" />
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:text>Invalid horizontal skip expression for LaTeX: "</xsl:text>
<xsl:value-of select="@size" />
<xsl:text>" (must either be "fill" or a LaTeX length, e.g., "24pt")</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="newline-internal" />
</common>
<common formats="/html/xhtml/">
<!-- For the moment we'll just ignore this for (X)HTML :). -->
</common>
</template>
<!--
Generate a horizontal rule the width of the column.
-->
<template name="horizontal-rule" match="horizontal-rule|hrule|hr">