Index: /trunk/doc/manual/docbook2latex.xsl
===================================================================
--- /trunk/doc/manual/docbook2latex.xsl	(revision 76087)
+++ /trunk/doc/manual/docbook2latex.xsl	(revision 76088)
@@ -115,5 +115,4 @@
 \usepackage{hyperref}
 \usepackage{fancybox}
-\usepackage{fancyvrb}
 \usepackage{alltt}
 \usepackage{color}
@@ -505,7 +504,7 @@
 
   <xsl:template match="screen">
-    <xsl:text>&#x0a;&#x0a;\begin{Verbatim}[fontsize=\footnotesize]&#x0a;</xsl:text>
-    <xsl:apply-templates />
-    <xsl:text>&#x0a;\end{Verbatim}&#x0a;</xsl:text>
+    <xsl:text>&#x0a;&#x0a;{\footnotesize\begin{alltt}&#x0a;</xsl:text>
+    <xsl:apply-templates />
+    <xsl:text>&#x0a;\end{alltt}}&#x0a;</xsl:text>
   </xsl:template>
 
@@ -893,5 +892,5 @@
   <xsl:template match="replaceable">
     <xsl:choose>
-      <xsl:when test="(not(ancestor::cmdsynopsis) and not(ancestor::option)) or ancestor::arg">
+      <xsl:when test="(not(ancestor::cmdsynopsis) and not(ancestor::option) and not(ancestor::screen)) or ancestor::arg">
         <xsl:text>\texttt{\textit{</xsl:text>
         <xsl:apply-templates />
@@ -922,8 +921,4 @@
 
     <xsl:choose>
-      <xsl:when test="(name(..)='screen') or (name(../..)='screen')">
-        <xsl:value-of select="." />
-      </xsl:when>
-
       <xsl:when test="(name(..) = 'computeroutput') or (name(../..) = 'computeroutput')
                    or (name(..) = 'code')           or (name(../..) = 'code')
@@ -1020,8 +1015,25 @@
       </xsl:when>
 
+      <!-- <screen> and <programlisting>, which work with alltt environment. -->
       <xsl:otherwise>
         <xsl:variable name="subst2">
           <xsl:call-template name="str:subst">
             <xsl:with-param name="text" select="$subst1" />
+            <xsl:with-param name="replace" select="'{'" />
+            <xsl:with-param name="with" select="'\{'" />
+            <xsl:with-param name="disable-output-escaping" select="no" />
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:variable name="subst3">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst2" />
+            <xsl:with-param name="replace" select="'}'" />
+            <xsl:with-param name="with" select="'\}'" />
+            <xsl:with-param name="disable-output-escaping" select="no" />
+          </xsl:call-template>
+        </xsl:variable>
+        <xsl:variable name="subst4">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst3" />
             <xsl:with-param name="replace" select="'_'" />
             <xsl:with-param name="with" select="'\_'" />
@@ -1029,7 +1041,7 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:variable name="subst3">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst2" />
+        <xsl:variable name="subst5">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst4" />
             <xsl:with-param name="replace" select="'$'" />
             <xsl:with-param name="with" select="'\$'" />
@@ -1037,7 +1049,7 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:variable name="subst4">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst3" />
+        <xsl:variable name="subst6">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst5" />
             <xsl:with-param name="replace" select="'%'" />
             <xsl:with-param name="with" select="'\%'" />
@@ -1045,7 +1057,7 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:variable name="subst5">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst4" />
+        <xsl:variable name="subst7">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst6" />
             <xsl:with-param name="replace" select="'#'" />
             <xsl:with-param name="with" select="'\#'" />
@@ -1053,7 +1065,7 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:variable name="subst6">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst5" />
+        <xsl:variable name="subst8">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst7" />
             <xsl:with-param name="replace" select="'µ'" />
             <xsl:with-param name="with" select="'$\mu$'" />
@@ -1061,7 +1073,7 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:variable name="subst7">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst6" />
+        <xsl:variable name="subst9">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst8" />
             <xsl:with-param name="replace" select="'®'" />
             <xsl:with-param name="with" select="'\texorpdfstring{\textregistered}{}'" />
@@ -1074,15 +1086,24 @@
              with pretty quotes by invoking sed a few times. Unfortunately there are
              no regular expressions in XSLT so there's no other way. -->
-        <xsl:variable name="subst8">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst7" />
-            <xsl:with-param name="replace" select="$quote" />
-            <xsl:with-param name="with" select="'\QUOTE{}'" />
-            <xsl:with-param name="disable-output-escaping" select="no" />
-          </xsl:call-template>
-        </xsl:variable>
-        <xsl:variable name="subst9">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst8" />
+        <xsl:variable name="subst10">
+          <xsl:choose>
+            <xsl:when test="(name(..)='screen') or (name(../..)='screen')
+                         or (name(..)='programlisting') or (name(../..)='programlisting')
+                           ">
+              <xsl:value-of select="$subst9" />
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:call-template name="str:subst">
+                <xsl:with-param name="text" select="$subst9" />
+                <xsl:with-param name="replace" select="$quote" />
+                <xsl:with-param name="with" select="'\QUOTE{}'" />
+                <xsl:with-param name="disable-output-escaping" select="no" />
+              </xsl:call-template>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+        <xsl:variable name="subst11">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst10" />
             <xsl:with-param name="replace" select="'~'" />
             <xsl:with-param name="with" select="'\textasciitilde '" />
@@ -1090,7 +1111,7 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:variable name="subst10">
-          <xsl:call-template name="str:subst">
-            <xsl:with-param name="text" select="$subst9" />
+        <xsl:variable name="subst12">
+          <xsl:call-template name="str:subst">
+            <xsl:with-param name="text" select="$subst11" />
             <xsl:with-param name="replace" select="'&amp;'" />
             <xsl:with-param name="with" select="'\&amp;'" />
@@ -1098,5 +1119,5 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:value-of select="$subst10" />
+        <xsl:value-of select="$subst12" />
       </xsl:otherwise>
     </xsl:choose>
