VirtualBox

Changeset 78508 in vbox


Ignore:
Timestamp:
May 14, 2019 2:53:42 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130548
Message:

manual/docbook2latex.xsl: Pick up titles on simplesect elements. bugref:9216

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/docbook2latex.xsl

    r78505 r78508  
    283283  </xsl:template>
    284284
     285  <!-- Determins the section depth, returning a number 1,2,3,4,5,6,7,... -->
     286  <xsl:template name="get-section-level">
     287    <xsl:param name="a_Node" select=".."/>
     288    <xsl:for-each select="$a_Node"> <!-- makes it current -->
     289      <xsl:choose>
     290        <xsl:when test="self::sect1"><xsl:text>1</xsl:text></xsl:when>
     291        <xsl:when test="self::sect2"><xsl:text>2</xsl:text></xsl:when>
     292        <xsl:when test="self::sect3"><xsl:text>3</xsl:text></xsl:when>
     293        <xsl:when test="self::sect4"><xsl:text>4</xsl:text></xsl:when>
     294        <xsl:when test="self::sect5"><xsl:text>5</xsl:text></xsl:when>
     295        <xsl:when test="self::section">
     296          <xsl:value-of select="count(ancestor::section) + 1"/>
     297        </xsl:when>
     298        <xsl:when test="self::simplesect">
     299          <xsl:variable name="tmp">
     300            <xsl:call-template name="get-section-level">
     301              <xsl:with-param name="a_Node" select="parent::*"/>
     302            </xsl:call-template>
     303          </xsl:variable>
     304          <xsl:value-of select="$tmp + 1"/>
     305        </xsl:when>
     306        <xsl:otherwise>
     307          <xsl:message terminate="yes">get-section-level was called on non-section element: <xsl:value-of select="."/> </xsl:message>
     308        </xsl:otherwise>
     309      </xsl:choose>
     310    </xsl:for-each>
     311  </xsl:template>
     312
    285313  <!--
    286314    Inserts \hypertarget{@id} that can be referenced via the /A "nameddest=@id"
     
    401429        </xsl:call-template>
    402430      </xsl:when>
     431
     432      <xsl:when test="parent::simplesect">
     433        <xsl:if test="../@role">
     434          <xsl:message terminate="yes">Role not allowed with simplesect: <xsl:value-of select="../@role"/></xsl:message>
     435        </xsl:if>
     436        <xsl:variable name="level">
     437          <xsl:call-template name="get-section-level">
     438            <xsl:with-param name="a_Node" select=".."/>
     439          </xsl:call-template>
     440        </xsl:variable>
     441        <xsl:choose>
     442          <xsl:when test="$level = 1">
     443            <xsl:call-template name="title-wrapper"><xsl:with-param name="texcmd">\section*</xsl:with-param></xsl:call-template>
     444          </xsl:when>
     445          <xsl:when test="$level = 2">
     446            <xsl:call-template name="title-wrapper"><xsl:with-param name="texcmd">\subsection*</xsl:with-param></xsl:call-template>
     447          </xsl:when>
     448          <xsl:when test="$level = 3">
     449            <xsl:call-template name="title-wrapper"><xsl:with-param name="texcmd">\subsubsection*</xsl:with-param></xsl:call-template>
     450          </xsl:when>
     451          <xsl:when test="$level = 4">
     452            <xsl:call-template name="title-wrapper"><xsl:with-param name="texcmd">\paragraph*</xsl:with-param></xsl:call-template>
     453          </xsl:when>
     454          <xsl:when test="$level = 5">
     455            <xsl:call-template name="title-wrapper"><xsl:with-param name="texcmd">\subparagraph*</xsl:with-param></xsl:call-template>
     456          </xsl:when>
     457          <xsl:otherwise>
     458            <xsl:message terminate="yes">Unsupported simplesect/title depth: <xsl:value-of select="$level"/></xsl:message>
     459          </xsl:otherwise>
     460        </xsl:choose>
     461      </xsl:when>
     462
    403463    </xsl:choose>
    404464    <xsl:if test="$refid">
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette