Added support for basic text colouring
1 parent ab16136 commit 03303405a91b5549e8ca2a9c0a121a200a38141f
Nigel Stanger authored on 5 Apr 2019
Showing 3 changed files
View
23
modules/basic-text-formatting.xml
<xsl:call-template name="newline-internal" />
</common>
<common formats="/html/xhtml/">
<div style="text-align: center;">
<xsl:apply-templates />
</div>
</common>
</template>
<!--
Simple inline text colors using CSS colour names. (This requires the css-colors package in LaTeX.)
TODO: RGB colours?
@name: The CSS name of the colour. [REQUIRED]
-->
<template name="colour" match="color|colour">
<common formats="/latex/xelatex/">
<xsl:text>\textcolor{</xsl:text>
<xsl:value-of select="@name" />
<xsl:text>}{</xsl:text>
<xsl:apply-templates />
<xsl:text>}</xsl:text>
</common>
<common formats="/html/xhtml/">
<div style="color: {@name};">
<xsl:apply-templates />
</div>
</common>
</template>
View
42
quick-reference.markdown
| | `vskip` | |
 
### Text formatting and layout (`basic-text-formatting.xml`)
 
| Item | Element(s) | Attributes | Notes
| ---- | ---------- | ---------- | -----
| bold face | `bold` | |
| center | `center` | |
| | `centering` | |
| | `centre` | |
| | `centring` | |
| emphasis | `em` | |
| | `emph` | |
| foreign word | `foreign` | |
| italics | `italic` | |
| strikethrough | `line-through` | |
| | `linethrough` | |
| | `strike-through` | |
| | `strikethrough` | |
| strong emphasis | `strong` | |
| term | `term` | |
| underline | `u` | |
| | `underline` | |
| Item | Element(s) | Attributes | Notes
| ---- | ---------- | ---------- | -----
| bold face | `bold` | |
| colour | `color` | `name=`*`<CSS colour name>`* | (Xe)LaTeX: via `css-color` package
| | `colour` | |
| center | `center` | |
| | `centering` | |
| | `centre` | |
| | `centring` | |
| emphasis | `em` | |
| | `emph` | |
| foreign word | `foreign` | |
| italics | `italic` | |
| strikethrough | `line-through` | |
| | `linethrough` | |
| | `strike-through` | |
| | `strikethrough` | |
| strong emphasis | `strong` | |
| term | `term` | |
| underline | `u` | |
| | `underline` | |
 
### Number formatting (`number-formatting.xml`)
 
| Item | Element(s) | Attributes | Notes
View
xml2xslt.xsl