This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pdflatex errors in doc dir


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.

Attachment: fo2pdf
Description: Text document

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
		xmlns:fo="http://www.w3.org/1999/XSL/Format";
		version="1.0">
	
	<!-- Import the standard DocBook stylesheet that this one is based on.
	     We use a web URL, but the local XML catalog should resolve this to
			 the local copy of the stylesheet, if it exists. -->
	<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>

	<!-- Add page breaks before each sect1 -->
	<xsl:attribute-set name="section.level1.properties">
		<xsl:attribute name="break-before">page</xsl:attribute>
	</xsl:attribute-set>

	<!-- Rag-right lines -->
	<xsl:attribute-set name="root.properties">
		<xsl:attribute name="text-align">left</xsl:attribute>
	</xsl:attribute-set>

	<!-- Use a smaller font for code listings to increase the chances
	     that they can fit on a single sheet, to reduce FOP complaints
			 about being forced to split a listing across pages. -->
	<xsl:attribute-set name="monospace.verbatim.properties">
		<xsl:attribute name="font-size">85%</xsl:attribute>
	</xsl:attribute-set>

	<!-- Inform the DocBook stylesheets that it's safe to use FOP
	     specific extensions. -->
	<xsl:param name="fop1.extensions" select="1"/>
</xsl:stylesheet>

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