Use a test for PDF support that is more portable across teTeX major versions.
Backport of Python's revision 39232. Needed on cygwin.
diff --git a/doc/tools/texinputs/howto.cls b/doc/tools/texinputs/howto.cls
index 899b4ae..fd74133 100644
--- a/doc/tools/texinputs/howto.cls
+++ b/doc/tools/texinputs/howto.cls
@@ -6,6 +6,7 @@
\ProvidesClass{howto}
[1998/02/25 Document class (Python HOWTO)]
+\RequirePackage{ifpdf}
\RequirePackage{pypaper}
% Change the options here to get a different set of basic options, This
@@ -23,7 +24,7 @@
% distribution.
%
% The "fancyhdr" package makes nicer page footers reasonable to
-% implement, and is used to put the chapter and section information in
+% implement, and is used to put the chapter and section information in
% the footers.
%
\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
@@ -49,7 +50,8 @@
%
\renewcommand{\maketitle}{
\py@doHorizontalRule
- \@ifundefined{pdfinfo}{}{{
+ \ifpdf
+ \begingroup
% This \def is required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
@@ -58,7 +60,8 @@
/Author (\@author)
/Title (\@title)
}
- }}
+ \endgroup
+ \fi
\begin{flushright}
{\rm\Huge\py@HeaderFamily \@title} \par
{\em\large\py@HeaderFamily \py@release} \par
@@ -84,7 +87,7 @@
\py@doHorizontalRule
\vspace{12pt}
\py@doing@page@targetstrue
-}
+}
% Fix the theindex environment to add an entry to the Table of
% Contents; this is much nicer than just having to jump to the end of
diff --git a/doc/tools/texinputs/manual.cls b/doc/tools/texinputs/manual.cls
index 789cae1..942cb49 100644
--- a/doc/tools/texinputs/manual.cls
+++ b/doc/tools/texinputs/manual.cls
@@ -6,6 +6,7 @@
\ProvidesClass{manual}
[1998/03/03 Document class (Python manual)]
+\RequirePackage{ifpdf}
\RequirePackage{pypaper}
% Change the options here to get a different set of basic options, but only
@@ -23,7 +24,7 @@
% distribution.
%
% The "fancyhdr" package makes nicer page footers reasonable to
-% implement, and is used to put the chapter and section information in
+% implement, and is used to put the chapter and section information in
% the footers.
%
\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual.}
@@ -63,7 +64,8 @@
\let\footnotesize\small
\let\footnoterule\relax
\py@doHorizontalRule%
- \@ifundefined{pdfinfo}{}{{
+ \ifpdf
+ \begingroup
% This \def is required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
@@ -72,7 +74,8 @@
/Author (\@author)
/Title (\@title)
}
- }}
+ \endgroup
+ \fi
\begin{flushright}%
{\rm\Huge\py@HeaderFamily \@title \par}%
{\em\LARGE\py@HeaderFamily \py@release \par}