- Updated some documentation.
- Updated an error message.
1 parent 7fd5e91 commit 14cfd708cf485eba43209387578b76c66eb9dd4b
nstanger authored on 23 Feb 2012
Showing 2 changed files
View
4
modules/code-formatting.xml
</template>
<!--
Choose a valid delimiter for a LaTeX inline verbatim macro (e.g., \verb or \lstinline). "Valid" means that the delimiter can't occur in the source text. The function thus scans through a list of possible delimiters and looking for those that don't occur in the source text. It actually finds /all/ valid delimiters for the source text because of the effective parallel execution of for-each on sequences, but it only returns the first one found. If no valid delimiter can be found, the function raises an error and terminates the transformation.
Choose a valid delimiter for a LaTeX inline verbatim macro (e.g., \verb or \lstinline). "Valid" means that the delimiter can't occur in the source text. The function thus scans through a list of possible delimiters and looking for those that don't occur in the source text.
$source-text: The source text to be wrapped inside a \verb macro.
Returns: The function actually finds /all/ valid delimiters for the source text because of the effective parallel execution of xsl:for-each on sequences, but it only returns the first one found. If no valid delimiter can be found, the function raises an error and terminates the transformation.
-->
<function name="infosci:choose-delimiter" as="xs:string">
<common formats="/latex/xelatex/">
<xsl:param name="source-text" />
View
4
modules/number-formatting.xml
<!--
General template for formatting numbers.
-->
<template name="number" match="number">
<!-- LaTeX just uses the siunitx package. -->
<!-- LaTeX just uses the \num macro from the siunitx package. -->
<common formats="/latex/xelatex/">
<xsl:text>\num{</xsl:text>
<xsl:apply-templates />
<xsl:text>}</xsl:text>
<xsl:choose>
<xsl:when test="lower-case( $mode ) = 'l'" />
<xsl:when test="lower-case( $mode ) = 'r'" />
<xsl:otherwise>
<xsl:message terminate="yes">The mode parameter of function infosci:separate-thousands must be one of the values 'L', 'l', 'R' or 'r'.</xsl:message>
<xsl:message terminate="yes">ERROR: The mode parameter of function infosci:separate-thousands must be one of the values 'L', 'l', 'R' or 'r'.</xsl:message>
</xsl:otherwise>
</xsl:choose>
<!--
Recursively subdivide the sequence. Terminate when sequence length <= 3. Note that we have to use the numeric entity for thin space rather than the character entity &thinsp; because of the weird way XSLT handles character entities. Using the character entity, the HTML visibly displays as "&thinsp;".