• Added paper-include-path and latex-initialisation-file stylesheet parameters.
• Added automatic initialisation of paper variables.
1 parent 6d42992 commit 10163293a7b0cd5d39bffc1f366118c1f4f430e8
Nigel Stanger authored on 15 Feb 2016
Showing 1 changed file
View
12
xml2xslt.xsl
<xsl-out:param name="period-code" />
<xsl-out:param name="showanswers"><xsl:text>no</xsl:text></xsl-out:param>
<!-- This is normally the path to the current document directory. -->
<xsl-out:param name="base-path"><xsl:text>.</xsl:text></xsl-out:param>
<!-- This is normally the path to the root directory of the paper tree in the filesystem. -->
<xsl-out:param name="paper-include-path"><xsl:text>.</xsl:text></xsl-out:param>
<!-- This is normally the file paper_init.tex in the root of the paper tree. -->
<xsl-out:param name="latex-initialisation-file"><xsl:text>paper_init</xsl:text></xsl-out:param>
<!-- Full period string corresponding to the supplied period code. -->
<xsl-out:variable name="period-string" select="infosci:expand-period-code( $period-code )" />
<xsl-out:text>
\PassOptionsToClass{\LaTeXOptions}{\DocumentClass}
\documentclass{\DocumentClass}
 
% Set up paper variables, if applicable.
\makeatletter
\@ifpackageloaded{lecturecommon}{\input{</xsl-out:text><xsl-out:value-of select="$paper-include-path" /><xsl-out:text>/</xsl-out:text><xsl-out:value-of select="$latex-initialisation-file" /><xsl-out:text>}}
\makeatother
 
% Avoid option clash if document class already loaded it.
\makeatletter
\@ifpackageloaded{geometry}{}{\usepackage[margin=1in]{geometry}}
\makeatother