Newer
Older
XML / modules / latex.xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <!--
  4. LaTeX-specific items.
  5. -->
  6.  
  7. <stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  8.  
  9.  
  10. <!--
  11. Environment setup. This enables you to define environment settings (e.g., required LaTeX packages, etc.). We normally explicitly call the sub-elements within this, so this template is empty to prevent unwanted stuff accidentally being included in the output.
  12. -->
  13. <template name="environment" match="environment" />
  14.  
  15. <!--
  16. Load a LaTeX package.
  17. @options: Any arguments to the package. [optional]
  18. -->
  19. <template name="latex-package" match="latex-packages/package">
  20. <common formats="/latex/xelatex/">
  21. <xsl:text>\usepackage</xsl:text>
  22. <xsl:if test="@options">
  23. <xsl:text>[</xsl:text>
  24. <xsl:value-of select="@options" />
  25. <xsl:text>]</xsl:text>
  26. </xsl:if>
  27. <xsl:text>{</xsl:text>
  28. <xsl:value-of select="." />
  29. <xsl:text>}</xsl:text>
  30. <xsl:call-template name="newline-internal" />
  31. </common>
  32. </template>
  33. <!--
  34. Execute a preamble LaTeX command. Use to set up things like counters, fonts, hyperref options, etc.
  35. -->
  36. <template name="latex-command" match="latex-commands/command">
  37. <common formats="/latex/xelatex/">
  38. <xsl:value-of select="." />
  39. <xsl:call-template name="newline-internal" />
  40. </common>
  41. </template>
  42. <!-- LaTeX hyphenation. A space-delimited list of hyphenated words. -->
  43. <template name="latex-hyphenation" match="latex-commands/hyphenation">
  44. <common formats="/latex/xelatex/">
  45. <xsl:text>\hyphenation{</xsl:text>
  46. <xsl:value-of select="." />
  47. <xsl:text>}</xsl:text>
  48. <xsl:call-template name="newline-internal" />
  49. </common>
  50. </template>
  51.  
  52. <!--
  53. Specify LaTeX document class and options. The master stylesheet specifies \documentclass[a4paper,12pt]{article}. Anything you specify here will override that completely, so be sure to set a4paper and 12pt if that's what you want.
  54. @options: The required document class options. [optional]
  55. -->
  56. <!--
  57. Hmm, this may be more complex than I thought... External environment files sort of stuff it up. Perhaps LaTeX document class stuff should be in attributes of the document element?
  58. -->
  59. <template name="latex-documentclass" match="latex-documentclass|documentclass">
  60. <common formats="/latex/xelatex/">
  61. <xsl:text>\documentclass[</xsl:text>
  62. <xsl:value-of select="@options" />
  63. <xsl:text>]{</xsl:text>
  64. <xsl:value-of select="." />
  65. <xsl:text>}</xsl:text>
  66. <xsl:call-template name="newline-internal" />
  67. </common>
  68. </template>
  69. <!-- Durr, this is identical to the previous one??? -->
  70. <template name="latex-documentclass-options" match="latex-documentclass[@options]|documentclass[@options]">
  71. <common formats="/latex/xelatex/">
  72. <xsl:text>\documentclass[</xsl:text>
  73. <xsl:value-of select="@options" />
  74. <xsl:text>]{</xsl:text>
  75. <xsl:value-of select="." />
  76. <xsl:text>}</xsl:text>
  77. <xsl:call-template name="newline-internal" />
  78. </common>
  79. </template>
  80. <!--
  81. Specify additional LaTeX document class options (i.e., in addition to the defaults). These should be a comma-separated list of the required options. These will be appended to the standard defaults (a4paper, 12pt).
  82. -->
  83. <template name="latex-document-options" match="latex-document-options">
  84. <common formats="/latex/xelatex/">
  85. <xsl:apply-templates />
  86. </common>
  87. </template>
  88.  
  89.  
  90. </stylesheet>