Subject: Re: Bug#390629: parenscript: Script to produce documentation produces buggy LaTeX code
From: Luca Capello <[email-masked]>
To: ML BESE-devel <[email-masked]>
Cc: [email-masked], Frank Küster <[email-masked]>
Date: Mon, 02 Oct 2006 12:29:56 +0200

tag 390629 + upstream
thanks

Hi Frank!

I'm forwarding the bug to notify upstream of the problem.  For the
BESE-devel people, please keep the Debian bug as cc:.

BTW, sorry for the whole quote :-(

On Mon, 02 Oct 2006 11:01:03 +0200, Frank Küster wrote:
> I just found 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).  Therefore, the patch is simple:
>
> --- parenscript-20060513/docs/pbook.py.orig	2006-10-02 10:52:24.000000000 +0200
> +++ parenscript-20060513/docs/pbook.py	2006-10-02 10:52:45.000000000 +0200
> @@ -66,10 +66,7 @@
>      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 '') + \

I can directly apply the patch upstream or you can prepare a darcs
patch against the upstream repository [1] and the I'll apply it (I'll
prefer the latter, but it's up to you).

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://common-lisp.net/project/ucw/repos/parenscript/