diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index ea754084be0..7b843e7037f 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -94,4 +94,35 @@
   </fo:bookmark>
 </xsl:template>
 
+<xsl:template match="text()">
+  <xsl:choose>
+    <xsl:when test='contains(., "&#8594;")'>
+      <xsl:call-template name="shift_arrow_up">
+        <xsl:with-param name="text" select="."/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="."/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="shift_arrow_up">
+  <xsl:param name="text" />
+  <xsl:choose>
+    <xsl:when test='contains($text, "&#8594;")'>
+      <xsl:call-template name="shift_arrow_up">
+        <xsl:with-param name="text" select='substring-before($text, "&#8594;")'/>
+      </xsl:call-template>
+      <fo:inline baseline-shift="10%">&#8594;</fo:inline>
+      <xsl:call-template name="shift_arrow_up">
+        <xsl:with-param name="text" select='substring-after($text, "&#8594;")'/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="$text"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 </xsl:stylesheet>
