Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 6c1629ca18f6adf273e73d0f5069fa8c > files > 339

Borges-doc-0.7.12-1mdk.noarch.rpm

<?xml version="1.0" encoding="ISO-8859-1"?>
<sect1 id="borges-style-custom-sect1">
 <sect1info>
  
<!-- Please, do NOT edit the following revision history by hand. Use the
"make <module_name>.revision" target instead.  -->

<revhistory><revision><revnumber>0.8</revnumber><date>YYYY-MM-DD</date><authorinitials>tbn</authorinitials><revremark>write</revremark> </revision><revision><revnumber>0.8</revnumber><date>YYYY-MM-DD</date><authorinitials>tbn</authorinitials><revremark>translate</revremark> </revision><revision><revnumber>0.8</revnumber><date>YYYY-MM-DD</date><authorinitials>tbn</authorinitials><revremark>tproof</revremark> </revision><revision><revnumber>0.8</revnumber><date>YYYY-MM-DD</date><authorinitials>tbn</authorinitials><revremark>pproof</revremark> </revision><revision><revnumber>0.8</revnumber><date>YYYY-MM-DD</date><authorinitials>tbn</authorinitials><revremark>ispell</revremark> </revision><revision><revnumber>0.8</revnumber><date>YYYY-MM-DD</date><authorinitials>tbn</authorinitials><revremark>lproof</revremark> </revision>
   <revision>
    <revnumber>1.en.lproof</revnumber>
    <date>YYYY-MM-DD</date>
    <authorinitials>tbn</authorinitials>
   </revision>
   <revision>
    <revnumber>1.en.ispell</revnumber>
    <date>YYYY-MM-DD</date>
    <authorinitials>tbn</authorinitials>
   </revision>
   <revision>
    <revnumber>1.en.pproof</revnumber>
    <date>YYYY-MM-DD</date>
    <authorinitials>tbn</authorinitials>
   </revision>
   <revision>
    <revnumber>1.en.tproof</revnumber>
    <date>YYYY-MM-DD</date>
    <authorinitials>tbn</authorinitials>
   </revision>
   <revision>
    <revnumber>1.en.write</revnumber>
    <date>2003-01-07</date>
    <authorinitials>cb</authorinitials>
   </revision>
  </revhistory>
 </sect1info>
 
 <title id="borges-style-custom-sect1-ti1">Output Style Customizations</title>
 
 <para id="borges-style-custom-sect1-pa1">With &prog-borges; it is very easy to control the way final
  documents are formatted thanks to &docbook; customization features.
  Moreaver it is easy to create new ciustomization layers so that each
  manual can have its own design.</para>
 
 <sect2>
  <title id="borges-style-custom-sect1-ti2">Customizing Existing Formats</title>
  
  <para id="borges-style-custom-sect1-pa2">As we already seen in <xref
   linkend="borges-writing-features-conf-default"/>, te customization
   layers for all output formats are located in
   <filename>drivers/</filename> directory. You just need to open the
   stylesheet corresponding to the format you want to change with your
   text editor:
   <variablelist>
    <varlistentry>
     <term id="borges-style-custom-sect1-te1"><filename>drivers/docbook-jadetex.dsssl</filename></term>
     <listitem>
      <para id="borges-style-custom-sect1-pa3">for &pdf; and &ps; formats outputs;</para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term id="borges-style-custom-sect1-te2"><filename>drivers/docbook-xhtml.xsl</filename></term>
     <listitem>
      <para id="borges-style-custom-sect1-pa4">for flat &html; output format;</para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term id="borges-style-custom-sect1-te3"><filename>drivers/docbook-xhtml-chunk.xsl</filename></term>
     <listitem>
      <para id="borges-style-custom-sect1-pa5">for chunked &html; output format.</para>
     </listitem>
    </varlistentry>
   </variablelist>
   Consult the documentation on how to customize
   <ulink url="http://www.docbook.org/wiki/moin.cgi/DocBookXslStylesheetDocs">XSL</ulink>
   and <ulink url="http://www.docbook.org/wiki/moin.cgi/DocBookDssslStylesheetDocs">DSSSL</ulink>
   stylesheets if needed.</para>
 </sect2>
 
 <sect2>
  <title id="borges-style-custom-sect1-ti3">Creating a New Customization Layer</title>

  <para id="borges-style-custom-sect1-pa6">Having one customization layer per output format might not be
   enough for some special needs. Let's imagine that there is a manual
   you want to publish in Europe and in the United States. Therefore
   you need it in two different paper formats: <literal>A4</literal>
   and <literal>Letter</literal>. This is done in two simple
   steps:</para>
  <procedure>
   <step>
    <title id="borges-style-custom-sect1-ti4">Create a new customization layer</title> <para id="borges-style-custom-sect1-pa7">This
     customization layer will be placed on top of &prog-borges; print
     customization layer, resulting in the following layers:</para>
    <mediaobject>
     <imageobject>
      <imagedata align="center" fileref="images/borges-customization-layers.png" format="PNG" id="borges-style-custom-sect1-im1" width="6cm"/>
     </imageobject>
    </mediaobject>
    <para id="borges-style-custom-sect1-pa8">Our new customization layer
     (<filename>drivers/docbook-jadetex-Letter.dssssl</filename>)
     would look like:</para>

    <programlisting id="borges-style-custom-sect1-pl1">
     <![CDATA[<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [<!ENTITY docbook-jadetex.dsssl SYSTEM "docbook-jadetex.dsssl" CDATA DSSSL > ]>
     
     <style-sheet> 
      <style-specification id="print" use="docbook-jadetex">
       <style-specification-body>
     
       ;;What size paper do you need? A4, A5, USletter or USlandscape?
       (define %paper-type% "USletter")
     
       </style-specification-body>
      </style-specification>
      <external-specification id="docbook-jadetex" document="docbook-jadetex.dsssl"> 
     </style-sheet>]]>
    </programlisting>

    <para id="borges-style-custom-sect1-pa9">Now that the customization layer is ready we just need to
     direct the system to use it in the second step.</para>
   </step>
   <step>
    <para id="borges-style-custom-sect1-pa10">The default &prog-borges; print stylesheet uses
     <literal>A4</literal> paper format. We then need to create a new
     manual that will use the <quote>Letter</quote> customization
     layer we just created. This is done in the super document
     configuration file, for example
     <filename>manuals/Install-guide/conf.xml</filename>:</para>
    
    <programlisting id="borges-style-custom-sect1-pl2">
<![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
<configuration>
  <stylesheet>
    <dssslprint>../../drivers/docbook-jadetex.dsssl</dssslprint>
    <xslxhtmlflat>../../drivers/docbook-xhtml.xsl</xslxhtmlflat>
    <xslxhtmlchunk>../../drivers/docbook-xhtml-chunk.xsl</xslxhtmlchunk>
  </stylesheet>

 <manuals>
  <manual id="Install-guide-A4">
    <lang>en</lang>
    <format>pdf</format>
  </manual>
  <manual id="Install-guide-Letter">
    <lang>en</lang>
    <format>pdf</format>
    <stylesheet>
      <dssslprint>../../drivers/docbook-jadetex-Letter.dsssl</dssslprint>
    </stylesheet>
  </manual>
 </manuals>
</configuration>]]>
    </programlisting>

    <para id="borges-style-custom-sect1-pa11">In this file, the first <literal>stylesheet</literal>
     element informs the system that we want to use the &prog-borges;
     stylesheets per default. Therefore, the
     <filename>Install-guide-A4</filename> manual will use
     <filename>docbook-jadetex.dsssl</filename> with
     <literal>A4</literal> paper format. However for manual
     <filename>Install-guide-Letter</filename> we specify that we want
     to use our customization layer
     <filename>docbook-jadetex-Letter.dsssl</filename>. The other
     formats (&html;) will still use the default stylesheets as we did
     not redefine them.</para>
   </step>
  </procedure>
  <para id="borges-style-custom-sect1-pa12">Once this is done, you can use the <xref
   linkend="compile-multiple"/> feature to generate at once the two
   different books <filename>Install-guide-A4.pdf</filename> and
   <filename>Install-guide-Letter.pdf</filename> respectively in
   <literal>A4</literal> and <literal>Letter</literal> paper
   formats.</para>
 </sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-parent-document: ("../../manuals/module/psgml-top.xml" "sect1")
End:
-->