From: Kjell Magne Fauske <[log in to unmask]>
Newsgroups: comp.text.tex
Subject: Re: Bug in tufte-latex package
Date: Sat, 22 Nov 2008 01:14:00 -0800 (PST)
Message-ID: <[log in to unmask]>
References: <[log in to unmask]>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

On Nov 20, 11:29=A0pm, Dan Luecking <[log in to unmask]> wrote:
> There is a bug in tufte-handout.cls that seems to prevent even the
> supplied sample-handout.tex from being compiled.
>
> Lines 112--116 of tufte-handout.cls say
> \IfFileExists{ifpdf.sty}{%
> =A0 \RequirePackage{ifpdf}}{% assume we're not using pdfTex?
>
> =A0 \newif\ifpdf\pdffalse
>
> }
>
> Unfortunately, the class loads other packages that have already
> loaded ifpdf.sty.
>
> That means that the \ifpdf in the false-case alternative of
> IfFileExists is already recognized as a TeX conditional. The
> code of \IfFileExists copies this into another TeX conditional
> and it appears as an unbalanced \if-command.
>
> This ultimately causes large amounts of code in tufte-handout.cls
> to be ignored.
>
> Another potential problem occurs in lines 120--124:
> \IfFileExists{ifxetex.sty}{%
> =A0 \RequirePackage{ifxetex}}{% not using xelatex
>
> =A0 \newif\ifxetex\xetexfalse
>
> }
>
> Although it causes no problem so far, it could break if
> some previously loaded package is changed to require
> ifxetex.sty
>
> There are several ways tufte-handout could be corrected.
> I am unsure which is best, but I would leave the false-case
> alternative empty and use
> =A0\@ifundefined{ifpdf}{\newif\ifpdf}{}
> afterwards.
>
> It occurs to me, however, that the LaTeX kernel might be
> corrected so that \IfFileExists doesn't include the second
> and third arguments inside conditional code. Something
> like:
> \def\IfFileExists#1{%
> =A0 \openin \@inputcheck #1
> =A0 \ifeof \@inputcheck
> =A0 =A0 \ifx \input@path \@undefined
> =A0 =A0 =A0 \let\reserved@a\@secondoftwo
> =A0 =A0 \else
> =A0 =A0 =A0 \def \reserved@a {\@iffileonpath {#1}}
> =A0 =A0 \fi
> =A0 \else
> =A0 =A0 \closein \@inputcheck
> =A0 =A0 \edef \@filef@und {#1 }
> =A0 =A0 \let\reserved@a\@firstoftwo
> =A0 \fi\reserved@a}
>
> It would also be nice if the kernel provided a version
> of \newif where one only had to give it the minimal part
> of the conditional's name. Something like the following
> would be skippable:
> =A0 \safe@newif{name}
> (which would define \ifname, \nametrue and \namefalse).
>
> Dan
> To reply by email, change LookInSig to luecking


I forwarded the bug report to the tufte-latex mailing list:
http://groups.google.com/group/tufte-latex/browse_frm/thread/d7db347ab7a870=
ab

- Kjell Magne Fauske