docs/pbook.py: correct faulty check for PDF output
authorLuca Capello <luca@pca.it>
Mon, 2 Oct 2006 21:55:16 +0000 (21:55 +0000)
committerLuca Capello <luca@pca.it>
Mon, 2 Oct 2006 21:55:16 +0000 (21:55 +0000)
Frank K[_\c3_][_\bc_]ster discovered that docs/pbook.py produces buggy
LaTeX code, a faulty check for PDF output.  It doesn't show up if you
only try to create PDF.

But if you want to go the traditional route and produce dvi files (and
from that PostScript and maybe finally again PDF), this will fail and
still produce PDF.  The script itself doesn't do that (or rather, it
does that in fact but ignores the output in this first run), but it's
still an uglyness.

Moreover, it's completely useless, because the only package that uses
the information, graphicx, will detect the output format itself (and
in a proper way).

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=390629

docs/pbook.py

index 3c17267..a599395 100644 (file)
@@ -66,10 +66,7 @@ class TexFile(TxtFile):
     def beginning(self):
         return '\n\\documentclass[notitlepage,a4paper,makeidx]{' + self.style + '}\n' + \
                '\\usepackage{fancyvrb,color,palatino,makeidx}\n' + \
-               "\\newif\\ifpdf\n\\ifx\\pdfoutput\\undefined\n\\pdffalse\n" + \
-               "\\else\n\\pdfoutput=1\n\\pdftrue\n\\fi\n" + \
-               "\\ifpdf\n\\usepackage[pdftex]{graphicx}\n" + \
-               "\\else\n\\usepackage{graphicx}\n\\fi\n" + \
+               "\\usepackage{graphicx}\n" + \
                '\\definecolor{gray}{gray}{0.6}\n' + \
                '\\title{' + TexFile.escapeString(self.title) + '}\n' +  \
                (self.author and ('\\author{' + self.author + '}\n') or '') + \