| 1 | <!-- $Cambridge: exim/doc/doc-docbook/MyStyle.xsl,v 1.4 2006/12/19 12:28:35 ph10 Exp $ --> |
| 2 | |
| 3 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> |
| 4 | |
| 5 | <!-- This file contains changes to the Docbook XML stylesheets that I want to |
| 6 | have happen in all forms of output. It is imported by all the drivers. --> |
| 7 | |
| 8 | |
| 9 | <!-- Set body font size --> |
| 10 | |
| 11 | <xsl:param name="body.font.master">11</xsl:param> |
| 12 | |
| 13 | <!-- Set no relative indent for titles and body --> |
| 14 | |
| 15 | <xsl:param name="body.start.indent">0pt</xsl:param> |
| 16 | <xsl:param name="title.margin.left">0pt</xsl:param> |
| 17 | |
| 18 | |
| 19 | <!-- This removes the dot at the end of run-in titles, which we use |
| 20 | for formal paragraphs for command line options. --> |
| 21 | |
| 22 | <xsl:param name="runinhead.default.title.end.punct" select="' '"></xsl:param> |
| 23 | |
| 24 | |
| 25 | <!-- Without this setting, variable lists get misformatted in the FO case, |
| 26 | causing overprinting. Maybe with a later release of fop the need to do this |
| 27 | might go away. --> |
| 28 | |
| 29 | <xsl:param name="variablelist.as.blocks" select="1"></xsl:param> |
| 30 | |
| 31 | |
| 32 | <!-- |
| 33 | Cause sections to be numbered, and to include the outer component number. |
| 34 | --> |
| 35 | |
| 36 | <xsl:param name="section.autolabel">1</xsl:param> |
| 37 | <xsl:param name="section.label.includes.component.label">1</xsl:param> |
| 38 | |
| 39 | |
| 40 | <!-- |
| 41 | Specify TOCs only for top-level things. No TOCs for components (e.g. chapters) |
| 42 | --> |
| 43 | |
| 44 | <xsl:param name="generate.toc"> |
| 45 | article toc,title |
| 46 | book toc,title |
| 47 | </xsl:param> |
| 48 | |
| 49 | |
| 50 | <!-- Turn off the poor hyphenation --> |
| 51 | |
| 52 | <xsl:param name="hyphenate">false</xsl:param> |
| 53 | |
| 54 | |
| 55 | <!-- Generate only numbers, no titles, in cross references. --> |
| 56 | |
| 57 | <xsl:param name="xref.with.number.and.title">0</xsl:param> |
| 58 | |
| 59 | |
| 60 | <!-- Output variable names in italic rather than the default monospace. --> |
| 61 | |
| 62 | <xsl:template match="varname"> |
| 63 | <xsl:call-template name="inline.italicseq"/> |
| 64 | </xsl:template> |
| 65 | |
| 66 | |
| 67 | <!-- Output file names in italic rather than the default monospace. --> |
| 68 | |
| 69 | <xsl:template match="filename"> |
| 70 | <xsl:call-template name="inline.italicseq"/> |
| 71 | </xsl:template> |
| 72 | |
| 73 | |
| 74 | <!-- Output function names in italic rather than the default boldface. --> |
| 75 | |
| 76 | <xsl:template match="function"> |
| 77 | <xsl:call-template name="inline.italicseq"/> |
| 78 | </xsl:template> |
| 79 | |
| 80 | |
| 81 | <!-- Output options in bold rather than the default monospace. --> |
| 82 | |
| 83 | <xsl:template match="option"> |
| 84 | <xsl:call-template name="inline.boldseq"/> |
| 85 | </xsl:template> |
| 86 | |
| 87 | |
| 88 | <!-- |
| 89 | Make a number of more detailed changes to the style that involve more than just |
| 90 | fiddling with a parameter. |
| 91 | --> |
| 92 | |
| 93 | <xsl:param name="local.l10n.xml" select="document('')"/> |
| 94 | <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> |
| 95 | <l:l10n language="en"> |
| 96 | |
| 97 | <!-- Turn the text "Revision History" into nothing, because we only have |
| 98 | the info for the latest revision in the file. --> |
| 99 | |
| 100 | <l:gentext key="revhistory" text=""/> |
| 101 | <l:gentext key="RevHistory" text=""/> |
| 102 | |
| 103 | <!-- The default (as modified above) gives us "Chapter xxx" or "Section |
| 104 | xxx", with a capital letter at the start. So we have to make an more |
| 105 | complicated explicit change to give just the number. --> |
| 106 | |
| 107 | <l:context name="xref-number"> |
| 108 | <l:template name="chapter" text="%n"/> |
| 109 | <l:template name="sect1" text="%n"/> |
| 110 | <l:template name="sect2" text="%n"/> |
| 111 | <l:template name="section" text="%n"/> |
| 112 | </l:context> |
| 113 | |
| 114 | <!-- I think that having a trailing dot after section numbers looks fussy, |
| 115 | whereas you need it after just the digits of a chapter number. In both |
| 116 | cases we want to get rid of the word "chapter" or "section". --> |
| 117 | |
| 118 | <l:context name="title-numbered"> |
| 119 | <l:template name="chapter" text="%n. %t"/> |
| 120 | <l:template name="sect1" text="%n %t"/> |
| 121 | <l:template name="sect2" text="%n %t"/> |
| 122 | <l:template name="section" text="%n %t"/> |
| 123 | </l:context> |
| 124 | |
| 125 | </l:l10n> |
| 126 | </l:i18n> |
| 127 | |
| 128 | |
| 129 | <!-- The default has far too much space on either side of displays and lists --> |
| 130 | |
| 131 | <xsl:attribute-set name="verbatim.properties"> |
| 132 | <xsl:attribute name="space-before.minimum">0em</xsl:attribute> |
| 133 | <xsl:attribute name="space-before.optimum">0em</xsl:attribute> |
| 134 | <xsl:attribute name="space-before.maximum">0em</xsl:attribute> |
| 135 | <xsl:attribute name="space-after.minimum">0em</xsl:attribute> |
| 136 | <xsl:attribute name="space-after.optimum">0em</xsl:attribute> |
| 137 | <xsl:attribute name="space-after.maximum">0em</xsl:attribute> |
| 138 | <xsl:attribute name="start-indent">0.3in</xsl:attribute> |
| 139 | </xsl:attribute-set> |
| 140 | |
| 141 | <xsl:attribute-set name="list.block.spacing"> |
| 142 | <xsl:attribute name="space-before.optimum">0em</xsl:attribute> |
| 143 | <xsl:attribute name="space-before.minimum">0em</xsl:attribute> |
| 144 | <xsl:attribute name="space-before.maximum">0em</xsl:attribute> |
| 145 | <xsl:attribute name="space-after.optimum">0em</xsl:attribute> |
| 146 | <xsl:attribute name="space-after.minimum">0em</xsl:attribute> |
| 147 | <xsl:attribute name="space-after.maximum">0em</xsl:attribute> |
| 148 | </xsl:attribute-set> |
| 149 | |
| 150 | <!-- List item spacing --> |
| 151 | |
| 152 | <xsl:attribute-set name="list.item.spacing"> |
| 153 | <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute> |
| 154 | <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute> |
| 155 | <xsl:attribute name="space-before.maximum">1em</xsl:attribute> |
| 156 | </xsl:attribute-set> |
| 157 | |
| 158 | <!-- Reduce the space after informal tables --> |
| 159 | |
| 160 | <xsl:attribute-set name="informal.object.properties"> |
| 161 | <xsl:attribute name="space-before.minimum">1em</xsl:attribute> |
| 162 | <xsl:attribute name="space-before.optimum">1em</xsl:attribute> |
| 163 | <xsl:attribute name="space-before.maximum">2em</xsl:attribute> |
| 164 | <xsl:attribute name="space-after.minimum">0em</xsl:attribute> |
| 165 | <xsl:attribute name="space-after.optimum">0em</xsl:attribute> |
| 166 | <xsl:attribute name="space-after.maximum">0em</xsl:attribute> |
| 167 | </xsl:attribute-set> |
| 168 | |
| 169 | <!-- Reduce the space after section titles. 0 is not small enough. --> |
| 170 | |
| 171 | <xsl:attribute-set name="section.title.level1.properties"> |
| 172 | <xsl:attribute name="space-after.minimum">-6pt</xsl:attribute> |
| 173 | <xsl:attribute name="space-after.optimum">-4pt</xsl:attribute> |
| 174 | <xsl:attribute name="space-after.maximum">0pt</xsl:attribute> |
| 175 | </xsl:attribute-set> |
| 176 | |
| 177 | <!-- Slightly reduce the space before paragraphs --> |
| 178 | |
| 179 | <xsl:attribute-set name="normal.para.spacing"> |
| 180 | <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute> |
| 181 | <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute> |
| 182 | <xsl:attribute name="space-before.maximum">1.0em</xsl:attribute> |
| 183 | </xsl:attribute-set> |
| 184 | |
| 185 | |
| 186 | <xsl:attribute-set name="table.cell.padding"> |
| 187 | <xsl:attribute name="padding-left">2pt</xsl:attribute> |
| 188 | <xsl:attribute name="padding-right">2pt</xsl:attribute> |
| 189 | <xsl:attribute name="padding-top">0pt</xsl:attribute> |
| 190 | <xsl:attribute name="padding-bottom">0pt</xsl:attribute> |
| 191 | </xsl:attribute-set> |
| 192 | |
| 193 | |
| 194 | |
| 195 | <!-- Turn off page header rule --> |
| 196 | <xsl:param name="header.rule" select="0"></xsl:param> |
| 197 | |
| 198 | <!-- Remove page header content --> |
| 199 | <xsl:template name="header.content"/> |
| 200 | |
| 201 | <!-- Remove space for page header --> |
| 202 | <xsl:param name="body.margin.top" select="'0in'"></xsl:param> |
| 203 | <xsl:param name="region.before.extent" select="'0in'"></xsl:param> |
| 204 | |
| 205 | <!-- Turn off page footer rule --> |
| 206 | <xsl:param name="footer.rule" select="0"></xsl:param> |
| 207 | |
| 208 | |
| 209 | </xsl:stylesheet> |