Index: Makefile
===================================================================
--- Makefile	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ Makefile	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -6,7 +6,7 @@
 
 lfs:
-	xsltproc --xinclude --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
-	  -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
-	  index.xml
+	xsltproc --xinclude --nonet -stringparam profile.condition html \
+	-stringparam chunk.quietly $(CHUNK_QUIET)  -stringparam base.dir $(BASEDIR)/ \
+	stylesheets/lfs-chunked.xsl index.xml
 
 	if [ ! -e $(BASEDIR)/stylesheets ]; then \
@@ -21,7 +21,7 @@
 	  $(BASEDIR)/images
 	cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \
-	  index.html part1.html part2.html part3.html longindex.html
+	  *.html
 	cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \
-	  index.html part1.html part2.html part3.html longindex.html
+	  *.html
 
 	for filename in `find $(BASEDIR) -name "*.html"`; do \
@@ -33,6 +33,7 @@
 	  sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \
 	done;
+
 #
-# This is the old "pdf" target. The old "print" target below has been
+# This is the old "pdf" target. The old "print" target below has been   
 # renamed to "pdf" and will be used. This commented out previous_pdf
 # target can be removed eventually. It'll remain here for a bit for
@@ -47,6 +48,6 @@
 
 pdf:
-	xsltproc --xinclude --nonet --stringparam profile.condition print \
-		--output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index-pdf.xml
+	xsltproc --xinclude --nonet --stringparam profile.condition pdf \
+		--output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml
 	xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \
 		$(BASEDIR)/lfs-pdf.xml
@@ -56,7 +57,12 @@
 
 nochunks:
-	xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
+	xsltproc --xinclude --nonet -stringparam profile.condition html \
+	--output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
 	  stylesheets/lfs-nochunks.xsl index.xml
+
 	tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
+
+	sed -i -e "s@text/html@application/xhtml+xml@g"  \
+	  $(BASEDIR)/$(NOCHUNKS_OUTPUT)
 
 validate:
Index: stylesheets/lfs-chunked.xsl
===================================================================
--- stylesheets/lfs-chunked.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/lfs-chunked.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -25,5 +25,5 @@
     Voila! (Man I hope we can do this better in XSLT 2.0)  -->
 
-  <xsl:include href="http://docbook.sourceforge.net/release/xsl/1.67.2/xhtml/chunk-code.xsl"/>
+  <xsl:include href="lfs-chunked1.xsl"/>
 
     <!-- Including our others customized chunks templates -->
Index: stylesheets/lfs-chunked1.xsl
===================================================================
--- stylesheets/lfs-chunked1.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
+++ stylesheets/lfs-chunked1.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -0,0 +1,92 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="exsl"
+                version="1.0">
+
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.67.2/xhtml/profile-chunk-code.xsl"/> 
+
+  <xsl:key name="id" match="*" use="@xml:id"/>
+  
+
+  <xsl:template match="/">
+    <xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-content">
+      <xslo:apply-templates select="." mode="profile"/>
+    </xslo:variable>
+    <xslo:variable xmlns:xslo="http://www.w3.org/1999/XSL/Transform" name="profiled-nodes" 
+            select="exsl:node-set($profiled-content)"/>
+    <xsl:choose>
+      <xsl:when test="namespace-uri(*[1]) = 'http://docbook.org/docbook-ng'">
+        <xsl:variable name="nons">
+          <xsl:apply-templates select="$profiled-nodes" mode="stripNS"/>
+        </xsl:variable>
+        <xsl:apply-templates select="exsl:node-set($nons)"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="$rootid != ''">
+            <xsl:choose>
+              <xsl:when test="count($profiled-nodes//*[@id=$rootid]) = 0">
+                <xsl:message terminate="yes">
+                  <xsl:text>ID '</xsl:text>
+                  <xsl:value-of select="$rootid"/>
+                  <xsl:text>' not found in document.</xsl:text>
+                </xsl:message>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:if test="$collect.xref.targets = 'yes' or                         $collect.xref.targets = 'only'">
+                  <xsl:apply-templates select="key('id', $rootid)" mode="collect.targets"/>
+                </xsl:if>
+                <xsl:if test="$collect.xref.targets != 'only'">
+                  <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="process.root"/>
+                  <xsl:if test="$tex.math.in.alt != ''">
+                    <xsl:apply-templates select="$profiled-nodes//*[@id=$rootid]" mode="collect.tex.math"/>
+                  </xsl:if>
+                  <xsl:if test="$generate.manifest != 0">
+                    <xsl:call-template name="generate.manifest">
+                      <xsl:with-param name="node" select="key('id',$rootid)"/>
+                    </xsl:call-template>
+                  </xsl:if>
+                </xsl:if>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:if test="$collect.xref.targets = 'yes' or                     $collect.xref.targets = 'only'">
+              <xsl:apply-templates select="$profiled-nodes" mode="collect.targets"/>
+            </xsl:if>
+            <xsl:if test="$collect.xref.targets != 'only'">
+              <xsl:apply-templates select="$profiled-nodes" mode="process.root"/>
+              <xsl:if test="$tex.math.in.alt != ''">
+                <xsl:apply-templates select="$profiled-nodes" mode="collect.tex.math"/>
+              </xsl:if>
+              <xsl:if test="$generate.manifest != 0">
+                <xsl:call-template name="generate.manifest"/>
+              </xsl:if>
+            </xsl:if>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="*" mode="stripNS">
+    <xsl:choose>
+       <xsl:when test="namespace-uri(.) = 'http://docbook.org/docbook-ng'">
+         <xsl:element name="{local-name(.)}">
+           <xsl:copy-of select="@*"/>
+           <xsl:apply-templates mode="stripNS"/>
+         </xsl:element>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:copy>
+           <xsl:copy-of select="@*"/>
+           <xsl:apply-templates mode="stripNS"/>
+         </xsl:copy>
+       </xsl:otherwise>
+     </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
+
Index: stylesheets/lfs-chunked2.xsl
===================================================================
--- stylesheets/lfs-chunked2.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/lfs-chunked2.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -11,7 +11,12 @@
     <!-- Including our others customized elements templates -->
   <xsl:include href="xhtml/lfs-admon.xsl"/>
+  <xsl:include href="xhtml/lfs-sections.xsl"/>
   <xsl:include href="xhtml/lfs-mixed.xsl"/>
   <xsl:include href="xhtml/lfs-titles.xsl"/>
   <xsl:include href="xhtml/lfs-toc.xsl"/>
+  <xsl:include href="xhtml/lfs-xref.xsl"/>
+
+    <!-- This file contains our localization strings (for internationalization) -->
+  <xsl:param name="local.l10n.xml" select="document('lfs-l10n.xml')"/>
 
     <!-- The CSS Stylesheet -->
Index: stylesheets/lfs-l10n.xml
===================================================================
--- stylesheets/lfs-l10n.xml	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
+++ stylesheets/lfs-l10n.xml	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='US-ASCII'?>
+
+<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
+
+    <!-- Template to add more languages -->
+  <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
+          language="xx" english-language-name="xxxxx">
+
+    <l:gentext key="description" text=""/>
+    <l:gentext key="Libraries" text=""/>
+    <l:gentext key="Others" text=""/>
+    <l:gentext key="Packages" text=""/>
+    <l:gentext key="Programs" text=""/>
+    <l:gentext key="Scripts" text=""/>
+
+  </l:l10n>
+
+    <!-- English -->
+  <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
+          language="en" english-language-name="English">
+
+    <l:gentext key="description" text="description"/>
+    <l:gentext key="Libraries" text="Libraries"/>
+    <l:gentext key="Others" text="Others"/>
+    <l:gentext key="Packages" text="Packages"/>
+    <l:gentext key="Programs" text="Programs"/>
+    <l:gentext key="Scripts" text="Scripts"/>
+
+  </l:l10n>
+
+    <!-- Spanish -->
+  <l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"
+          language="es" english-language-name="Spanish">
+
+    <l:gentext key="description" text="descripci&#243;n"/>
+    <l:gentext key="Libraries" text="Librer&#237;as"/>
+    <l:gentext key="Others" text="Otros"/>
+    <l:gentext key="Packages" text="Paquetes"/>
+    <l:gentext key="Programs" text="Programas"/>
+    <l:gentext key="Scripts" text="Guiones"/>
+
+  </l:l10n>
+
+</l:i18n>
Index: stylesheets/lfs-nochunks.xsl
===================================================================
--- stylesheets/lfs-nochunks.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/lfs-nochunks.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -6,5 +6,5 @@
 
     <!-- We use XHTML -->
-  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.67.2/xhtml/docbook.xsl"/>
+  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.67.2/xhtml/profile-docbook.xsl"/>
 
   <!-- Fix encoding issues with default UTF-8 output of the xhtml stylesheet -->
@@ -15,10 +15,51 @@
   <xsl:include href="xhtml/lfs-index.xsl"/>
   <xsl:include href="xhtml/lfs-mixed.xsl"/>
-  <xsl:include href="xhtml/lfs-navigational.xsl"/>
+  <xsl:include href="xhtml/lfs-sections.xsl"/>
   <xsl:include href="xhtml/lfs-toc.xsl"/>
+  <xsl:include href="xhtml/lfs-xref.xsl"/>
+
+    <!-- This file contains our localization strings (for internationalization) -->
+  <xsl:param name="local.l10n.xml" select="document('lfs-l10n.xml')"/>
 
     <!-- Dropping some unwanted style attributes -->
   <xsl:param name="ulink.target" select="''"></xsl:param>
   <xsl:param name="css.decoration" select="0"></xsl:param>
+
+    <!-- To drop the remainig dot when title is empty (from lfs-titles.xsl)-->
+  <xsl:template name="sect2.titlepage">
+    <xsl:choose>
+      <xsl:when test="string-length(title) = 0"/>
+      <xsl:otherwise>
+        <div class="titlepage">
+          <xsl:if test="@id">
+            <a id="{@id}" name="{@id}"/>
+          </xsl:if>
+          <h3 class="{name(.)}">
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>. </xsl:text>
+            <xsl:value-of select="title"/>
+          </h3>
+        </div>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+    <!-- Added the role param for proper punctuation in xref calls
+            (from lfs-titles.xsl). -->
+  <xsl:template match="*" mode="insert.title.markup">
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="title"/>
+    <xsl:param name="role"/>
+    <xsl:choose>
+      <xsl:when test="$purpose = 'xref' and titleabbrev">
+        <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$title"/>
+        <xsl:value-of select="$role"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
 
     <!-- The CSS Stylesheet -->
@@ -174,4 +215,10 @@
 }
 
+/* itemizedlist */
+
+div.itemizedlist {
+  margin-left: 1em;
+}
+
 /* Indented blocks */
 p, ul, dl, code, blockquote {
Index: stylesheets/lfs-pdf.xsl
===================================================================
--- stylesheets/lfs-pdf.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/lfs-pdf.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -13,5 +13,10 @@
   <xsl:include href="pdf/lfs-pagesetup.xsl"/>
   <xsl:include href="pdf/lfs-sections.xsl"/>
+  <xsl:include href="pdf/lfs-admon.xsl"/>
   <xsl:include href="pdf/lfs-mixed.xsl"/>
+  <xsl:include href="pdf/lfs-xref.xsl"/>
+
+    <!-- This file contains our localization strings (for internationalization) -->
+  <xsl:param name="local.l10n.xml" select="document('lfs-l10n.xml')"/>
 
     <!-- Paper size required by the publisher -->
@@ -26,5 +31,5 @@
 
     <!-- Font size -->
-  <xsl:param name="body.font.master">10</xsl:param>
+  <xsl:param name="body.font.master">9</xsl:param>
   <xsl:param name="body.font.size">12pt</xsl:param>
 
Index: stylesheets/lfs.css
===================================================================
--- stylesheets/lfs.css	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/lfs.css	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -111,5 +111,5 @@
 }
 
-li.preface {
+li.preface, li.appendix {
   margin-left: 1em;
 }
@@ -240,4 +240,8 @@
 }
 
+.literal {
+  font-weight: normal;
+}
+
 pre.screen {
   color: #000;
@@ -286,9 +290,9 @@
 }
 
-div.book, div.preface, div.part, div.chapter, div.sect1, div.index {
+div.book, div.preface, div.part, div.chapter, div.sect1, div.appendix, div.index {
   padding-bottom: 0.5em;
 }
 
-div.preface h1, div.part h1, div.chapter h1, div.sect1 h1, div.index h1 {
+div.preface h1, div.part h1, div.chapter h1, div.sect1 h1, div.appendix h1, div.index h1 {
   background: #f5f6f7;
   border-bottom: .1em solid #dbddec;
Index: stylesheets/patcheslist.xsl
===================================================================
--- stylesheets/patcheslist.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/patcheslist.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -33,29 +33,35 @@
   <xsl:template match="//ulink">
     <xsl:if test="contains(@url, '.patch') and contains(@url, '&patches-root;')">
-      <xsl:text>  cp </xsl:text>
-      <xsl:text>/home/httpd/</xsl:text>
-      <xsl:value-of select="substring-before (substring-after ('&patches-root;', 'http://'), $links.directory)"/>
-      <xsl:text>downloads/</xsl:text>
-      <xsl:if test="contains (@url, '-')">
-        <xsl:variable name="cut" select="translate (@url, '0123456789', '2222222222')"/>
-        <xsl:choose>
-          <xsl:when test="contains ($cut, ',')">
-            <xsl:value-of select="substring-before (substring-after($cut, $links.directory), ',2')"/>
-          </xsl:when>
-          <xsl:otherwise>
+      <xsl:choose>
+        <xsl:when test="ancestor-or-self::*/@condition = 'pdf'"/>
+        <xsl:otherwise>
+          <xsl:text>  cp </xsl:text>
+          <xsl:text>/home/httpd/</xsl:text>
+          <xsl:value-of select="substring-before (substring-after ('&patches-root;', 'http://'), $links.directory)"/>
+          <xsl:text>downloads/</xsl:text>
+          <xsl:if test="contains (@url, '-')">
+            <xsl:variable name="cut" select="translate (@url, '0123456789', '2222222222')"/>
+            <xsl:variable name="links.directory2" select="translate ($links.directory, '0123456789', '2222222222')"/>
             <xsl:choose>
-              <xsl:when test="contains ($cut, '-src-2')">
-                <xsl:value-of select="substring-before (substring-after($cut, $links.directory), '-src-2')"/>
+              <xsl:when test="contains ($cut, ',')">
+                <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), ',2')"/>
               </xsl:when>
               <xsl:otherwise>
-                <xsl:value-of select="substring-before (substring-after($cut, $links.directory), '-2')"/>
+                <xsl:choose>
+                  <xsl:when test="contains ($cut, '-src-2')">
+                    <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-src-2')"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="substring-before (substring-after($cut, $links.directory2), '-2')"/>
+                  </xsl:otherwise>
+                </xsl:choose>
               </xsl:otherwise>
             </xsl:choose>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:if>
-      <xsl:text>/</xsl:text>
-      <xsl:value-of select="substring-after(@url, $links.directory)"/>
-      <xsl:text> . &#x0a;</xsl:text>
+          </xsl:if>
+          <xsl:text>/</xsl:text>
+          <xsl:value-of select="substring-after(@url, $links.directory)"/>
+          <xsl:text> . &#x0a;</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
   </xsl:template>
Index: stylesheets/pdf/lfs-admon.xsl
===================================================================
--- stylesheets/pdf/lfs-admon.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
+++ stylesheets/pdf/lfs-admon.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -0,0 +1,95 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+
+    <!-- Graphics in admonitions -->
+  <xsl:param name="admon.graphics" select="1"/>
+  <xsl:param name="admon.graphics.path"
+    select="'/usr/share/xml/docbook/xsl-stylesheets-current/images/'"/>
+
+    <!-- Admonition block properties -->
+  <xsl:template match="important|warning|caution">
+    <xsl:choose>
+      <xsl:when test="$admon.graphics != 0">
+        <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
+              space-before.maximum="0.8em" border-style="solid" border-width="1pt"
+              border-color="#500" background-color="#FFFFE6">
+        <xsl:call-template name="graphical.admonition"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="nongraphical.admonition"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="note|tip">
+    <xsl:choose>
+      <xsl:when test="$admon.graphics != 0">
+        <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
+              space-before.maximum="0.8em" border-style="solid" border-width="1pt"
+              border-color="#E0E0E0" background-color="#FFFFE6">
+        <xsl:call-template name="graphical.admonition"/>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="nongraphical.admonition"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+    <!-- Admonitions text properties -->
+  <xsl:attribute-set name="admonition.properties">
+    <xsl:attribute name="margin-right">6pt</xsl:attribute>
+  </xsl:attribute-set>
+
+    <!-- Adding left space to the graphics and color to the titles -->
+  <xsl:template name="graphical.admonition">
+    <xsl:variable name="id">
+      <xsl:call-template name="object.id"/>
+    </xsl:variable>
+    <xsl:variable name="graphic.width">
+     <xsl:apply-templates select="." mode="admon.graphic.width"/>
+    </xsl:variable>
+    <fo:block id="{$id}">
+      <fo:list-block provisional-distance-between-starts="{$graphic.width} + 18pt"
+              provisional-label-separation="18pt" xsl:use-attribute-sets="list.block.spacing">
+        <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block margin-left="4pt">
+                <fo:external-graphic width="auto" height="auto"
+                        content-width="{$graphic.width}" >
+                  <xsl:attribute name="src">
+                    <xsl:call-template name="admon.graphic"/>
+                  </xsl:attribute>
+                </fo:external-graphic>
+              </fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <xsl:if test="$admon.textlabel != 0 or title">
+                <fo:block xsl:use-attribute-sets="admonition.title.properties">
+                  <xsl:if test="ancestor-or-self::important">
+                    <xsl:attribute name="color">#500</xsl:attribute>
+                  </xsl:if>
+                  <xsl:if test="ancestor-or-self::warning">
+                    <xsl:attribute name="color">#500</xsl:attribute>
+                  </xsl:if>
+                  <xsl:if test="ancestor-or-self::caution">
+                    <xsl:attribute name="color">#500</xsl:attribute>
+                  </xsl:if>
+                  <xsl:apply-templates select="." mode="object.title.markup"/>
+                </fo:block>
+              </xsl:if>
+              <fo:block xsl:use-attribute-sets="admonition.properties">
+                <xsl:apply-templates/>
+              </fo:block>
+            </fo:list-item-body>
+        </fo:list-item>
+      </fo:list-block>
+    </fo:block>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: stylesheets/pdf/lfs-index.xsl
===================================================================
--- stylesheets/pdf/lfs-index.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/pdf/lfs-index.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -14,5 +14,7 @@
   <xsl:template match="index" mode="title.markup">
     <xsl:param name="allow-anchors" select="0"/>
-    <xsl:text>Index</xsl:text>
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key">Index</xsl:with-param>
+    </xsl:call-template>
   </xsl:template>
 
@@ -31,22 +33,32 @@
               <xsl:choose>
                 <xsl:when test="$divtitle = 'A'">
-                  <xsl:text>Packages</xsl:text>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'B'">
-                  <xsl:text>Programs</xsl:text>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'C'">
-                  <xsl:text>Libraries</xsl:text>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'D'">
-                  <xsl:text>Scripts</xsl:text>
-              </xsl:when>
-              <xsl:when test="$divtitle = 'E'">
-                  <xsl:text>Others</xsl:text>
-              </xsl:when>
-              <xsl:otherwise>
-                <xsl:value-of select="$divtitle"/>
-              </xsl:otherwise>
-            </xsl:choose>
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Packages</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:when test="$divtitle = 'B'">
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Programs</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:when test="$divtitle = 'C'">
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Libraries</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:when test="$divtitle = 'D'">
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Scripts</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:when test="$divtitle = 'E'">
+                  <xsl:call-template name="gentext">
+                    <xsl:with-param name="key">Others</xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="$divtitle"/>
+                </xsl:otherwise>
+              </xsl:choose>
             </xsl:with-param>
           </xsl:call-template>
Index: stylesheets/pdf/lfs-mixed.xsl
===================================================================
--- stylesheets/pdf/lfs-mixed.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/pdf/lfs-mixed.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -5,19 +5,93 @@
                 version="1.0">
 
-  
-    <!-- This is a hack and isn't correct semantically. The beginpage tags must
-      be placed in the XML source only to render the final PDF output, and must
-      be removed after.-->
+
+    <!-- This is a hack and isn't correct semantically. Theoretically, the beginpage 
+      tags should be placed in the XML source only to render the PDF output and 
+      should be removed after it. But there is no a better way and we need this.-->
   <xsl:template match="beginpage">
     <fo:block break-after="page"/>
   </xsl:template>
-
-    <!-- Split URLs -->
-  <xsl:template name="hyphenate-url">
+  
+    <!-- Allow forced line breaks inside paragraphs emulating literallayout. -->
+ <xsl:template match="para">
+    <xsl:choose>
+      <xsl:when test="./@remap='verbatim'">
+        <fo:block wrap-option="no-wrap"
+                    white-space-collapse="false"
+                    white-space-treatment="preserve"
+                    text-align="start"
+                    linefeed-treatment="preserve">
+          <xsl:call-template name="anchor"/>
+          <xsl:apply-templates/>
+        </fo:block>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-imports/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+    <!-- Show URLs in italic font -->
+  <xsl:template match="ulink" name="ulink">
+    <fo:inline font-style="italic">
+      <fo:basic-link xsl:use-attribute-sets="xref.properties">
+        <xsl:attribute name="external-destination">
+          <xsl:call-template name="fo-external-image">
+            <xsl:with-param name="filename" select="@url"/>
+          </xsl:call-template>
+        </xsl:attribute>
+        <xsl:choose>
+          <xsl:when test="count(child::node())=0">
+            <xsl:call-template name="hyphenate-url">
+              <xsl:with-param name="url" select="@url"/>
+            </xsl:call-template>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </fo:basic-link>
+    </fo:inline>
+    <xsl:if test="count(child::node()) != 0
+                  and string(.) != @url
+                  and $ulink.show != 0">
+      <!-- yes, show the URI -->
+      <xsl:choose>
+        <xsl:when test="$ulink.footnotes != 0 and not(ancestor::footnote)">
+          <xsl:text>&#xA0;</xsl:text>
+          <fo:footnote>
+            <xsl:call-template name="ulink.footnote.number"/>
+            <fo:footnote-body font-family="{$body.fontset}"
+                              font-size="{$footnote.font.size}">
+              <fo:block>
+                <xsl:call-template name="ulink.footnote.number"/>
+                <xsl:text> </xsl:text>
+                <fo:inline>
+                  <xsl:value-of select="@url"/>
+                </fo:inline>
+              </fo:block>
+            </fo:footnote-body>
+          </fo:footnote>
+        </xsl:when>
+        <xsl:otherwise>
+          <fo:inline hyphenate="false">
+            <xsl:text> [</xsl:text>
+            <xsl:call-template name="hyphenate-url">
+              <xsl:with-param name="url" select="@url"/>
+            </xsl:call-template>
+            <xsl:text>]</xsl:text>
+          </fo:inline>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+    <!-- Split URLs (obsolete, keeped as reference) -->
+  <!--<xsl:template name="hyphenate-url">
     <xsl:param name="url" select="''"/>
     <xsl:choose>
       <xsl:when test="ancestor::varlistentry">
         <xsl:choose>
-          <xsl:when test="string-length($url) > 88">
+          <xsl:when test="string-length($url) > 90">
             <xsl:value-of select="substring($url, 1, 50)"/>
             <xsl:param name="rest" select="substring($url, 51)"/>
@@ -32,5 +106,5 @@
       </xsl:when>
       <xsl:otherwise>
-        <xsl:value-of select="$url"/>
+        <xsl:value-of select="$url"/>-->
       <!--  <xsl:value-of select="substring-before($url, '//')"/>
         <xsl:text>// </xsl:text>
@@ -38,7 +112,7 @@
           <xsl:with-param name="url2" select="substring-after($url, '//')"/>
         </xsl:call-template>-->
-      </xsl:otherwise>
+     <!-- </xsl:otherwise>
     </xsl:choose>
-  </xsl:template>
+  </xsl:template>-->
 
   <!--<xsl:template name="split-url">
@@ -60,86 +134,4 @@
     <!-- Shade screen -->
   <xsl:param name="shade.verbatim" select="1"/>
-
-    <!-- Graphics in admonitions -->
-  <xsl:param name="admon.graphics" select="1"/>
-  <xsl:param name="admon.graphics.path"
-    select="'/usr/share/xml/docbook/xsl-stylesheets-1.67.2/images/'"/>
-
-    <!-- Admonition block properties -->
-  <xsl:template match="important|warning|caution">
-    <xsl:choose>
-      <xsl:when test="$admon.graphics != 0">
-        <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
-              space-before.maximum="0.8em" border-style="solid" border-width="1pt"
-              border-color="#500" background-color="#FFFFE6">
-        <xsl:call-template name="graphical.admonition"/>
-        </fo:block>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="nongraphical.admonition"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-
-  <xsl:template match="note|tip">
-    <xsl:choose>
-      <xsl:when test="$admon.graphics != 0">
-        <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
-              space-before.maximum="0.8em" border-style="solid" border-width="1pt"
-              border-color="#E0E0E0" background-color="#FFFFE6">
-        <xsl:call-template name="graphical.admonition"/>
-        </fo:block>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:call-template name="nongraphical.admonition"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:template>
-  
-    <!-- Admonitions text properties -->
-  <xsl:attribute-set name="admonition.properties">
-    <xsl:attribute name="margin-right">6pt</xsl:attribute>
-  </xsl:attribute-set>
-
-    <!-- Adding left space to the graphics and color to the titles -->
-  <xsl:template name="graphical.admonition">
-    <xsl:variable name="id">
-      <xsl:call-template name="object.id"/>
-    </xsl:variable>
-    <fo:block id="{$id}">
-      <fo:list-block xsl:use-attribute-sets="list.block.spacing">
-        <fo:list-item>
-            <fo:list-item-label end-indent="label-end()">
-              <fo:block margin-left="4pt">
-                <fo:external-graphic width="auto" height="auto">
-                  <xsl:attribute name="src">
-                    <xsl:call-template name="admon.graphic"/>
-                  </xsl:attribute>
-                </fo:external-graphic>
-              </fo:block>
-            </fo:list-item-label>
-            <fo:list-item-body start-indent="body-start()">
-              <xsl:if test="$admon.textlabel != 0 or title">
-                <fo:block xsl:use-attribute-sets="admonition.title.properties">
-                  <xsl:if test="ancestor-or-self::important">
-                    <xsl:attribute name="color">#500</xsl:attribute>
-                  </xsl:if>
-                  <xsl:if test="ancestor-or-self::warning">
-                    <xsl:attribute name="color">#500</xsl:attribute>
-                  </xsl:if>
-                  <xsl:if test="ancestor-or-self::caution">
-                    <xsl:attribute name="color">#500</xsl:attribute>
-                  </xsl:if>
-                  <xsl:apply-templates select="." mode="object.title.markup"/>
-                </fo:block>
-              </xsl:if>
-              <fo:block xsl:use-attribute-sets="admonition.properties">
-                <xsl:apply-templates/>
-              </fo:block>
-            </fo:list-item-body>
-        </fo:list-item>
-      </fo:list-block>
-    </fo:block>
-  </xsl:template>
 
     <!-- How is rendered by default a variablelist -->
@@ -178,3 +170,78 @@
   </xsl:template>
 
+    <!-- Presentation of literal tag -->
+  <xsl:template match="literal">
+    <fo:inline  font-weight="normal">
+      <xsl:call-template name="inline.monoseq"/>
+    </fo:inline>
+  </xsl:template>
+
+    <!-- Left alingnament for itemizedlist -->
+  <xsl:template match="itemizedlist">
+    <xsl:variable name="id">
+      <xsl:call-template name="object.id"/>
+    </xsl:variable>
+    <xsl:variable name="label-width">
+      <xsl:call-template name="dbfo-attribute">
+        <xsl:with-param name="pis"
+                        select="processing-instruction('dbfo')"/>
+        <xsl:with-param name="attribute" select="'label-width'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    <xsl:if test="title">
+      <xsl:apply-templates select="title" mode="list.title.mode"/>
+    </xsl:if>
+    <!-- Preserve order of PIs and comments -->
+    <xsl:apply-templates
+        select="*[not(self::listitem
+                  or self::title
+                  or self::titleabbrev)]
+                |comment()[not(preceding-sibling::listitem)]
+                |processing-instruction()[not(preceding-sibling::listitem)]"/>
+    <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing"
+                  provisional-label-separation="0.2em" text-align="left">
+      <xsl:attribute name="provisional-distance-between-starts">
+        <xsl:choose>
+          <xsl:when test="$label-width != ''">
+            <xsl:value-of select="$label-width"/>
+          </xsl:when>
+          <xsl:otherwise>1.5em</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:apply-templates
+            select="listitem
+                    |comment()[preceding-sibling::listitem]
+                    |processing-instruction()[preceding-sibling::listitem]"/>
+    </fo:list-block>
+  </xsl:template>
+
+    <!-- Addibg a bullet, and left alignament, for packages and paches list. -->
+
+<xsl:template match="varlistentry" mode="vl.as.blocks">
+  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+  <xsl:choose>
+    <xsl:when test="ancestor::variablelist/@role = 'materials'">
+      <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
+          keep-together.within-column="always"
+          keep-with-next.within-column="always" text-align="left">
+        <xsl:text>&#x2022;   </xsl:text>
+        <xsl:apply-templates select="term"/>
+      </fo:block>
+      <fo:block margin-left="0.1in" text-align="left">
+        <xsl:apply-templates select="listitem"/>
+      </fo:block>
+    </xsl:when>
+    <xsl:otherwise>
+      <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
+          keep-together.within-column="always"
+          keep-with-next.within-column="always">
+        <xsl:apply-templates select="term"/>
+      </fo:block>
+      <fo:block margin-left="0.25in">
+        <xsl:apply-templates select="listitem"/>
+      </fo:block>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 </xsl:stylesheet>
Index: stylesheets/pdf/lfs-pagesetup.xsl
===================================================================
--- stylesheets/pdf/lfs-pagesetup.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/pdf/lfs-pagesetup.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -63,4 +63,15 @@
   </xsl:template>
 
+    <!-- Font size for chapter title. -->
+  <xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
+    <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" 
+            xsl:use-attribute-sets="chapter.titlepage.recto.style" 
+            font-size="21pt" font-weight="bold" text-align="left">
+      <xsl:call-template name="component.title">
+        <xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
+      </xsl:call-template>
+    </fo:block>
+  </xsl:template>
+
     <!-- Margins -->
   <xsl:param name="page.margin.inner">0.5in</xsl:param>
Index: stylesheets/pdf/lfs-xref.xsl
===================================================================
--- stylesheets/pdf/lfs-xref.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
+++ stylesheets/pdf/lfs-xref.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -0,0 +1,283 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fo="http://www.w3.org/1999/XSL/Format"
+                version="1.0">
+
+     <!-- Making a proper punctuation in xref (only for English language).-->
+  <xsl:template match="xref" name="xref">
+    <xsl:variable name="targets" select="key('id',@linkend)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+    <xsl:variable name="refelem" select="local-name($target)"/>
+    <xsl:variable name="role" select="@role"/>
+    <xsl:call-template name="check.id.unique">
+      <xsl:with-param name="linkend" select="@linkend"/>
+    </xsl:call-template>
+    <xsl:choose>
+      <xsl:when test="$refelem=''">
+        <xsl:message>
+          <xsl:text>XRef to nonexistent id: </xsl:text>
+          <xsl:value-of select="@linkend"/>
+        </xsl:message>
+        <xsl:text>???</xsl:text>
+      </xsl:when>
+      <xsl:when test="$target/@xreflabel">
+        <fo:basic-link internal-destination="{@linkend}"
+                      xsl:use-attribute-sets="xref.properties">
+          <xsl:call-template name="xref.xreflabel">
+            <xsl:with-param name="target" select="$target"/>
+          </xsl:call-template>
+        </fo:basic-link>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:basic-link internal-destination="{@linkend}"
+                      xsl:use-attribute-sets="xref.properties">
+          <xsl:apply-templates select="$target" mode="xref-to">
+            <xsl:with-param name="referrer" select="."/>
+            <xsl:with-param name="role" select="$role"/>
+            <xsl:with-param name="xrefstyle">
+              <xsl:value-of select="@xrefstyle"/>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </fo:basic-link>
+      </xsl:otherwise>
+    </xsl:choose>
+    <!-- Add standard page reference? -->
+    <xsl:if test="not(starts-with(normalize-space(@xrefstyle), 'select:') != ''
+                  and (contains(@xrefstyle, 'page')
+                      or contains(@xrefstyle, 'Page')))
+                  and ( $insert.xref.page.number = 'yes'
+        or $insert.xref.page.number = '1')
+                  or local-name($target) = 'para'">
+      <fo:basic-link internal-destination="{@linkend}"
+                    xsl:use-attribute-sets="xref.properties">
+        <xsl:apply-templates select="$target" mode="page.citation">
+          <xsl:with-param name="id" select="@linkend"/>
+        </xsl:apply-templates>
+      </fo:basic-link>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="section|simplesect|sect1|sect2|sect3|sect4|sect5
+                      |refsect1|refsect2|refsect3|refsection" mode="xref-to">
+    <xsl:param name="referrer"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="role"/>
+    <xsl:apply-templates select="." mode="object.xref.markup">
+      <xsl:with-param name="purpose" select="'xref'"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+      <xsl:with-param name="role" select="$role"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+  <xsl:template match="*" mode="object.xref.markup">
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="referrer"/>
+    <xsl:param name="role"/>
+    <xsl:variable name="template">
+      <xsl:choose>
+        <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:')">
+          <xsl:call-template name="make.gentext.template">
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="starts-with(normalize-space($xrefstyle), 'template:')">
+          <xsl:value-of select="substring-after(normalize-space($xrefstyle), 'template:')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="." mode="object.xref.template">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="$template = ''">
+      <xsl:message>
+        <xsl:text>object.xref.markup: empty xref template</xsl:text>
+        <xsl:text> for linkend="</xsl:text>
+        <xsl:value-of select="@id"/>
+        <xsl:text>" and @xrefstyle="</xsl:text>
+        <xsl:value-of select="$xrefstyle"/>
+        <xsl:text>"</xsl:text>
+      </xsl:message>
+    </xsl:if>
+    <xsl:call-template name="substitute-markup">
+      <xsl:with-param name="purpose" select="$purpose"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+      <xsl:with-param name="template" select="$template"/>
+      <xsl:with-param name="role" select="$role"/>
+    </xsl:call-template>
+  </xsl:template>
+
+  <xsl:template name="substitute-markup">
+    <xsl:param name="template" select="''"/>
+    <xsl:param name="allow-anchors" select="'0'"/>
+    <xsl:param name="title" select="''"/>
+    <xsl:param name="subtitle" select="''"/>
+    <xsl:param name="label" select="''"/>
+    <xsl:param name="pagenumber" select="''"/>
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="referrer"/>
+    <xsl:param name="role"/>
+    <xsl:choose>
+      <xsl:when test="contains($template, '%')">
+        <xsl:value-of select="substring-before($template, '%')"/>
+        <xsl:variable name="candidate"
+              select="substring(substring-after($template, '%'), 1, 1)"/>
+        <xsl:choose>
+          <xsl:when test="$candidate = 't'">
+            <xsl:apply-templates select="." mode="insert.title.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="title">
+                <xsl:choose>
+                  <xsl:when test="$title != ''">
+                    <xsl:copy-of select="$title"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="title.markup">
+                      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                    </xsl:apply-templates>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 's'">
+            <xsl:apply-templates select="." mode="insert.subtitle.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="subtitle">
+                <xsl:choose>
+                  <xsl:when test="$subtitle != ''">
+                    <xsl:copy-of select="$subtitle"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="subtitle.markup">
+                      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                    </xsl:apply-templates>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'n'">
+            <xsl:apply-templates select="." mode="insert.label.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="label">
+                <xsl:choose>
+                  <xsl:when test="$label != ''">
+                    <xsl:copy-of select="$label"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="label.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'p'">
+            <xsl:apply-templates select="." mode="insert.pagenumber.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="pagenumber">
+                <xsl:choose>
+                  <xsl:when test="$pagenumber != ''">
+                    <xsl:copy-of select="$pagenumber"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="pagenumber.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'd'">
+            <xsl:apply-templates select="." mode="insert.direction.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="direction">
+                <xsl:choose>
+                  <xsl:when test="$referrer">
+                    <xsl:variable name="referent-is-below">
+                      <xsl:for-each select="preceding::xref">
+                        <xsl:if test="generate-id(.) = generate-id($referrer)">1</xsl:if>
+                      </xsl:for-each>
+                    </xsl:variable>
+                    <xsl:choose>
+                      <xsl:when test="$referent-is-below = ''">
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key" select="'above'"/>
+                        </xsl:call-template>
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key" select="'below'"/>
+                        </xsl:call-template>
+                      </xsl:otherwise>
+                    </xsl:choose>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:message>Attempt to use %d in gentext with no referrer!</xsl:message>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = '%' ">
+            <xsl:text>%</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>%</xsl:text><xsl:value-of select="$candidate"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        <!-- recurse with the rest of the template string -->
+        <xsl:variable name="rest"
+              select="substring($template,
+              string-length(substring-before($template, '%'))+3)"/>
+        <xsl:call-template name="substitute-markup">
+          <xsl:with-param name="template" select="$rest"/>
+          <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+          <xsl:with-param name="title" select="$title"/>
+          <xsl:with-param name="subtitle" select="$subtitle"/>
+          <xsl:with-param name="label" select="$label"/>
+          <xsl:with-param name="pagenumber" select="$pagenumber"/>
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+          <xsl:with-param name="role" select="$role"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$template"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="*" mode="insert.title.markup">
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="title"/>
+    <xsl:param name="role"/>
+    <xsl:choose>
+      <xsl:when test="$purpose = 'xref' and titleabbrev">
+        <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$title"/>
+        <xsl:value-of select="$role"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: stylesheets/xhtml/lfs-admon.xsl
===================================================================
--- stylesheets/xhtml/lfs-admon.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/xhtml/lfs-admon.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -22,7 +22,12 @@
       </xsl:choose>
     </xsl:variable>
+    <xsl:variable name="alt">
+      <xsl:call-template name="gentext">
+        <xsl:with-param name="key" select="$admon.type"/>
+      </xsl:call-template>
+    </xsl:variable>
     <div class="{name(.)}">
       <div class ="admonhead">
-        <img alt="[{$admon.type}]">
+        <img alt="[{$alt}]">
           <xsl:attribute name="src">
             <xsl:call-template name="admon.graphic"/>
@@ -30,9 +35,5 @@
         </img>
         <h3 class="admontitle">
-          <xsl:value-of select="$admon.type"/>
-          <xsl:if test="title">
-            <xsl:text>: </xsl:text>
-            <xsl:value-of select="title"/>
-          </xsl:if>
+          <xsl:apply-templates select="." mode="object.title.markup"/>
         </h3>
       </div>
Index: stylesheets/xhtml/lfs-index.xsl
===================================================================
--- stylesheets/xhtml/lfs-index.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/xhtml/lfs-index.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -17,14 +17,18 @@
 
     <!--Title-->
-  <xsl:param name="index-title">Index of packages and important installed files</xsl:param>
+  <xsl:param name="index-title">Index</xsl:param>
   
   <xsl:template match="index" mode="title.markup">
-    <xsl:value-of select="$index-title"/>
-  </xsl:template>
-  
+    <xsl:call-template name="gentext">
+      <xsl:with-param name="key" select="$index-title"/>
+    </xsl:call-template>
+  </xsl:template>
+
   <xsl:template name="index.titlepage">
     <div class="titlepage">
       <h1 class="index">
-        <xsl:value-of select="$index-title"/>
+        <xsl:call-template name="gentext">
+          <xsl:with-param name="key" select="$index-title"/>
+        </xsl:call-template>
       </h1>
     </div>
@@ -43,17 +47,27 @@
             <xsl:choose>
               <xsl:when test="$divtitle = 'A'">
-                <xsl:text>Packages</xsl:text>
+                <xsl:call-template name="gentext">
+                  <xsl:with-param name="key">Packages</xsl:with-param>
+                </xsl:call-template>
              </xsl:when>
              <xsl:when test="$divtitle = 'B'">
-                <xsl:text>Programs</xsl:text>
+                <xsl:call-template name="gentext">
+                  <xsl:with-param name="key">Programs</xsl:with-param>
+                </xsl:call-template>
              </xsl:when>
              <xsl:when test="$divtitle = 'C'">
-                <xsl:text>Libraries</xsl:text>
+                <xsl:call-template name="gentext">
+                  <xsl:with-param name="key">Libraries</xsl:with-param>
+                </xsl:call-template>
              </xsl:when>
              <xsl:when test="$divtitle = 'D'">
-                <xsl:text>Scripts</xsl:text>
+                <xsl:call-template name="gentext">
+                  <xsl:with-param name="key">Scripts</xsl:with-param>
+                </xsl:call-template>
              </xsl:when>
               <xsl:when test="$divtitle = 'E'">
-                  <xsl:text>Others</xsl:text>
+                <xsl:call-template name="gentext">
+                  <xsl:with-param name="key">Others</xsl:with-param>
+                </xsl:call-template>
               </xsl:when>
              <xsl:otherwise>
@@ -163,5 +177,7 @@
             </xsl:call-template>
           </xsl:attribute>
-          <xsl:text>description</xsl:text>
+          <xsl:call-template name="gentext">
+            <xsl:with-param name="key">description</xsl:with-param>
+          </xsl:call-template>
         </a>
       </xsl:when>
Index: stylesheets/xhtml/lfs-mixed.xsl
===================================================================
--- stylesheets/xhtml/lfs-mixed.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/xhtml/lfs-mixed.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -10,7 +10,5 @@
       <xsl:when test="child::* = userinput">
         <pre class="userinput">
-          <kbd class="command">
-            <xsl:value-of select="."/>
-          </kbd>
+            <xsl:apply-templates/>
         </pre>
       </xsl:when>
@@ -22,4 +20,18 @@
     </xsl:choose>
   </xsl:template>
+  
+  <xsl:template match="userinput">
+    <xsl:choose>
+      <xsl:when test="ancestor::screen">
+        <kbd class="command">
+          <xsl:apply-templates/>
+        </kbd>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:apply-imports/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
   
   <!-- variablelist -->
@@ -61,47 +73,106 @@
   </xsl:template>
 
-   <!-- Sect1 attributes -->
-  <xsl:template match="sect1">
-    <div>
-      <xsl:choose>
-        <xsl:when test="@role">
-          <xsl:attribute name="class">
-            <xsl:value-of select="@role"/>
+    <!-- External URLs in italic font -->
+  <xsl:template match="ulink" name="ulink">
+    <a>
+      <xsl:if test="@id">
+        <xsl:attribute name="id">
+          <xsl:value-of select="@id"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
+       <i>
+        <xsl:choose>
+          <xsl:when test="count(child::node())=0">
+            <xsl:value-of select="@url"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </i>
+    </a>
+  </xsl:template>
+  
+    <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
+      isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
+  <xsl:template name="inline.monoseq">
+    <xsl:param name="content">
+      <xsl:call-template name="anchor"/>
+      <xsl:call-template name="simple.xlink">
+        <xsl:with-param name="content">
+          <xsl:apply-templates/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:param>
+    <tt class="{local-name(.)}">
+      <xsl:if test="@dir">
+        <xsl:attribute name="dir">
+          <xsl:value-of select="@dir"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:copy-of select="$content"/>
+    </tt>
+  </xsl:template>
+  
+  <xsl:template name="inline.boldmonoseq">
+    <xsl:param name="content">
+      <xsl:call-template name="anchor"/>
+      <xsl:call-template name="simple.xlink">
+        <xsl:with-param name="content">
+          <xsl:apply-templates/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:param>
+    <!-- don't put <strong> inside figure, example, or table titles -->
+    <!-- or other titles that may already be represented with <strong>'s. -->
+    <xsl:choose>
+      <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure' 
+              or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
+        <tt class="{local-name(.)}">
+          <xsl:if test="@dir">
+            <xsl:attribute name="dir">
+              <xsl:value-of select="@dir"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:copy-of select="$content"/>
+        </tt>
+      </xsl:when>
+      <xsl:otherwise>
+        <strong class="{local-name(.)}">
+          <tt>
+            <xsl:if test="@dir">
+              <xsl:attribute name="dir">
+                <xsl:value-of select="@dir"/>
+              </xsl:attribute>
+            </xsl:if>
+            <xsl:copy-of select="$content"/>
+          </tt>
+        </strong>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="inline.italicmonoseq">
+    <xsl:param name="content">
+      <xsl:call-template name="anchor"/>
+      <xsl:call-template name="simple.xlink">
+        <xsl:with-param name="content">
+          <xsl:apply-templates/>
+        </xsl:with-param>
+      </xsl:call-template>
+    </xsl:param>
+    <em class="{local-name(.)}">
+      <tt>
+        <xsl:if test="@dir">
+          <xsl:attribute name="dir">
+            <xsl:value-of select="@dir"/>
           </xsl:attribute>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:attribute name="class">
-            <xsl:value-of select="name(.)"/>
-          </xsl:attribute>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:call-template name="language.attribute"/>
-      <xsl:call-template name="sect1.titlepage"/>
-      <xsl:apply-templates/>
-      <xsl:call-template name="process.chunk.footnotes"/>
-    </div>
+        </xsl:if>
+        <xsl:copy-of select="$content"/>
+      </tt>
+    </em>
   </xsl:template>
 
-    <!-- Sect2 attributes -->
-  <xsl:template match="sect2">
-    <div>
-      <xsl:choose>
-        <xsl:when test="@role">
-          <xsl:attribute name="class">
-            <xsl:value-of select="@role"/>
-          </xsl:attribute>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:attribute name="class">
-            <xsl:value-of select="name(.)"/>
-          </xsl:attribute>
-        </xsl:otherwise>
-      </xsl:choose>
-      <xsl:call-template name="language.attribute"/>
-      <xsl:call-template name="sect2.titlepage"/>
-      <xsl:apply-templates/>
-      <xsl:call-template name="process.chunk.footnotes"/>
-    </div>
-  </xsl:template>
 
 </xsl:stylesheet>
Index: stylesheets/xhtml/lfs-navigational.xsl
===================================================================
--- stylesheets/xhtml/lfs-navigational.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/xhtml/lfs-navigational.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -69,5 +69,14 @@
                 </xsl:attribute>
                 <xsl:attribute name="title">
-                  <xsl:value-of select="$next/title"/>
+                  <xsl:choose>
+                    <xsl:when test="local-name($next)='index'">
+                      <xsl:call-template name="gentext">
+                        <xsl:with-param name="key">Index</xsl:with-param>
+                      </xsl:call-template>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:value-of select="$next/title"/>
+                    </xsl:otherwise>
+                  </xsl:choose>
                 </xsl:attribute>
                 <xsl:call-template name="navig.content">
@@ -76,5 +85,14 @@
               </a>
               <p>
-                <xsl:value-of select="$next/title"/>
+                <xsl:choose>
+                  <xsl:when test="local-name($next)='index'">
+                    <xsl:call-template name="gentext">
+                      <xsl:with-param name="key">Index</xsl:with-param>
+                    </xsl:call-template>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="$next/title"/>
+                  </xsl:otherwise>
+                </xsl:choose>
               </p>
             </li>
@@ -161,5 +179,14 @@
                 </xsl:attribute>
                 <xsl:attribute name="title">
-                  <xsl:value-of select="$next/title"/>
+                  <xsl:choose>
+                    <xsl:when test="local-name($next)='index'">
+                      <xsl:call-template name="gentext">
+                        <xsl:with-param name="key">Index</xsl:with-param>
+                      </xsl:call-template>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <xsl:value-of select="$next/title"/>
+                    </xsl:otherwise>
+                  </xsl:choose>
                 </xsl:attribute>
                 <xsl:call-template name="navig.content">
@@ -168,5 +195,14 @@
               </a>
               <p>
-                <xsl:value-of select="$next/title"/>
+                <xsl:choose>
+                  <xsl:when test="local-name($next)='index'">
+                    <xsl:call-template name="gentext">
+                      <xsl:with-param name="key">Index</xsl:with-param>
+                    </xsl:call-template>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="$next/title"/>
+                  </xsl:otherwise>
+                </xsl:choose>
               </p>
             </li>
Index: stylesheets/xhtml/lfs-sections.xsl
===================================================================
--- stylesheets/xhtml/lfs-sections.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
+++ stylesheets/xhtml/lfs-sections.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+
+   <!-- Sect1 attributes -->
+  <xsl:template match="sect1">
+    <div>
+      <xsl:choose>
+        <xsl:when test="@role">
+          <xsl:attribute name="class">
+            <xsl:value-of select="@role"/>
+          </xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="class">
+            <xsl:value-of select="name(.)"/>
+          </xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:call-template name="language.attribute"/>
+      <xsl:call-template name="sect1.titlepage"/>
+      <xsl:apply-templates/>
+      <xsl:call-template name="process.chunk.footnotes"/>
+    </div>
+  </xsl:template>
+
+    <!-- Sect2 attributes -->
+  <xsl:template match="sect2">
+    <div>
+      <xsl:choose>
+        <xsl:when test="@role">
+          <xsl:attribute name="class">
+            <xsl:value-of select="@role"/>
+          </xsl:attribute>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:attribute name="class">
+            <xsl:value-of select="name(.)"/>
+          </xsl:attribute>
+        </xsl:otherwise>
+      </xsl:choose>
+      <xsl:call-template name="language.attribute"/>
+      <xsl:call-template name="sect2.titlepage"/>
+      <xsl:apply-templates/>
+      <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 -->
+  <xsl:template match="sect2|sect3|sect4|sect5" mode="label.markup">
+    <xsl:if test="string-length(title) > 0">
+      <!-- label the parent -->
+      <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:choose>
+        <xsl:when test="@label">
+          <xsl:value-of select="@label"/>
+        </xsl:when>
+        <xsl:when test="$section.autolabel != 0">
+          <xsl:choose>
+            <xsl:when test="local-name(.) = 'sect2'">
+              <xsl:choose>
+                <!-- If the first sect2 isn't numbered, renumber the remainig sections -->
+                <xsl:when test="string-length(../sect2[1]/title) = 0">
+                  <xsl:variable name="totalsect2">
+                    <xsl:number count="sect2"/>
+                  </xsl:variable>
+                  <xsl:number value="$totalsect2 - 1"/>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:number count="sect2"/>
+                </xsl:otherwise>
+              </xsl:choose>
+            </xsl:when>
+            <xsl:when test="local-name(.) = 'sect3'">
+              <xsl:number count="sect3"/>
+            </xsl:when>
+            <xsl:when test="local-name(.) = 'sect4'">
+              <xsl:number count="sect4"/>
+            </xsl:when>
+            <xsl:when test="local-name(.) = 'sect5'">
+              <xsl:number count="sect5"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:message>label.markup: this can't happen!</xsl:message>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:if>
+  </xsl:template>
+
+</xsl:stylesheet>
Index: stylesheets/xhtml/lfs-titles.xsl
===================================================================
--- stylesheets/xhtml/lfs-titles.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/xhtml/lfs-titles.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -8,4 +8,6 @@
     <div class="titlepage">
       <h1 class="{name(.)}">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
         <xsl:value-of select="title"/>
       </h1>
@@ -16,4 +18,6 @@
     <div class="titlepage">
       <h1 class="{name(.)}">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
         <xsl:value-of select="title"/>
       </h1>
@@ -24,4 +28,14 @@
     <div class="titlepage">
       <h1 class="{name(.)}">
+        <xsl:value-of select="title"/>
+      </h1>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="appendix.titlepage">
+    <div class="titlepage">
+      <h1 class="{name(.)}">
+        <xsl:apply-templates select="." mode="label.markup"/>
+        <xsl:text>. </xsl:text>
         <xsl:value-of select="title"/>
       </h1>
@@ -38,4 +52,6 @@
           </xsl:if>
           <h2 class="{name(.)}">
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>. </xsl:text>
             <xsl:value-of select="title"/>
           </h2>
@@ -45,4 +61,6 @@
         <div class="titlepage">
           <h1 class="{name(.)}">
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>. </xsl:text>
             <xsl:value-of select="title"/>
           </h1>
@@ -61,4 +79,6 @@
           </xsl:if>
           <h2 class="{name(.)}">
+            <xsl:apply-templates select="." mode="label.markup"/>
+            <xsl:text>. </xsl:text>
             <xsl:value-of select="title"/>
           </h2>
@@ -76,3 +96,20 @@
   </xsl:template>
 
+    <!-- Added the role param for proper punctuation in xref calls. -->
+  <xsl:template match="*" mode="insert.title.markup">
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="title"/>
+    <xsl:param name="role"/>
+    <xsl:choose>
+      <xsl:when test="$purpose = 'xref' and titleabbrev">
+        <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:copy-of select="$title"/>
+        <xsl:value-of select="$role"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
 </xsl:stylesheet>
Index: stylesheets/xhtml/lfs-toc.xsl
===================================================================
--- stylesheets/xhtml/lfs-toc.xsl	(revision 0c81bec3de4e48745f5c906a373625e2d5330e8f)
+++ stylesheets/xhtml/lfs-toc.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -7,5 +7,5 @@
     <!-- General settings -->
   <xsl:param name="generate.toc">
-    appendix  toc
+    appendix  nop
     book      toc,title,figure,table,example,equation
     chapter   nop
@@ -94,4 +94,21 @@
         </a>
       </xsl:when>
+      <xsl:when test="local-name(.) = 'appendix'">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="context" select="$toc-context"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:variable name="label">
+            <xsl:apply-templates select="." mode="label.markup"/>
+          </xsl:variable>
+          <xsl:copy-of select="$label"/>
+          <xsl:if test="$label != ''">
+            <xsl:value-of select="$autotoc.label.separator"/>
+          </xsl:if>
+          <xsl:apply-templates select="." mode="titleabbrev.markup"/>
+        </a>
+      </xsl:when>
       <xsl:when test="local-name(.) = 'chapter' or local-name(.) = 'preface'">
         <h4>
Index: stylesheets/xhtml/lfs-xref.xsl
===================================================================
--- stylesheets/xhtml/lfs-xref.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
+++ stylesheets/xhtml/lfs-xref.xsl	(revision a9fde34e3d97903dbc337e46a7e7e5d28844264d)
@@ -0,0 +1,270 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://www.w3.org/1999/xhtml"
+                version="1.0">
+
+     <!-- Making a proper punctuation in xref (only for English language).-->
+  <xsl:template match="xref" name="xref">
+    <xsl:variable name="targets" select="key('id',@linkend)"/>
+    <xsl:variable name="target" select="$targets[1]"/>
+    <xsl:variable name="refelem" select="local-name($target)"/>
+    <xsl:variable name="role" select="@role"/>
+    <xsl:call-template name="check.id.unique">
+      <xsl:with-param name="linkend" select="@linkend"/>
+    </xsl:call-template>
+    <xsl:call-template name="anchor"/>
+    <xsl:choose>
+      <xsl:when test="count($target) = 0">
+        <xsl:message>
+          <xsl:text>XRef to nonexistent id: </xsl:text>
+          <xsl:value-of select="@linkend"/>
+        </xsl:message>
+        <xsl:text>???</xsl:text>
+      </xsl:when>
+      <xsl:when test="$target/@xreflabel">
+        <a>
+          <xsl:attribute name="href">
+            <xsl:call-template name="href.target">
+              <xsl:with-param name="object" select="$target"/>
+            </xsl:call-template>
+          </xsl:attribute>
+          <xsl:call-template name="xref.xreflabel">
+            <xsl:with-param name="target" select="$target"/>
+          </xsl:call-template>
+        </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="href">
+          <xsl:call-template name="href.target">
+            <xsl:with-param name="object" select="$target"/>
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
+        <a href="{$href}">
+          <xsl:if test="$target/title or $target/*/title">
+            <xsl:attribute name="title">
+              <xsl:apply-templates select="$target" mode="xref-title"/>
+            </xsl:attribute>
+          </xsl:if>
+          <xsl:apply-templates select="$target" mode="xref-to">
+            <xsl:with-param name="referrer" select="."/>
+            <xsl:with-param name="role" select="$role"/>
+            <xsl:with-param name="xrefstyle">
+              <xsl:value-of select="@xrefstyle"/>
+            </xsl:with-param>
+          </xsl:apply-templates>
+        </a>
+        <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="section|simplesect|sect1|sect2|sect3|sect4|sect5|refsect1
+          |refsect2|refsect3|refsection" mode="xref-to">
+    <xsl:param name="referrer"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="role"/>
+    <xsl:apply-templates select="." mode="object.xref.markup">
+      <xsl:with-param name="purpose" select="'xref'"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+      <xsl:with-param name="role" select="$role"/>
+    </xsl:apply-templates>
+  </xsl:template>
+
+
+  <xsl:template match="*" mode="object.xref.markup">
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="referrer"/>
+    <xsl:param name="role"/>
+    <xsl:variable name="template">
+      <xsl:choose>
+        <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:')">
+          <xsl:call-template name="make.gentext.template">
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+          </xsl:call-template>
+        </xsl:when>
+        <xsl:when test="starts-with(normalize-space($xrefstyle), 'template:')">
+          <xsl:value-of select="substring-after(normalize-space($xrefstyle), 'template:')"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:apply-templates select="." mode="object.xref.template">
+            <xsl:with-param name="purpose" select="$purpose"/>
+            <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+            <xsl:with-param name="referrer" select="$referrer"/>
+          </xsl:apply-templates>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="$template = ''">
+      <xsl:message>
+        <xsl:text>object.xref.markup: empty xref template</xsl:text>
+        <xsl:text> for linkend="</xsl:text>
+        <xsl:value-of select="@id"/>
+        <xsl:text>" and @xrefstyle="</xsl:text>
+        <xsl:value-of select="$xrefstyle"/>
+        <xsl:text>"</xsl:text>
+      </xsl:message>
+    </xsl:if>
+    <xsl:call-template name="substitute-markup">
+      <xsl:with-param name="purpose" select="$purpose"/>
+      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+      <xsl:with-param name="referrer" select="$referrer"/>
+      <xsl:with-param name="template" select="$template"/>
+      <xsl:with-param name="role" select="$role"/>
+    </xsl:call-template>
+  </xsl:template>
+  
+  <xsl:template name="substitute-markup">
+    <xsl:param name="template" select="''"/>
+    <xsl:param name="allow-anchors" select="'0'"/>
+    <xsl:param name="title" select="''"/>
+    <xsl:param name="subtitle" select="''"/>
+    <xsl:param name="label" select="''"/>
+    <xsl:param name="pagenumber" select="''"/>
+    <xsl:param name="purpose"/>
+    <xsl:param name="xrefstyle"/>
+    <xsl:param name="referrer"/>
+    <xsl:param name="role"/>
+    <xsl:choose>
+      <xsl:when test="contains($template, '%')">
+        <xsl:value-of select="substring-before($template, '%')"/>
+        <xsl:variable name="candidate"
+              select="substring(substring-after($template, '%'), 1, 1)"/>
+        <xsl:choose>
+          <xsl:when test="$candidate = 't'">
+            <xsl:apply-templates select="." mode="insert.title.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="role" select="$role"/>
+              <xsl:with-param name="title">
+                <xsl:choose>
+                  <xsl:when test="$title != ''">
+                    <xsl:copy-of select="$title"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="title.markup">
+                      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                    </xsl:apply-templates>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 's'">
+            <xsl:apply-templates select="." mode="insert.subtitle.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="subtitle">
+                <xsl:choose>
+                  <xsl:when test="$subtitle != ''">
+                    <xsl:copy-of select="$subtitle"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="subtitle.markup">
+                      <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+                    </xsl:apply-templates>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'n'">
+            <xsl:apply-templates select="." mode="insert.label.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="label">
+                <xsl:choose>
+                  <xsl:when test="$label != ''">
+                    <xsl:copy-of select="$label"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="label.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'p'">
+            <xsl:apply-templates select="." mode="insert.pagenumber.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="pagenumber">
+                <xsl:choose>
+                  <xsl:when test="$pagenumber != ''">
+                    <xsl:copy-of select="$pagenumber"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:apply-templates select="." mode="pagenumber.markup"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = 'd'">
+            <xsl:apply-templates select="." mode="insert.direction.markup">
+              <xsl:with-param name="purpose" select="$purpose"/>
+              <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+              <xsl:with-param name="direction">
+                <xsl:choose>
+                  <xsl:when test="$referrer">
+                    <xsl:variable name="referent-is-below">
+                      <xsl:for-each select="preceding::xref">
+                        <xsl:if test="generate-id(.) = generate-id($referrer)">1</xsl:if>
+                      </xsl:for-each>
+                    </xsl:variable>
+                    <xsl:choose>
+                      <xsl:when test="$referent-is-below = ''">
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key" select="'above'"/>
+                        </xsl:call-template>
+                      </xsl:when>
+                      <xsl:otherwise>
+                        <xsl:call-template name="gentext">
+                          <xsl:with-param name="key" select="'below'"/>
+                        </xsl:call-template>
+                      </xsl:otherwise>
+                    </xsl:choose>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:message>Attempt to use %d in gentext with no referrer!</xsl:message>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:with-param>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:when test="$candidate = '%' ">
+            <xsl:text>%</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>%</xsl:text><xsl:value-of select="$candidate"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        <!-- recurse with the rest of the template string -->
+        <xsl:variable name="rest"
+              select="substring($template,
+              string-length(substring-before($template, '%'))+3)"/>
+        <xsl:call-template name="substitute-markup">
+          <xsl:with-param name="template" select="$rest"/>
+          <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+          <xsl:with-param name="title" select="$title"/>
+          <xsl:with-param name="subtitle" select="$subtitle"/>
+          <xsl:with-param name="label" select="$label"/>
+          <xsl:with-param name="pagenumber" select="$pagenumber"/>
+          <xsl:with-param name="purpose" select="$purpose"/>
+          <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+          <xsl:with-param name="referrer" select="$referrer"/>
+          <xsl:with-param name="role" select="$role"/>
+        </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="$template"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:stylesheet>
