pdflatex errors in doc dir

Warren Young warren@etr-usa.com
Thu Jul 18 19:34:00 GMT 2013


On 6/28/2013 02:21, Corinna Vinschen wrote:
>
> after I upgrade my server from Fedora 17 to Fedora 18, I now get
> an error message when trying to build the PDFs:

This is a known problem in TexLive 2009:

     http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563659#14

That URL takes you to a patch that is supposed to fix it.

I offer two alternate fixes:

1. Switch to forward slashes.  It shouldn't confuse anyone in 2013.

2. Switch to FOP based document formatting.

The current PDF document formatting chain goes something like this:

    DocBook -> xmlto -> dblatex -> .tex -> TeX -> .dvi -> dvipdf -> PDF

The way I've always done DocBook -> PDF is this instead:

    DocBook -> xsltproc -> .fo -> FO Processor -> PDF

It's a more direct processing chain, with no hidden intermediaries.

FOP is just one of several available FO processors.  It happens to be 
the only libre one, but there are free-as-in-cost ones we can use if 
only for debugging.

The downside is the new dependency on FOP, and hence, Java.

FOP is in many Linux package repos now, and where it isn't, installing 
from the dist tarball is easy.  Installing Java on Linux is easy these 
days, too.

On Cygwin, you have to go through Cygwin Ports, and then hack 
/usr/bin/fop to add "-Djava.awt.headless=true" to the java command, else 
you're forced to run under X.  (The same fix may be required on Linux as 
well, depending on how FOP was packaged.)

The Makefile.in patch is trivial:

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/doc/Makefile.in,v
retrieving revision 1.33
diff -r1.33 Makefile.in
26a27,28
 > UG_FO := cygwin-ug-net/cygwin-ug.fo
 >
63c65,66
<       -${XMLTO} pdf -o cygwin-ug-net/ $<
---
 >       xsltproc --xinclude fo.xsl $< > $(UG_FO)
 >       $(srcdir)/fo2pdf $(UG_FO) $@

You'd want to add *.fo to the clean target, too.

You also need a fo.xsl file, attached, which is similar in spirit to the 
existing cygwin.xsl file.  (That file should be renamed to something 
like html.xsl, if we go this direction.)

I'm using the fo2pdf script from MySQL++ here, also attached, which 
abstracts away the difference between Apache FOP, Antenna House XSL 
Formatter, and RenderX XEP.  You can replace it with a simple "fop" 
command, if you don't want the flexibility.
-------------- next part --------------
#!/bin/sh
AHCMD=/usr/XSLFormatterV42/run.sh
FOPCMD=`which /usr/local/fop/fop /usr/bin/fop | head -1 2> /dev/null`
XEPCMD=/usr/local/xep/xep

FOFILE=$1
PDFFILE=$2
if [ -n "$FOFILE" -a -r "$FOFILE" -a -n "$PDFFILE" ]
then
	if [ -x "$XEPCMD" ]
	then
		echo Rendering $FOFILE to $PDFFILE with RenderX XEP...
		$XEPCMD -quiet -fo $FOFILE -pdf $PDFFILE
	elif [ -x "$AHCMD" ]
	then
		echo Rendering $FOFILE to $PDFFILE with Antenna House XSL Formatter...
		$AHCMD -silent -d $FOFILE -o $PDFFILE
	elif [ -x "$FOPCMD" ]
	then
		echo "Rendering $FOFILE to $PDFFILE with Apache FOP ($FOPCMD)..."
		$FOPCMD -q -fo $FOFILE $PDFFILE
	else
		echo 'Cannot find a working XSL-FO processor on your system!  See'
		echo 'doc/usrman/README.txt for instructions on installing one.'
		echo
		exit 1
	fi
else
	if [ -n "$FOFILE" ]
	then
		echo "XSL-FO file $FOFILE does not exist."
		echo
	fi
	echo "usage: $0 fofile pdffile"
	echo
	echo '    Translates XSL-FO in fofile to PDF output in pdffile.'
	echo
	exit 1
fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fo.xsl
Type: text/xml
Size: 1281 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20130718/4c203795/attachment.xml>


More information about the Cygwin-developers mailing list