Changeset 8005

Show
Ignore:
Timestamp:
04/02/07 15:35:30 (2 years ago)
Author:
manuel
Message:

Started pdf/lfs-admon.xsl revision.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/new-xsl/lfs-pdf.xsl

    r8004 r8005  
    4545 
    4646    <!-- Specify the default text alignment --> 
    47   <xsl:param name="">justify</xsl:param> 
     47  <xsl:param name="alignment">justify</xsl:param> 
    4848 
    4949    <!-- Specifies the default point size for body text. 
  • branches/new-xsl/pdf/lfs-admon.xsl

    r7920 r8005  
    66 
    77 
    8     <!-- Graphics in admonitions --> 
     8    <!-- Use graphics in admonitions? 1 = yes, 0 = no --> 
    99  <xsl:param name="admon.graphics" select="1"/> 
     10 
     11    <!-- Path to admonition graphics relative to index.xml --> 
    1012  <xsl:param name="admon.graphics.path" select="'images/'"/> 
    1113 
    12     <!-- Admonition block properties --> 
    13   <xsl:template match="important|warning|caution"> 
    14     <xsl:choose> 
    15       <xsl:when test="$admon.graphics != 0"> 
    16         <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em" 
    17               space-before.maximum="0.8em" border-style="solid" border-width="1pt" 
    18               border-color="#500" background-color="#FFFFE6"> 
    19         <xsl:call-template name="graphical.admonition"/> 
    20         </fo:block> 
    21       </xsl:when> 
    22       <xsl:otherwise> 
    23         <xsl:call-template name="nongraphical.admonition"/> 
    24       </xsl:otherwise> 
    25     </xsl:choose> 
    26   </xsl:template> 
     14    <!-- Global admonitions properties --> 
     15  <xsl:attribute-set name="graphical.admonition.properties"> 
     16    <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute> 
     17    <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute> 
     18    <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute> 
     19    <xsl:attribute name="space-after.optimum">0.6em</xsl:attribute> 
     20    <xsl:attribute name="space-after.minimum">0.4em</xsl:attribute> 
     21    <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute> 
     22    <xsl:attribute name="border-style">solid</xsl:attribute> 
     23    <xsl:attribute name="border-width">1pt</xsl:attribute> 
     24    <xsl:attribute name="background-color">#FFFFE6</xsl:attribute> 
     25    <xsl:attribute name="border-color"> 
     26      <xsl:choose> 
     27        <xsl:when test="self::note | self::tip">#E0E0E0</xsl:when> 
     28        <xsl:otherwise>#500</xsl:otherwise> 
     29      </xsl:choose> 
     30    </xsl:attribute> 
     31  </xsl:attribute-set> 
    2732 
    28   <xsl:template match="note|tip"
    29     <xsl:choose
    30       <xsl:when test="$admon.graphics != 0"
    31         <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em" 
    32               space-before.maximum="0.8em" border-style="solid" border-width="1pt" 
    33               border-color="#E0E0E0" background-color="#FFFFE6"
    34         <xsl:call-template name="graphical.admonition"/
    35         </fo:block
    36       </xsl:when> 
    37       <xsl:otherwise
    38         <xsl:call-template name="nongraphical.admonition"/
    39       </xsl:otherwise> 
    40     </xsl:choose> 
    41   </xsl:template
     33    <!-- Properties for admonitions titles --
     34  <xsl:attribute-set name="admonition.title.properties"
     35    <xsl:attribute name="font-size">14pt</xsl:attribute
     36    <xsl:attribute name="font-weight">bold</xsl:attribute> 
     37    <xsl:attribute name="hyphenate">false</xsl:attribute> 
     38    <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute
     39    <xsl:attribute name="color"
     40      <xsl:choose
     41        <xsl:when test="ancestor-or-self::important | ancestor-or-self::warning 
     42                        | ancestor-or-self::caution">#500</xsl:when
     43        <xsl:otherwise>#000</xsl:otherwise
     44      </xsl:choose> 
     45    </xsl:attribute> 
     46  </xsl:attribute-set
    4247 
    43     <!-- Admonitions text properties --> 
     48    <!-- Properties for admonitions text --> 
    4449  <xsl:attribute-set name="admonition.properties"> 
    4550    <xsl:attribute name="margin-right">6pt</xsl:attribute> 
    4651  </xsl:attribute-set> 
    4752 
    48     <!-- Adding left space to the graphics and color to the titles --> 
    49   <xsl:template name="graphical.admonition"> 
    50     <xsl:variable name="id"> 
    51       <xsl:call-template name="object.id"/> 
    52     </xsl:variable> 
    53     <xsl:variable name="graphic.width"> 
    54      <xsl:apply-templates select="." mode="admon.graphic.width"/> 
    55     </xsl:variable> 
    56     <fo:block id="{$id}"> 
    57       <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt" 
    58               provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing"> 
    59         <fo:list-item> 
    60             <fo:list-item-label end-indent="label-end()"> 
    61               <fo:block margin-left="18pt"> 
    62                 <fo:external-graphic width="auto" height="auto" 
    63                         content-width="{$graphic.width}" > 
    64                   <xsl:attribute name="src"> 
    65                     <xsl:call-template name="admon.graphic"/> 
    66                   </xsl:attribute> 
    67                 </fo:external-graphic> 
    68               </fo:block> 
    69             </fo:list-item-label> 
    70             <fo:list-item-body start-indent="body-start()"> 
    71               <xsl:if test="$admon.textlabel != 0 or title"> 
    72                 <fo:block xsl:use-attribute-sets="admonition.title.properties"> 
    73                   <xsl:if test="ancestor-or-self::important"> 
    74                     <xsl:attribute name="color">#500</xsl:attribute> 
    75                   </xsl:if> 
    76                   <xsl:if test="ancestor-or-self::warning"> 
    77                     <xsl:attribute name="color">#500</xsl:attribute> 
    78                   </xsl:if> 
    79                   <xsl:if test="ancestor-or-self::caution"> 
    80                     <xsl:attribute name="color">#500</xsl:attribute> 
    81                   </xsl:if> 
    82                   <xsl:apply-templates select="." mode="object.title.markup"/> 
    83                 </fo:block> 
    84               </xsl:if> 
    85               <fo:block xsl:use-attribute-sets="admonition.properties"> 
    86                 <xsl:apply-templates/> 
    87               </fo:block> 
    88             </fo:list-item-body> 
    89         </fo:list-item> 
    90       </fo:list-block> 
    91     </fo:block> 
     53    <!-- admon.graphic.width: 
     54           Making the graphic smaller. --> 
     55    <!-- The original template is in {docbook-xsl}/fo/admon.xsl --> 
     56  <xsl:template match="*" mode="admon.graphic.width"> 
     57    <xsl:param name="node" select="."/> 
     58    <xsl:text>24pt</xsl:text> 
    9259  </xsl:template> 
    9360