Changeset 6872957 for stylesheets


Ignore:
Timestamp:
08/10/2004 09:28:38 PM (20 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
a03b9453
Parents:
a112251
Message:

Renamed the print stylesheets to pdf.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4028 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Location:
stylesheets
Files:
3 deleted
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-pdf.xsl

    ra112251 r6872957  
    44                xmlns:fo="http://www.w3.org/1999/XSL/Format"
    55                version="1.0">
    6 
    7   <!-- We use FO and FOP as the processor -->
     6    <!-- We use FO and FOP as the processor -->
    87  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/fo/docbook.xsl"/>
    98  <xsl:param name="fop.extensions" select="1"/>
    109  <xsl:param name="draft.mode" select="'no'"/>
    1110
    12   <!-- Including our others customized templates -->
     11    <!-- Including our others customized templates -->
    1312  <xsl:include href="pdf/lfs-index.xsl"/>
    1413  <xsl:include href="pdf/lfs-pagesetup.xsl"/>
     14  <xsl:include href="pdf/lfs-sections.xsl"/>
     15  <xsl:include href="pdf/lfs-mixed.xsl"/>
    1516
    16   <!-- Probably want to make the paper size configurable -->
    17   <xsl:param name="paper.type" select="'A4'"/>
     17    <!-- Paper size required by the publisher -->
     18  <xsl:param name="paper.type" select="'Customized'"/>
     19  <xsl:param name="page.width">7.25in</xsl:param>
     20  <xsl:param name="page.height">9.25in</xsl:param>
    1821
    19   <!-- Don't hyphenate -->
     22    <!-- Printing Style -->
     23  <xsl:param name="double.sided" select="1"/>
    2024  <xsl:param name="hyphenate">false</xsl:param>
    21   <xsl:param name="alignment">left</xsl:param>
     25  <xsl:param name="alignment">justify</xsl:param>
    2226
    23   <!-- Font size -->
    24   <xsl:param name="body.font.master">8</xsl:param>
    25   <xsl:param name="body.font.size">10pt</xsl:param>
     27    <!-- Font size -->
     28  <xsl:param name="body.font.master">6</xsl:param>
     29  <xsl:param name="body.font.size">8pt</xsl:param>
    2630
    27   <!-- Graphics in admonitions -->
    28   <xsl:param name="admon.graphics" select="1"/>
    29   <xsl:param name="admon.graphics.path"
    30     select="'/usr/share/xml/docbook/xsl-stylesheets-1.65.1/images/'"/>
    31 
    32   <!-- Shade screen -->
    33   <xsl:param name="shade.verbatim" select="1"/>
    34 
    35   <!-- TOC generation -->
     31    <!-- TOC stuff -->
    3632  <xsl:param name="generate.toc">
    3733    book      toc
     
    3935  </xsl:param>
    4036  <xsl:param name="toc.section.depth">1</xsl:param>
    41   <xsl:param name="generate.section.toc.level" select="-1"/>
    42   <xsl:param name="toc.indent.width" select="18"/>
     37  <xsl:param name="generate.section.toc.level" select="-1"></xsl:param>
     38  <xsl:param name="toc.indent.width" select="18"></xsl:param>
    4339
    44   <!-- Page number in Xref-->
    45   <xsl:param name="insert.xref.page.number">yes</xsl:param>
    46   <xsl:template match="*" mode="page.citation">
    47     <xsl:param name="id" select="'???'"/>
    48     <fo:inline keep-together.within-line="always">
    49       <xsl:text>[p.</xsl:text>
    50       <fo:page-number-citation ref-id="{$id}"/>
    51       <xsl:text>]</xsl:text>
    52     </fo:inline>
    53   </xsl:template>
     40    <!-- Page number in Xref ?-->
     41  <xsl:param name="insert.xref.page.number">no</xsl:param>
    5442
    55   <!-- Prevent duplicate e-mails in the Acknowledgments pages-->
     43    <!-- Prevent duplicate e-mails in the Acknowledgments pages-->
    5644  <xsl:param name="ulink.show" select="0"/>
    5745
  • stylesheets/pdf/lfs-index.xsl

    ra112251 r6872957  
    44<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
    55<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
    6 <!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
    76<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
    8 <!ENTITY sep '" "'>
    97]>
    108
     
    1311                version="1.0">
    1412
    15     <!--Only one column to fit the table layout-->
    16   <xsl:param name="column.count.index" select="1"/>
    17 
    1813    <!--Title-->
    1914  <xsl:template match="index" mode="title.markup">
    20     <xsl:text>Index of packages and important installed files</xsl:text>
     15    <xsl:param name="allow-anchors" select="0"/>
     16    <xsl:text>Index</xsl:text>
    2117  </xsl:template>
    2218
     
    3632                <xsl:when test="$divtitle = 'A'">
    3733                  <xsl:text>Packages</xsl:text>
    38                 </xsl:when>
    39                 <xsl:when test="$divtitle = 'B'">
    40                     <xsl:text>Programs</xsl:text>
    41                 </xsl:when>
    42                 <xsl:when test="$divtitle = 'C'">
    43                     <xsl:text>Libraries</xsl:text>
    44                 </xsl:when>
    45                 <xsl:when test="$divtitle = 'D'">
    46                     <xsl:text>Scripts</xsl:text>
    47                 </xsl:when>
    48                 <xsl:when test="$divtitle = 'E'">
    49                     <xsl:text>Others</xsl:text>
    50                 </xsl:when>
    51                 <xsl:otherwise>
    52                   <xsl:value-of select="$divtitle"/>
    53                 </xsl:otherwise>
    54               </xsl:choose>
     34              </xsl:when>
     35              <xsl:when test="$divtitle = 'B'">
     36                  <xsl:text>Programs</xsl:text>
     37              </xsl:when>
     38              <xsl:when test="$divtitle = 'C'">
     39                  <xsl:text>Libraries</xsl:text>
     40              </xsl:when>
     41              <xsl:when test="$divtitle = 'D'">
     42                  <xsl:text>Scripts</xsl:text>
     43              </xsl:when>
     44              <xsl:when test="$divtitle = 'E'">
     45                  <xsl:text>Others</xsl:text>
     46              </xsl:when>
     47              <xsl:otherwise>
     48                <xsl:value-of select="$divtitle"/>
     49              </xsl:otherwise>
     50            </xsl:choose>
    5551            </xsl:with-param>
    5652          </xsl:call-template>
    5753        </xsl:if>
    58         <fo:table table-layout="fixed" width="100%">
    59           <fo:table-column column-number="1" column-width="11em"/>
    60           <fo:table-column column-number="2" column-width="19em"/>
    61           <fo:table-column column-number="3"/>
    62           <fo:table-body>
    63             <xsl:apply-templates select="key('letter', $key)[&scope;]
    64                                         [count(.|key('primary', &primary;)[&scope;][1])=1]"
    65                                 mode="index-primary">
    66               <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
    67               <xsl:with-param name="scope" select="$scope"/>
    68             </xsl:apply-templates>
    69           </fo:table-body>
    70         </fo:table>
     54        <fo:block>
     55          <xsl:apply-templates select="key('letter', $key)[&scope;]
     56                                      [count(.|key('primary', &primary;)[&scope;][1])=1]"
     57                              mode="index-primary">
     58            <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
     59            <xsl:with-param name="scope" select="$scope"/>
     60          </xsl:apply-templates>
     61        </fo:block>
    7162      </fo:block>
    7263    </xsl:if>
    7364  </xsl:template>
    7465
    75     <!-- Dropping the separator from here -->
     66    <!-- The separator -->
    7667  <xsl:template match="indexterm" mode="reference">
    7768    <xsl:param name="scope" select="."/>
     69    <xsl:text>:   </xsl:text>
    7870      <xsl:call-template name="reference">
    7971        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
     
    8173      </xsl:call-template>
    8274  </xsl:template>
    83 
    84     <!-- Changing the output tags and re-addind the separator-->
    85   <xsl:template match="indexterm" mode="index-primary">
    86     <xsl:param name="scope" select="."/>
    87     <xsl:variable name="key" select="&primary;"/>
    88     <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
    89     <fo:table-row>
    90       <fo:table-cell>
    91         <fo:block>
    92           <xsl:value-of select="primary"/>
    93           <xsl:text>: </xsl:text>
    94         </fo:block>
    95       </fo:table-cell>
    96       <xsl:for-each select="$refs[not(see) and not(seealso)
    97                             and not(secondary)]">
    98         <xsl:apply-templates select="." mode="reference">
    99           <xsl:with-param name="scope" select="$scope"/>
    100         </xsl:apply-templates>
    101       </xsl:for-each>
    102     </fo:table-row>
    103     <xsl:if test="$refs/secondary">
    104       <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
    105               concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" mode="index-secondary">
    106         <xsl:with-param name="scope" select="$scope"/>
    107         <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
    108       </xsl:apply-templates>
    109     </xsl:if>
    110   </xsl:template>
    111 
    112   <xsl:template match="indexterm" mode="index-secondary">
    113     <xsl:param name="scope" select="."/>
    114      <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
    115     <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
    116     <fo:table-row>
    117       <fo:table-cell>
    118         <fo:block start-indent="1pc">
    119           <xsl:value-of select="secondary"/>
    120           <xsl:text>: </xsl:text>
    121         </fo:block>
    122       </fo:table-cell>
    123       <xsl:for-each select="$refs[not(see) and not(seealso) and not(tertiary)]">
    124         <xsl:apply-templates select="." mode="reference">
    125           <xsl:with-param name="scope" select="$scope"/>
    126         </xsl:apply-templates>
    127       </xsl:for-each>
    128     </fo:table-row>
    129   </xsl:template>
    13075 
    131     <!-- Targets titles and bookmarks-->
     76    <!--Bookmarks-->
    13277  <xsl:template name="reference">
    13378    <xsl:param name="scope" select="."/>
     
    14994          </xsl:call-template>
    15095        </xsl:variable>
    151         <fo:table-cell>
    152           <fo:block>
    153             <fo:basic-link internal-destination="{$id}">
    154               <xsl:value-of select="$target/title"/>
    155               <xsl:apply-templates select="$target" mode="page.citation">
    156                 <xsl:with-param name="id" select="$id"/>
    157               </xsl:apply-templates>
    158             </fo:basic-link>
    159           </fo:block>
    160         </fo:table-cell>
    161         <fo:table-cell>
    162           <fo:block>
    163             <fo:basic-link internal-destination="{$id2}">
    164               <xsl:text>description</xsl:text>
    165               <xsl:apply-templates select="$target2" mode="page.citation">
    166                 <xsl:with-param name="id" select="$id2"/>
    167               </xsl:apply-templates>
    168             </fo:basic-link>
    169           </fo:block>
    170         </fo:table-cell>
     96        <fo:basic-link internal-destination="{$id}">
     97          <xsl:apply-templates select="$target" mode="page.citation">
     98            <xsl:with-param name="id" select="$id"/>
     99          </xsl:apply-templates>
     100        </fo:basic-link>
     101          <xsl:text> ,  </xsl:text>
     102        <fo:basic-link internal-destination="{$id2}">
     103          <xsl:apply-templates select="$target2" mode="page.citation">
     104            <xsl:with-param name="id" select="$id2"/>
     105          </xsl:apply-templates>
     106        </fo:basic-link>
    171107      </xsl:when>
    172108      <xsl:otherwise>
     
    178114          </xsl:call-template>
    179115        </xsl:variable>
    180         <fo:table-cell>
    181           <fo:block>
    182             <fo:basic-link internal-destination="{$id}">
    183               <xsl:value-of select="$target/title"/>
    184               <xsl:apply-templates select="$target" mode="page.citation">
    185                 <xsl:with-param name="id" select="$id"/>
    186               </xsl:apply-templates>
    187             </fo:basic-link>
    188           </fo:block>
    189         </fo:table-cell>
     116        <fo:basic-link internal-destination="{$id}">
     117          <xsl:apply-templates select="$target" mode="page.citation">
     118            <xsl:with-param name="id" select="$id"/>
     119          </xsl:apply-templates>
     120        </fo:basic-link>
    190121      </xsl:otherwise>
    191122    </xsl:choose>
    192123  </xsl:template>
    193124
     125    <!-- Page number in Index-->
     126  <xsl:template match="*" mode="page.citation">
     127    <xsl:param name="id" select="'???'"/>
     128    <fo:inline keep-together.within-line="always">
     129      <!--<xsl:text>[p</xsl:text>-->
     130      <fo:page-number-citation ref-id="{$id}"/>
     131      <!--<xsl:text>]</xsl:text>-->
     132    </fo:inline>
     133  </xsl:template>
     134
    194135</xsl:stylesheet>
  • stylesheets/pdf/lfs-pagesetup.xsl

    ra112251 r6872957  
    55                version="1.0">
    66
    7     <!-- Force section1's onto a new page -->
    8   <xsl:attribute-set name="section.level1.properties">
    9     <xsl:attribute name="break-after">
    10       <xsl:choose>
    11         <xsl:when test="not(position()=last())">
    12           <xsl:text>page</xsl:text>
    13         </xsl:when>
    14         <xsl:otherwise>
    15           <xsl:text>auto</xsl:text>
    16         </xsl:otherwise>
    17       </xsl:choose>
    18     </xsl:attribute>
    19   </xsl:attribute-set>
    20 
    217    <!-- Header -->
    22   <xsl:attribute-set name="header.content.properties">
    23     <xsl:attribute name="font-family">
    24       <xsl:value-of select="$body.fontset"/>
    25     </xsl:attribute>
    26     <xsl:attribute name="text-align">right</xsl:attribute>
    27   </xsl:attribute-set>
    28 
    298  <xsl:template name="header.content">
    30     <xsl:value-of select="/book/bookinfo/title"/>
    31     <xsl:text> - </xsl:text>
    32     <xsl:value-of select="/book/bookinfo/subtitle"/>
     9    <xsl:param name="sequence" select="''"/>
     10    <fo:block>
     11      <xsl:attribute name="text-align">
     12        <xsl:choose>
     13          <xsl:when test="$sequence = 'first' or $sequence = 'odd'">right</xsl:when>
     14          <xsl:otherwise>left</xsl:otherwise>
     15        </xsl:choose>
     16      </xsl:attribute>
     17      <xsl:value-of select="/book/bookinfo/title"/>
     18      <xsl:text> - </xsl:text>
     19      <xsl:value-of select="/book/bookinfo/subtitle"/>
     20    </fo:block>
    3321  </xsl:template>
    3422
    3523  <xsl:template name="header.table">
     24    <xsl:param name="sequence" select="''"/>
    3625    <xsl:param name="gentext-key" select="''"/>
    3726    <xsl:choose>
    38       <xsl:when test="$gentext-key = 'book'"/>
     27      <xsl:when test="$gentext-key = 'book' or $sequence = 'blank'"/>
    3928      <xsl:otherwise>
    40         <xsl:call-template name="header.content"/>
     29        <xsl:call-template name="header.content">
     30          <xsl:with-param name="sequence" select="$sequence"/>
     31        </xsl:call-template>
    4132      </xsl:otherwise>
    4233    </xsl:choose>
     
    5950
    6051  <xsl:template name="part.titlepage">
    61     <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
     52    <fo:block>
    6253      <fo:block space-before="2.5in">
    6354        <xsl:call-template name="part.titlepage.before.recto"/>
     
    7364
    7465    <!-- Margins -->
    75   <xsl:param name="page.margin.inner">0.75in</xsl:param>
    76   <xsl:param name="page.margin.outer">0.75in</xsl:param>
     66  <xsl:param name="page.margin.inner">0.5in</xsl:param>
     67  <xsl:param name="page.margin.outer">0.375in</xsl:param>
    7768  <xsl:param name="title.margin.left">-1pc</xsl:param>
    7869  <xsl:attribute-set name="normal.para.spacing">
     
    111102  <xsl:template name="book.titlepage.separator"/>
    112103
    113     <!-- How render a variablelist -->
    114   <xsl:param name="variablelist.as.blocks" select="1"/>
    115104
    116105</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.