Bug 1288301

Summary: dblatex do not find warning.pdf
Product: [Fedora] Fedora Reporter: Cédrick <cedrick.copol>
Component: dblatexAssignee: Michael J Gruber <mjg>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: alex, bkoz, cedrick.copol, jchaloup, mjg, pabgz, pertusus
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:12:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
DocBook test file
none
DocBook test file none

Description Cédrick 2015-12-04 02:34:07 UTC
Description of problem:

Using dblatex causes this error : ! LaTeX Error: File `warning' not found.

But we can find warning.pdf in this directory :

/usr/share/dblatex/latex/contrib/db2latex/graphics/warning.pdf

I solved the problem with this command

sudo ln -s /usr/share/dblatex/latex /usr/share/texlive/texmf-dist/tex/latex/dblatex
sudo texhash

Comment 1 Michael J Gruber 2015-12-04 07:14:37 UTC
Could you please provide the following information:

- How do you reproduce the problem? (exact commandline)

- Has this worked before? (say with dblatex-0.3.5 instead of dblatex-0.3.6 if that is what you are using, or with Fedora 22 instead of Fedora 23)

Comment 2 Cédrick 2015-12-04 11:44:19 UTC
> - How do you reproduce the problem? (exact commandline)
The commandline is :
dblatex -t tex --texstyle=amcdocstyle --xslt-opts="--nonet" --xslt-opts="--catalogs" auto-multiple-choice.en.xml -o auto-multiple-choice.en.tex

It's not my commandline, it appears during building (Makefile) the software 
 auto-multiple-choice (https://bitbucket.org/auto-multiple-choice/auto-multiple-choice)

> - Has this worked before? 
I don't know, it's my first time using it.

Comment 3 Alexis Bienvenüe 2015-12-05 15:10:46 UTC
The problem is related to the use of <warning> (and similar)  in a DocBook document.
With attached w.xml,

  dblatex -t tex w.xml
  pdflatex w.tex

ends with an error:

! LaTeX Error: File `warning' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.285 \begin{DBKadmonition}{warning}{Important}

LaTeX can't find the drawing 'warning.pdf' which is shipped with dblatex but not in the LaTeX tree.

'dblatex w.xml' works, because pdflatex is run with modified TEXINPUTS.
On debian, dblatex's 'warning.pdf' is located in the LaTeX tree.
If including dblatex graphics files in LaTeX tree is unwanted on Fedora, is there an easy way for the user to get the path leading to them, so that he can run a successful pdflatex modifying TEXINPUTS?

Comment 4 Alexis Bienvenüe 2015-12-05 15:11:30 UTC
Created attachment 1102536 [details]
DocBook test file

Comment 5 Alexis Bienvenüe 2015-12-05 15:13:03 UTC
Created attachment 1102537 [details]
DocBook test file

Sorry, this is the right one.

Comment 6 Michael J Gruber 2015-12-05 22:00:14 UTC
TEXINPUTS=/usr/share/dblatex/latex/graphics/: pdflatex w.tex

works. Really, the problem is not the use "of warning" but the use of a non-stand
ard mode ("-t tex") without setting the search path in the same way as dblatex does for its own processing.

I'm really wondering whether we should support that - if yes, then all the graphics files would need to be copied or moved inside the latex tree.

The strange thing is that dblatex undertakes quite some efforts to set TEXINPUTS appropriately, without relying on distributions or setup.py to put its files into the standard latex tree. That would be moot if we put everything there, so I don't think that its tex output is supposed to work out of the box.

Comment 7 Alexis Bienvenüe 2015-12-06 20:25:09 UTC
I understand that dblatex was designed to let its graphics files outside the latex tree, so that a dblatex package can't be blamed to respect this.
Do you know a simple way to get the path to the dblatex graphics directory? Maybe assuming it is /usr/share/dblatex/latex/graphics/ won't work in all situations. I need to use the tex output to run platex instead of pdflatex for japanese DocBook documents.

Comment 8 Michael J Gruber 2015-12-07 10:25:16 UTC
If the way in which you want to use "-t tex" is the way dblatex is meant to be used, than by all means we should copy those files to the standard LaTeX tree.

Alas, the documentation of dblatex does not mention that as part of the installation procedure, but leaves those files in /usr/share. Therefore, I'm leaning towards doing it the same way (i.e. leave the package as is).

dblatex does not provide any way to override the latex engine, unfortunately. Two possible workarounds:

1) "monkey patch", i.e. set up a "pdflatex" in your PATH which calls "platex":

--->%--- pdflatex
#!/bin/sh
exec platex "$@"
--->%---

2) read the paths from dblatex:

2a) either get the package_base from the dblatex script:

sed -ne 's/package_base.*"\(.*\)".*/\1/p' $(which dblatex)

gives /usr/share/dblatex for me.

2b) or use dblatex's texpost feature to get the exact environment it uses:

--->%--- d.sh
#!/bin/sh
env > dblatex.env
--->%---

dblatex -r ./d.sh   w.xml

That will put the environment in a file dlatex.env, which in my case contains:

TEXINPUTS=/usr/share/dblatex/latex/style//::/usr/share/dblatex/latex//

But really, if you need to jump through these hoops for japanese TeXing then maybe upstream (dblatex) should provide a way to override the TeX compiler. Or are there any packages that would the same job? That would lead to possibility

3) Use the "-r" switch to transform the TeX file before dbaltex calls pdflatex.

Comment 9 Alexis Bienvenüe 2015-12-07 13:11:04 UTC
Thank you very much for your help: these are good solutions for my problem.

Comment 10 Michael J Gruber 2015-12-07 16:12:01 UTC
Closing as NOTABUG for now.

Upstream could make it easier for users of "-t tex", though.