diff options
-rw-r--r-- | prologue/audience.xml | 2 | ||||
-rw-r--r-- | prologue/errata.xml | 2 | ||||
-rw-r--r-- | prologue/foreword.xml | 2 | ||||
-rw-r--r-- | prologue/hostreqs.xml | 2 | ||||
-rw-r--r-- | prologue/organization.xml | 2 | ||||
-rw-r--r-- | prologue/prerequisites.xml | 2 | ||||
-rw-r--r-- | prologue/typography.xml | 2 | ||||
-rw-r--r-- | stylesheets/xhtml/lfs-sections.xsl | 42 |
8 files changed, 47 insertions, 9 deletions
diff --git a/prologue/audience.xml b/prologue/audience.xml index b883fd807..eb8950efb 100644 --- a/prologue/audience.xml +++ b/prologue/audience.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-audience" label="ii"> +<sect1 id="pre-audience"> <?dbhtml filename="audience.html"?> <title>Audience</title> diff --git a/prologue/errata.xml b/prologue/errata.xml index 6c5f8a5b9..69e196210 100644 --- a/prologue/errata.xml +++ b/prologue/errata.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-errata" label="vii"> +<sect1 id="pre-errata"> <?dbhtml filename="errata.html"?> <title>Errata</title> diff --git a/prologue/foreword.xml b/prologue/foreword.xml index 8541451e7..2ebe3414c 100644 --- a/prologue/foreword.xml +++ b/prologue/foreword.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-foreword" label="i"> +<sect1 id="pre-foreword"> <?dbhtml filename="foreword.html"?> <title>Foreword</title> diff --git a/prologue/hostreqs.xml b/prologue/hostreqs.xml index b29b58c6a..a0c82c309 100644 --- a/prologue/hostreqs.xml +++ b/prologue/hostreqs.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-hostreqs" label="iv"> +<sect1 id="pre-hostreqs"> <?dbhtml filename="hostreqs.html"?> <title>Host System Requirements</title> diff --git a/prologue/organization.xml b/prologue/organization.xml index ffaac5165..c4ca2cd31 100644 --- a/prologue/organization.xml +++ b/prologue/organization.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-organization" label="vi"> +<sect1 id="pre-organization"> <?dbhtml filename="organization.html"?> <title>Structure</title> diff --git a/prologue/prerequisites.xml b/prologue/prerequisites.xml index 60f144938..c3adf54eb 100644 --- a/prologue/prerequisites.xml +++ b/prologue/prerequisites.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-prerequisites" label="iii"> +<sect1 id="pre-prerequisites"> <?dbhtml filename="prerequisites.html"?> <title>Prerequisites</title> diff --git a/prologue/typography.xml b/prologue/typography.xml index 27556c4fd..ab884840d 100644 --- a/prologue/typography.xml +++ b/prologue/typography.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="pre-typography" label="v"> +<sect1 id="pre-typography"> <?dbhtml filename="typography.html"?> <title>Typography</title> diff --git a/stylesheets/xhtml/lfs-sections.xsl b/stylesheets/xhtml/lfs-sections.xsl index 210ea0c46..17944124d 100644 --- a/stylesheets/xhtml/lfs-sections.xsl +++ b/stylesheets/xhtml/lfs-sections.xsl @@ -48,12 +48,50 @@ <xsl:call-template name="process.chunk.footnotes"/> </div> </xsl:template> - + <!-- Sections numbering --> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="section.label.includes.component.label" select="1"/> - <!-- Skip numeraration for sections with empty title --> + <!-- Use lowercase roman numbers for sect1 in preface --> + <xsl:template match="sect1" mode="label.markup"> + <!-- if the parent is a component, maybe label that too --> + <xsl:variable name="parent.is.component"> + <xsl:call-template name="is.component"> + <xsl:with-param name="node" select=".."/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="component.label"> + <xsl:if test="$section.label.includes.component.label != 0 + and $parent.is.component != 0"> + <xsl:variable name="parent.label"> + <xsl:apply-templates select=".." mode="label.markup"/> + </xsl:variable> + <xsl:if test="$parent.label != ''"> + <xsl:apply-templates select=".." mode="label.markup"/> + <xsl:apply-templates select=".." mode="intralabel.punctuation"/> + </xsl:if> + </xsl:if> + </xsl:variable> + <xsl:choose> + <xsl:when test="@label"> + <xsl:value-of select="@label"/> + </xsl:when> + <xsl:when test="$section.autolabel != 0"> + <xsl:copy-of select="$component.label"/> + <xsl:choose> + <xsl:when test="ancestor::preface"> + <xsl:number format="i" count="sect1"/> + </xsl:when> + <xsl:otherwise> + <xsl:number format="1" count="sect1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + </xsl:choose> + </xsl:template> + + <!-- Skip numeration for sect2 with empty title --> <xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup"> <xsl:if test="string-length(title) > 0"> <!-- label the parent --> |