[xml/sgml-pkgs] Bug#339806: [DB2LaTeX-apps] Problems with db2latex and current TeX distributions: \pdfoutput

James Devenish j-devenish at users.sourceforge.net
Tue Dec 27 09:24:04 UTC 2005


Hi Frank,

Can you find out if the attached patches fix the problem for Debian?

-------------- next part --------------
Index: preamble.mod.xsl
===================================================================
RCS file: /cvsroot/db2latex/db2latex/xsl/preamble.mod.xsl,v
retrieving revision 1.82
diff -u -r1.82 preamble.mod.xsl
--- preamble.mod.xsl	31 Jan 2004 12:26:12 -0000	1.82
+++ preamble.mod.xsl	27 Dec 2005 09:18:34 -0000
@@ -54,7 +54,8 @@
 			<para>
 
 			If <xref linkend="param.latex.override"/> is empty, the template
-			outputs <xref linkend="param.latex.article.preamblestart"/> and
+			outputs <xref linkend="param.latex.common.pdfdetection"/>,
+			<xref linkend="param.latex.article.preamblestart"/> and
 			<xref linkend="param.latex.article.preamble.pre"/>, then calls
 			<xref linkend="template.generate.latex.common.preamble"/> and <xref
 			linkend="template.generate.latex.essential.preamble"/> followed by
@@ -69,6 +70,7 @@
 	<xsl:template name="generate.latex.article.preamble">
 		<xsl:choose>
 			<xsl:when test="$latex.override = ''">
+				<xsl:value-of select="$latex.common.pdfdetection"/>
 				<xsl:value-of select="$latex.article.preamblestart"/>
 				<xsl:value-of select="$latex.article.preamble.pre"/>
 				<xsl:call-template name="label.id"/>
@@ -95,7 +97,8 @@
 			<para>
 
 			If <xref linkend="param.latex.override"/> is empty, the template
-			outputs <xref linkend="param.latex.book.preamblestart"/> and
+			outputs <xref linkend="param.latex.common.pdfdetection"/>,
+			<xref linkend="param.latex.book.preamblestart"/> and
 			<xref linkend="param.latex.book.preamble.pre"/>, then calls
 			<xref linkend="template.generate.latex.common.preamble"/> and <xref
 			linkend="template.generate.latex.essential.preamble"/> followed by
@@ -110,6 +113,7 @@
 	<xsl:template name="generate.latex.book.preamble">
 		<xsl:choose>
 			<xsl:when test="$latex.override = ''">
+				<xsl:value-of select="$latex.common.pdfdetection"/>
 				<xsl:value-of select="$latex.book.preamblestart"/>
 				<xsl:value-of select="$latex.book.preamble.pre"/>
 				<xsl:call-template name="label.id"/>
@@ -142,8 +146,8 @@
 		<xsl:text>% --------------------------------------------&#10;</xsl:text>
 		<xsl:text>% Autogenerated LaTeX file for articles&#10;</xsl:text>
 		<xsl:text>% --------------------------------------------&#10;</xsl:text>
-		<xsl:text>\ifx\pdfoutput\undefined&#10;</xsl:text>
-		<xsl:text>\documentclass[</xsl:text>
+		<xsl:text>\ifdblatexpdf&#10;</xsl:text>
+		<xsl:text>\documentclass[pdftex,</xsl:text>
 		<xsl:value-of select='$latex.documentclass.common' />
 		<xsl:text>,</xsl:text>
 		<xsl:value-of select='$latex.documentclass.article' />
@@ -156,7 +160,7 @@
 		</xsl:choose>
 		<xsl:text>}&#10;</xsl:text>
 		<xsl:text>\else&#10;</xsl:text>
-		<xsl:text>\documentclass[pdftex,</xsl:text>
+		<xsl:text>\documentclass[</xsl:text>
 		<xsl:value-of select='$latex.documentclass.common' />
 		<xsl:text>,</xsl:text>
 		<xsl:value-of select='$latex.documentclass.article' />
@@ -189,8 +193,8 @@
 		<xsl:text>% ------------------------------------------------------------	&#10;</xsl:text>
 		<xsl:text>% Autogenerated LaTeX file for books	&#10;</xsl:text>
 		<xsl:text>% ------------------------------------------------------------	&#10;</xsl:text>
-		<xsl:text>\ifx\pdfoutput\undefined&#10;</xsl:text>
-		<xsl:text>\documentclass[</xsl:text>
+		<xsl:text>\ifdblatexpdf&#10;</xsl:text>
+		<xsl:text>\documentclass[pdftex,</xsl:text>
 		<xsl:value-of select='$latex.documentclass.common' />
 		<xsl:text>,</xsl:text>
 		<xsl:value-of select='$latex.documentclass.book' />
@@ -203,7 +207,7 @@
 		</xsl:choose>
 		<xsl:text>}&#10;</xsl:text>
 		<xsl:text>\else&#10;</xsl:text>
-		<xsl:text>\documentclass[pdftex,</xsl:text>
+		<xsl:text>\documentclass[</xsl:text>
 		<xsl:value-of select='$latex.documentclass.common' />
 		<xsl:text>,</xsl:text>
 		<xsl:value-of select='$latex.documentclass.book' />
@@ -875,21 +879,10 @@
 	<doc:param name="latex.pdf.preamble" xmlns="">
 		<doc:description>
 			<screen>
-				\usepackage{ifthen}
-				% --------------------------------------------
-				% Check for PDFLaTeX/LaTeX 
-				% --------------------------------------------
-				\newif\ifpdf
-				\ifx\pdfoutput\undefined
-				\pdffalse % we are not running PDFLaTeX
-				\else
-				\pdfoutput=1 % we are running PDFLaTeX
-				\pdftrue
-				\fi
 				% --------------------------------------------
 				% Load graphicx package with pdf if needed 
 				% --------------------------------------------
-				\ifpdf
+				\ifdblatexpdf
 				\usepackage[pdftex]{graphicx}
 				\pdfcompresslevel=9
 				\else
@@ -899,10 +892,11 @@
 		</doc:description>
 	</doc:param>
 	<xsl:param name="latex.pdf.preamble">
+		<!--
 		<xsl:text>\usepackage{ifthen}&#10;</xsl:text>
-		<xsl:text>% --------------------------------------------&#10;</xsl:text>
+		<xsl:text>% ============================================&#10;</xsl:text>
 		<xsl:text>% Check for PDFLaTeX/LaTeX &#10;</xsl:text>
-		<xsl:text>% --------------------------------------------&#10;</xsl:text>
+		<xsl:text>% ============================================&#10;</xsl:text>
 		<xsl:text>\newif\ifpdf&#10;</xsl:text>
 		<xsl:text>\ifx\pdfoutput\undefined&#10;</xsl:text>
 		<xsl:text>\pdffalse % we are not running PDFLaTeX&#10;</xsl:text>
@@ -910,10 +904,11 @@
 		<xsl:text>\pdfoutput=1 % we are running PDFLaTeX&#10;</xsl:text>
 		<xsl:text>\pdftrue&#10;</xsl:text>
 		<xsl:text>\fi&#10;</xsl:text>
+		-->
 		<xsl:text>% --------------------------------------------&#10;</xsl:text>
 		<xsl:text>% Load graphicx package with pdf if needed &#10;</xsl:text>
 		<xsl:text>% --------------------------------------------&#10;</xsl:text>
-		<xsl:text>\ifpdf&#10;</xsl:text>
+		<xsl:text>\ifdblatexpdf&#10;</xsl:text>
 		<xsl:text>\usepackage[pdftex]{graphicx}&#10;</xsl:text>
 		<xsl:text>\pdfcompresslevel=9&#10;</xsl:text>
 		<xsl:text>\else&#10;</xsl:text>
@@ -937,7 +932,7 @@
 				% --------------------------------------------
 				% Load hyperref package with pdf if needed 
 				% --------------------------------------------
-				\ifpdf
+				\ifdblatexpdf
 				\usepackage[pdftex,bookmarksnumbered,colorlinks,backref, bookmarks, breaklinks, linktocpage]{hyperref}
 				\else
 				\usepackage[bookmarksnumbered,colorlinks,backref, bookmarks, breaklinks, linktocpage]{hyperref}
@@ -969,7 +964,7 @@
 			<xsl:text>% --------------------------------------------&#10;</xsl:text>
 			<xsl:text>% Load hyperref package with pdf if needed &#10;</xsl:text>
 			<xsl:text>% --------------------------------------------&#10;</xsl:text>
-			<xsl:text>\ifpdf&#10;</xsl:text>
+			<xsl:text>\ifdblatexpdf&#10;</xsl:text>
 			<xsl:text>\usepackage[pdftex,</xsl:text>
 			<xsl:value-of select="$latex.hyperref.param.common" />
 			<xsl:text>,</xsl:text>
@@ -1079,7 +1074,7 @@
 <xsl:otherwise>
 	<xsl:choose>
 	<xsl:when test="$latex.pdf.support=1">
-		<xsl:text>\ifpdf&#10;</xsl:text>
+		<xsl:text>\ifdblatexpdf&#10;</xsl:text>
 		<xsl:text>\DeclareGraphicsExtensions{.pdf,.png,.jpg}&#10;</xsl:text>
 		<xsl:text>\else&#10;</xsl:text>
 		<xsl:text>\DeclareGraphicsExtensions{.eps}&#10;</xsl:text>
@@ -1114,7 +1109,7 @@
 			<xsl:otherwise>
 				<xsl:choose>
 				<xsl:when test="$latex.pdf.support=1">
-					<xsl:text>\ifpdf&#10;</xsl:text>
+					<xsl:text>\ifdblatexpdf&#10;</xsl:text>
 					<xsl:text>\DeclareGraphicsExtensions{.pdf,.png,.jpg}&#10;</xsl:text>
 					<xsl:text>\else&#10;</xsl:text>
 					<xsl:text>\DeclareGraphicsExtensions{.eps}&#10;</xsl:text>
-------------- next part --------------
Index: param-direct.mod.xsl
===================================================================
RCS file: /cvsroot/db2latex/db2latex/xsl/param-direct.mod.xsl,v
retrieving revision 1.9
diff -u -r1.9 param-direct.mod.xsl
--- param-direct.mod.xsl	12 Aug 2004 05:17:01 -0000	1.9
+++ param-direct.mod.xsl	27 Dec 2005 09:18:59 -0000
@@ -39,6 +39,16 @@
 	</doc:reference>
 
 	<doc:param xmlns="">
+		<refpurpose> Undocumented </refpurpose>
+		<doc:description>
+			<para> Undocumented. </para>
+		</doc:description>
+	</doc:param>
+	<xsl:param name="latex.common.pdfdetection">
+		<xsl:text>\newif\ifdblatexpdf \ifx\pdfoutput\undefined \else \ifx\pdfoutput\relax \else \ifnum\pdfoutput>0 \dblatexpdftrue \fi \fi \fi&#10;</xsl:text>
+	</xsl:param>
+
+	<doc:param xmlns="">
 		<refpurpose> DB2LaTeX document class </refpurpose>
 		<doc:description>
 			<para>


More information about the debian-xml-sgml-pkgs mailing list