This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: Images & PDF output


On Thu, Jun 08, 2000 at 07:04:56AM +0200, Martin Perina wrote:
> Ok, but when I have declared this:
> 
> <mediaobject>
>   <imageobject>
>     <imagedata fileref="images/products.eps" format="EPS" align="center"/>
>   </imageobject>
>   <imageobject>
>     <imagedata fileref="images/products.png" format="PNG" align="center"/>
>   </imageobject>
> </mediaobject> 
> 
> pdfjadetex always takes EPS file even it shows error message:
> 
>  ! LaTeX Error: Unknown graphics extension: .eps
> 
> Is there some way to made jadetex use PNG file?

Yes, but it's a kludge.

The problem is that when you generate "print" output, the stylesheets don't
know whether the final output format will be EPS or PDF -- there's no way
to provide them with that information yet.  Given the choice of PNG or EPS 
they'll choose EPS every time.  As you've discovered, pdftex doesn't handle
.eps files.

The solution is to use parameter entities (if that's an unfamiliar term,
go and read http://www.freebsd.org/tutorials/docproj-primer/, there's 
a section in there which explains them, and gives examples of using them
to conditionally include certain parts of your document.

In a nutshell, start your document like this:

  <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [

  <!ENTITY % output.print.pdf "IGNORE">
  <!ENTITY % output.print.eps "IGNORE">

  ]>

  <book>
    <!-- rest of the document as normal -->

Adjust that as necessary, depending on which version of the DTD you're
using.  The key bit is the two <!ENTITY lines.

Then, when you want to include an image, do this:

   <![ %output.print.pdf; [
   <imagedata fileref="foo.png" format="png">
   ]]>

   <![ %output.print.eps; [
   <imagedata fileref="foo.eps" format="eps">
   ]]>

Now, when you process your document with "jade ...", the "%output.print.xxx;"
is replaced by the word "IGNORE".  This tells Jade to ignore that section
of the document.

The overall effect is that *neither* image will be included.  In order to
get one (and only one) image included you have to tell Jade that one or
other of the %output.print.xxx; entities must contain "INCLUDE" rather 
than "IGNORE".

You can do this on the command line with the "-i" flag.  So if you're
producing a .tex file that you will eventually turn in to a .eps file you
would do

    jade -i output.print.eps ... -t tex foo.sgml

If you're producing a .tex file that will eventually turn in to a .pdf file
you would do

    jade -i output.print.pdf ... -t tex foo.sgml

instead.

N 
-- 
Internet connection, $19.95 a month.  Computer, $799.95.  Modem, $149.95.
Telephone line, $24.95 a month.  Software, free.  USENET transmission,
hundreds if not thousands of dollars.  Thinking before posting, priceless.
Somethings in life you can't buy.  For everything else, there's MasterCard.
  -- Graham Reed, in the Scary Devil Monastery

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]