Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Better fix for handling of literallayout elements #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dblatex/asciidoc-dblatex.sty
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@
\end{minipage}\end{Sbox}\doublebox{\TheSbox}%
}

% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}
% To preserve simple quotes in the blocs of code
\usepackage{upquote}
12 changes: 1 addition & 11 deletions dblatex/asciidoc-dblatex.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ See dblatex(1) -p option.
<xsl:param name="table.in.float">0</xsl:param>
<xsl:param name="monoseq.hyphenation">0</xsl:param>
<xsl:param name="latex.output.revhistory">1</xsl:param>
<xsl:param name="literal.class">normal</xsl:param>

<!-- This doesn't work, don't know why, see:
http://dblatex.sourceforge.net/html/manual/apas03.html
Expand All @@ -41,17 +42,6 @@ figure,table,equation,example
-->
<xsl:param name="doc.toc.show">1</xsl:param>

<!--
Override default literallayout template.
See `./dblatex/dblatex-readme.txt`.
-->
<xsl:template match="address|literallayout[@class!='monospaced']">
<xsl:text>\begin{alltt}</xsl:text>
<xsl:text>&#10;\normalfont{}&#10;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&#10;\end{alltt}</xsl:text>
</xsl:template>

<xsl:template match="processing-instruction('asciidoc-pagebreak')">
<!-- force hard pagebreak, varies from 0(low) to 4(high) -->
<xsl:text>\pagebreak[4] </xsl:text>
Expand Down
13 changes: 0 additions & 13 deletions dblatex/dblatex-readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@ Limitations
-----------
Observed in dblatex 0.2.8.

- dblatex doesn't seem to process the DocBook 'literallayout' element
correctly: it is rendered in a monospaced font and no inline
elements are processed. By default the normal font should be used
and almost all DocBook inline elements should be processed
(http://www.docbook.org/tdg/en/html/literallayout.html). I almost
fixed this by overriding the default dblatex literallayout template
(in `./dblatex/asciidoc-dblatex.xsl`) and using the LaTeX 'alltt'
package, but there are remaining problems:

* Blank lines are replaced by a single space.
* The 'literallayout' element incorrectly wraps text when rendered
inside a table.

- Callouts do not work inside DocBook 'literallayout' elements which
means callouts are not displayed inside AsciiDoc literal blocks. A
workaround is to change the AsciiDoc literal block to a listing
Expand Down
4 changes: 2 additions & 2 deletions docbook45.conf
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ template::[quote-close]

[verseblock]
template::[quote-open]
<literallayout>|</literallayout>
<literallayout class="normal">|</literallayout>
template::[quote-close]

[quoteparagraph]
Expand Down Expand Up @@ -428,7 +428,7 @@ paragraph=<simpara><emphasis role="strong">|</emphasis></simpara>
paragraph=<simpara><literal>|</literal></simpara>

[tabletags-verse]
bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}><literallayout>|</literallayout></entry>
bodydata=<entry align="{halign}" valign="{valign}"{colspan@1:: namest="col_{colstart}" nameend="col_{colend}"}{morerows@0:: morerows="{morerows}"}><literallayout class="normal">|</literallayout></entry>
paragraph=

[tabletags-literal]
Expand Down