OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Generating PDF from docbook on Linux (OSS)


Hi Daniel,

On Fri, Jan 22, 2010 at 5:52 PM, Daniel Leidert
<daniel.leidert.spam@gmx.net> wrote:
> Am Freitag, den 22.01.2010, 17:26 +0100 schrieb Mathieu Malaterre:
>
>>   I am looking for tool that would generate PDF file from a docbook
>> file. I tried a couple without success:
>
> You can try dblatex too or xmlroff.

Indeed dblatex works ok.

> But please allow me some words:
>
>> - xmlto fails not process MathML 2.0 equation (**),
>
> Nope. a) You missed to define the mml namespace. b) Fop doesn't come
> with MathML support by default. Let me explain:
>
>> Document is simply:
> [..]
>> <mml:math>
>
> You did not define the mml namespace anywhere. Please add an xmlns:mml
> attribute accordingly (to <article> or the root element with the mml
> prefix). So these:
>
>> /tmp/math.xml:23: namespace error : Namespace prefix mml on math is
>> not defined
>> <mml:math>
>>          ^
> [..]
>> math encountered in equation, but no template matches.
>
> disappear. Then to process the .fo file with Fop you can install the
> JEuclid FOP plugin [1][2].
>
> Then the resulting pdf contains your equation.
>
> [1] http://jeuclid.sourceforge.net/jeuclid-fop/index.html
> [2] packages.debian.org/libjeuclid-fop-java

Ok. Let's try again:

$ fop -xsl /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl
-xml /tmp/math.xml -pdf foo.pdf
Jan 22, 2010 6:10:32 PM org.apache.fop.cli.InputHandler warning
WARNING: javax.xml.transform.TransformerException: Making portrait
pages on USletter paper (8.5inx11in)
Jan 22, 2010 6:10:32 PM org.apache.fop.cli.InputHandler warning
WARNING: javax.xml.transform.TransformerException: Read
/usr/share/doc/docbook-xsl/README.Debian.gz section 5(a).
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.ElementMappingRegistry findFOMaker
WARNING: Unknown formatting object http://www.w3.org/1998/Math/MathML^math
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.ElementMappingRegistry findFOMaker
WARNING: Unknown formatting object http://www.w3.org/1998/Math/MathML^mrow
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.ElementMappingRegistry findFOMaker
WARNING: Unknown formatting object http://www.w3.org/1998/Math/MathML^mo
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.ElementMappingRegistry findFOMaker
WARNING: Unknown formatting object http://www.w3.org/1998/Math/MathML^mn
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.ElementMappingRegistry findFOMaker
WARNING: Unknown formatting object http://www.w3.org/1998/Math/MathML^mo
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.ElementMappingRegistry findFOMaker
WARNING: Unknown formatting object http://www.w3.org/1998/Math/MathML^mi
Jan 22, 2010 6:10:33 PM org.apache.fop.hyphenation.Hyphenator getHyphenationTree
SEVERE: Couldn't find hyphenation pattern en
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.flow.InstreamForeignObject
prepareIntrinsicSize
SEVERE: Intrinsic dimensions of  instream-foreign-object could not be determined
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.flow.InstreamForeignObject
prepareIntrinsicSize
SEVERE: Intrinsic dimensions of  instream-foreign-object could not be determined
Jan 22, 2010 6:10:33 PM org.apache.fop.fo.flow.InstreamForeignObject
prepareIntrinsicSize
SEVERE: Intrinsic dimensions of  instream-foreign-object could not be determined


Using:

$ apt-cache policy docbook-xsl
docbook-xsl:
  Installed: 1.73.2.dfsg.1-5
  Candidate: 1.73.2.dfsg.1-5
  Version table:
     1.75.2+dfsg-3 0
        200 http://ftp.fr.debian.org testing/main Packages
        100 http://ftp.fr.debian.org unstable/main Packages
 *** 1.73.2.dfsg.1-5 0
        500 http://ftp.fr.debian.org lenny/main Packages
        100 /var/lib/dpkg/status

$ apt-cache policy fop
fop:
  Installed: 1:0.94.dfsg-2
  Candidate: 1:0.94.dfsg-2
  Version table:
     1:0.95.dfsg-7 0
        200 http://ftp.fr.debian.org testing/main Packages
        100 http://ftp.fr.debian.org unstable/main Packages
 *** 1:0.94.dfsg-2 0
        500 http://ftp.fr.debian.org lenny/contrib Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libjeuclid-fop-java
libjeuclid-fop-java:
  Installed: 3.1.8-1
  Candidate: 3.1.8-1
  Version table:
 *** 3.1.8-1 0
        200 http://ftp.fr.debian.org testing/main Packages
        100 http://ftp.fr.debian.org unstable/main Packages
        100 /var/lib/dpkg/status


Should I stop using fop, and instead switch to dblatex ? Which one is
the more mature ? There is another tool on my debian box called
docbook2pdf, which work ok with the xml file with the fix you
suggested (*), should I start using it ? Should I switch to the new
debian package docbook-xsl-ns ?

Thanks again for your help !
-- 
Mathieu

(*)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";
[
<!ENTITY % MATHML.prefixed "INCLUDE">
<!ENTITY % MATHML.prefix "mml">
<!ENTITY % equation.content "(alt?, (graphic+|mediaobject+|mml:math))">
<!ENTITY % inlineequation.content
                "(alt?, (inlinegraphic+|inlinemediaobject+|mml:math))">
<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
        "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd";>
%mathml;
]
>
<article>
  <sect1 id="section_Description">
    <title>Description</title>
      <para>
<equation>
<title>My MathML example</title>
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML";>
  <mml:mrow>
    <mml:mo>&sum;</mml:mo>
    <mml:mn>4</mml:mn>
    <mml:mo>+</mml:mo>
    <mml:mi>x</mml:mi>
  </mml:mrow>
</mml:math>
</equation>
      </para>
  </sect1>
</article>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]