| |
---|
| | |
---|
| | <!-- |
---|
| | A miscellaneous piece of text to be inserted somewhere in the calendar table. Notes are assumed to occupy a single row only. This is particularly true for LaTeX where we're working within a tabular environment, which means there's no automatic wrapping of long lines anyway. |
---|
| | |
---|
| | @columns: The number of columns that the heading or footing spans. |
---|
| | @columns: The number of columns that the note spans. Defaults to the overall number of columns passed in. |
---|
| | --> |
---|
| | <template match="note"> |
---|
| | <common> |
---|
| | <xsl:param name="num-columns" /> |
---|
| |
---|
| | </template> |
---|
| | |
---|
| | |
---|
| | <!-- |
---|
| | Output a calendar entry for a lecture. Note that lectures are always assumed to span a single row. Lectures are automatically numbered unless otherwise specified. Note that the lecture occupies two cells in the generated table regardless of whether it's numbered. |
---|
| | Output a calendar entry for a lecture. Lectures are assumed to span a single row unless otherwise specified. Lectures are automatically numbered unless otherwise specified. Note that the lecture occupies two cells in the generated table regardless of whether it's numbered. |
---|
| | |
---|
| | @rows: The number of rows the lecture spans [default 1]. |
---|
| | |
---|
| | @number: Whether or not to generate a number for this lecture. The value of this attribute will override any value of parent::calendar/@number-lectures (so you can have all lectures numbered apart from certain ones, or vice versa). If unspecified, it defaults to the value of parent::calendar/@number-lectures, or failing that, "yes". |
---|
| | "yes" [default if parent::calendar/@number-lectures not specified] |
---|
| | "no" |
---|
| |
---|
| | </common> |
---|
| | <common formats="/latex/xelatex/"> |
---|
| | <xsl:if test="$numbered = 'yes'"> |
---|
| | <xsl:call-template name="generate-number-cell"> |
---|
| | <xsl:with-param name="rows">1</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="number" select="1 + count( preceding::lecture[node() and not( @holiday )] )" /> |
---|
| | </xsl:call-template> |
---|
| | |
---|
| | <xsl:call-template name="tabular-column-separator" /> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="columns" select="if ( $numbered = 'yes' ) then 1 else 2" /> |
---|
| | <xsl:with-param name="rows">1</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="align">left</xsl:with-param> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | <common formats="/html/xhtml/"> |
---|
| | <xsl:if test="$numbered = 'yes'"> |
---|
| | <xsl:call-template name="generate-number-cell"> |
---|
| | <xsl:with-param name="rows">1</xsl:with-param> |
---|
| | <xsl:with-param name="colour">ltgrey</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="number" select="1 + count( preceding::lecture[node() and not( @holiday )] )" /> |
---|
| | </xsl:call-template> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="colour">ltgrey</xsl:with-param> |
---|
| | <xsl:with-param name="columns" select="if ( $numbered = 'yes' ) then 1 else 2" /> |
---|
| | <xsl:with-param name="rows">1</xsl:with-param> |
---|
| | <xsl:with-param name="colour">ltgrey</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="align">left</xsl:with-param> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | </template> |
---|
| |
---|
| | <template match="lecture[@holiday]"> |
---|
| | <common formats="/latex/xelatex/"> |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="columns">2</xsl:with-param> |
---|
| | <xsl:with-param name="rows">1</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="style">\sffamily\bfseries</xsl:with-param> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | <common formats="/html/xhtml/"> |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="colour">blue-ou</xsl:with-param> |
---|
| | <xsl:with-param name="columns">2</xsl:with-param> |
---|
| | <xsl:with-param name="rows">1</xsl:with-param> |
---|
| | <xsl:with-param name="colour">blue-ou</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="style">font-style: italic; font-weight: bold;</xsl:with-param> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | </template> |
---|
| |
---|
| | |
---|
| | |
---|
| | <!-- |
---|
| | Output a calendar entry for a laboratory. Laboratories are automatically numbered unless otherwise specified. Note that the laboratory occupies two cells in the generated table regardless of whether it's numbered. |
---|
| | |
---|
| | @rows: The number of rows the laboratory spans [default 1]. |
---|
| | |
---|
| | @number: Whether or not to generate a number for this laboratory. The value of this attribute will override any value of parent::calendar/@number-laboratories (so you can have all laboratories numbered apart from certain ones, or vice versa). If unspecified, it defaults to the value of parent::calendar/@number-laboratories, or failing that, "yes". |
---|
| | "yes" [default if parent::calendar/@number-laboratories not specified] |
---|
| | "no" |
---|
| |
---|
| | </common> |
---|
| | <common formats="/latex/xelatex/"> |
---|
| | <xsl:if test="$numbered = 'yes'"> |
---|
| | <xsl:call-template name="generate-number-cell"> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="number" select="1 + count( preceding::laboratory[node()] )" /> |
---|
| | </xsl:call-template> |
---|
| | |
---|
| | <xsl:call-template name="tabular-column-separator" /> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="columns" select="if ( $numbered = 'yes' ) then 1 else 2" /> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | <common formats="/html/xhtml/"> |
---|
| | <xsl:if test="$numbered = 'yes'"> |
---|
| | <xsl:call-template name="generate-number-cell"> |
---|
| | <xsl:with-param name="colour">ltblue</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="number" select="1 + count( preceding::laboratory[node()] )" /> |
---|
| | </xsl:call-template> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="colour">ltblue</xsl:with-param> |
---|
| | <xsl:with-param name="columns" select="if ( $numbered = 'yes' ) then 1 else 2" /> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | </template> |
---|
| | |
---|
| | |
---|
| | <!-- |
---|
| | Output a calendar entry for a tutorial. Tutorials are automatically numbered unless otherwise specified. Note that the tutorial occupies two cells in the generated table regardless of whether it's numbered. |
---|
| | |
---|
| | @rows: The number of rows the tutorial spans [default 1]. |
---|
| | |
---|
| | @number: Whether or not to generate a number for this tutorial. The value of this attribute will override any value of parent::calendar/@number-tutorials (so you can have all tutorials numbered apart from certain ones, or vice versa). If unspecified, it defaults to the value of parent::calendar/@number-tutorials, or failing that, "yes". |
---|
| | "yes" [default if parent::calendar/@number-tutorials not specified] |
---|
| | "no" |
---|
| |
---|
| | </common> |
---|
| | <common formats="/latex/xelatex/"> |
---|
| | <xsl:if test="$numbered = 'yes'"> |
---|
| | <xsl:call-template name="generate-number-cell"> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="number" select="1 + count( preceding::tutorial[node()] )" /> |
---|
| | </xsl:call-template> |
---|
| | |
---|
| | <xsl:call-template name="tabular-column-separator" /> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="columns" select="if ( $numbered = 'yes' ) then 1 else 2" /> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | <common formats="/html/xhtml/"> |
---|
| | <xsl:if test="$numbered = 'yes'"> |
---|
| | <xsl:call-template name="generate-number-cell"> |
---|
| | <xsl:with-param name="colour">medgreen</xsl:with-param> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | <xsl:with-param name="number" select="1 + count( preceding::tutorial[node()] )" /> |
---|
| | </xsl:call-template> |
---|
| | </xsl:if> |
---|
| | |
---|
| | <xsl:call-template name="generate-content-cell"> |
---|
| | <xsl:with-param name="colour">medgreen</xsl:with-param> |
---|
| | <xsl:with-param name="columns" select="if ( $numbered = 'yes' ) then 1 else 2" /> |
---|
| | <xsl:with-param name="rows" select="if ( @rows ) then @rows else 1" /> |
---|
| | </xsl:call-template> |
---|
| | </common> |
---|
| | </template> |
---|
| | |
---|
| |
---|
| | Generate a cell containing a single, dynamically-generated number, centered within the cell. We can't just use generate-content-cell for these cells, because the number doesn't exist until the point where the template is called. Generate-content-cell does have the @nodes attribute, but that expects a node list, not a scalar value. The (Xe)LaTeX version of this template also uses \makebox rather than a tabular to reduce the amount of horizontal space generated (we can do this because numbers don't include line breaks), and omits the @style and @align attributes, as they're pretty much irrelevant (for now, at least). |
---|
| | |
---|
| | TODO: Is it possible to refactor both templates so that there's less code duplication? |
---|
| | |
---|
| | @columns: The number of columns the cell spans. [default 1] |
---|
| | |
---|
| | @rows: The number of rows the cell spans. [default @lectures-per-week] |
---|
| | |
---|
| | @number: The number to be output in the cell. [default 0] |
---|
| | $columns: The number of columns the cell spans. [default 1] |
---|
| | |
---|
| | $rows: The number of rows the cell spans. [default @lectures-per-week] |
---|
| | |
---|
| | $number: The number to be output in the cell. [default 0] |
---|
| | |
---|
| | (Xe)LaTeX only |
---|
| | @column-format: A LaTeX tabular column specifiation for the cell. [default c|] |
---|
| | $column-format: A LaTeX tabular column specifiation for the cell. [default c|] |
---|
| | |
---|
| | (X)HTML only |
---|
| | @colour: The display colour of the cell, which maps to a predefined CSS class. [default white] |
---|
| | $colour: The display colour of the cell, which maps to a predefined CSS class. [default white] |
---|
| | --> |
---|
| | <template name="generate-number-cell"> |
---|
| | <common> |
---|
| | <xsl:param name="columns" as="xs:integer">1</xsl:param> |
---|
| |
---|
| | |
---|
| | <!-- |
---|
| | Generate a cell containing general content of some sort. In (Xe)LaTeX, the cell content is embedded within a tabular environment, as it may contain embedded line breaks. (A \shortstack would also work, but the line spacing doesn't look as nice as it does with a tabular.) |
---|
| | |
---|
| | @columns: The number of columns the cell spans. [default 1] |
---|
| | |
---|
| | @rows: The number of rows the cell spans. [default @lectures-per-week] |
---|
| | |
---|
| | @align: The alignment of the content within the cell. [default center] |
---|
| | |
---|
| | @style: Styling information for the cell. |
---|
| | $columns: The number of columns the cell spans. [default 1] |
---|
| | |
---|
| | $rows: The number of rows the cell spans. [default @lectures-per-week] |
---|
| | |
---|
| | $align: The alignment of the content within the cell. [default center] |
---|
| | |
---|
| | $style: Styling information for the cell. |
---|
| | |
---|
| | - For (Xe)LaTeX, a string containing styling /declarations/ (e.g., \bfseries, \sffamily). You can't use the macro forms (e.g., \textbf, \textsf), because of the embedded tabular environment. |
---|
| | |
---|
| | - For (X)HTML, a string containing CSS styling information. Note: use @align for cell alignment and @colour for cell colouring. |
---|
| | |
---|
| | @nodes: An optional list of XML document nodes that are processed to generate the cell content. [default: all sub-nodes of the current context node] |
---|
| | $nodes: An optional list of XML document nodes that are processed to generate the cell content. [default: all sub-nodes of the current context node] |
---|
| | |
---|
| | (Xe)LaTeX only |
---|
| | @column-format: A LaTeX tabular column specifiation for the cell. [default c|] |
---|
| | $column-format: A LaTeX tabular column specifiation for the cell. [default c|] |
---|
| | |
---|
| | (X)HTML only |
---|
| | @colour: The display colour of the cell, which maps to a predefined CSS class. [default white] |
---|
| | $colour: The display colour of the cell, which maps to a predefined CSS class. [default white] |
---|
| | --> |
---|
| | <template name="generate-content-cell"> |
---|
| | <common> |
---|
| | <xsl:param name="columns" as="xs:integer">1</xsl:param> |
---|
| |
---|
| | |
---|
| | <!-- |
---|
| | Generate an empty cell. |
---|
| | |
---|
| | @columns: The number of columns the cell spans. [default 1] |
---|
| | |
---|
| | @rows: The number of rows the cell spans. [default @lectures-per-week] |
---|
| | $columns: The number of columns the cell spans. [default 1] |
---|
| | |
---|
| | $rows: The number of rows the cell spans. [default @lectures-per-week] |
---|
| | |
---|
| | (Xe)LaTeX only |
---|
| | @column-format: A LaTeX tabular column specifiation for the cell. [default c|] |
---|
| | $column-format: A LaTeX tabular column specifiation for the cell. [default c|] |
---|
| | |
---|
| | (X)HTML only |
---|
| | @colour: The display colour of the cell, which maps to a predefined CSS class. [default white] |
---|
| | $colour: The display colour of the cell, which maps to a predefined CSS class. [default white] |
---|
| | --> |
---|
| | <template name="generate-empty-cell"> |
---|
| | <common> |
---|
| | <xsl:param name="columns" as="xs:integer">1</xsl:param> |
---|
| |
---|
|