[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#293183: tetex-extra: spacing of footnotes with hyperref and pdflatex



Mardi le 01 février 2005, vers 23:26:37 (CET), Prakash Countcham a
écrit:

>> What is the difference? Is it possible to see the difference in a
>> document that does not use this entcs.cls?
>
> The difference is the number of letters on the second line. I think it is
> possible to see the difference in a standard document, but I don't have time
> to find the correct margins, characters size, etc. to reproduce the same
> bug.

Hello,

Unfortunately, I am unable to reproduce the bug by using footnotes
with a standard document class.

After further investigations, it seems that the bug appears because
entcls.cls redefines footnotes to use \refstepcounter instead of
\stepcounter.

The following code exhibits a similar bug, using only standard article
class and \refstepcounter:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}

%\usepackage[pdftex]{hyperref}
%\usepackage[dvips]{hyperref}
%\usepackage{hyperref}

\newcounter{a}
\newlength{\La}
\newlength{\Lb}

\begin{document}

\setlength{\La}{\textwidth}
\addtolength{\La}{-\parindent}
\settowidth{\Lb}{ hyphen}
\addtolength{\La}{-\Lb}

\newcommand{\test}[1]{%
  \par\rule{\La}{1pt} #1 \rule{5em}{1pt}.}

\test{hyphenation}
\test{hyphenation\stepcounter{a}}
\test{hyphenation\refstepcounter{a}}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In the third test the word "hyphenation" is not always hyphenated.  In
the following table, you can see the results for different cases:

 * without hyperref;

 * with hyperref, without option (it loads automatically the "dvips"
   driver with latex, and the "pdftex" driver with pdflatex);

 * with hyperref, with option specifying the driver to use
   (i.e. "dvips" for latex, or "pdftex" for pdflatex).

In the table, I note "correct" when the word is hyphenated, and
"wrong" when it is not.

                            DVI (latex)     PDF (pdflatex)
----------------------------------------------------------
without hyperref            correct         correct
hyperref, no option         wrong           wrong
hyperref, with option       correct         wrong
----------------------------------------------------------

Note that the behavior is correct with hyperref when the "dvips"
option is given while it is not with the implicit behavior.  This is
because the "dvips" option redefines \Hy@raisedlink{}, while it is not
the case when the default is used:

\define@key{Hyp}{dvips}[true]{%
  \def\Hy@driver{hdvips}%
  \def\Hy@raisedlink{}%
  \def\XR@ext{pdf}%
}

This particular point may be a Debian (or teTex) specificity: with the
upstream hyperref (as found on CTAN), the default driver is
"hypertex".

It is this different behavior with or without \Hy@raisedlink that made
me try to modify this macro.


> Furthermore, the bug disappears if we just remove the package hyperref from
> entcs.cls .

It disappears too if you modify (or comment) the redefinitions of
\footnote and \footnotemark in entcs.cls.


>>> Arnaud Giersch, in message <87lla8xsdp.fsf@dinadan.u-strasbg.fr>, found
>>> that it was a bug of hyperref and proposed the following patch for the
>>
>> Why do you think that inserting an italic correction here makes a
>> difference between latex and pdflatex? 
>
> I don't really understand it, but Donald Arseneau suggested that in 
> http://groups.google.fr/groups?threadm=c1.2b8.2K1LTn%2409i%40ag.rhein-main.de

I do not fully understand myself why an italic correction does the
trick.  I suggested this patch by simply following the advice given by
Donal Arseneau.

After some thinking, I do not even know if the patch is good enough or
if it breaks things elsewhere.  :-(

About this old c.t.t. thread, the following comment, found in
hyperref.dtx, suggests that the bug talked about if already fixed.  I
however did not find the relevant Changelog entry.

%    Redefine \verb+\@footnotemark+, borrowing its code (at the
%    cost of getting out of sync with latex.ltx), to take
%    advantage of its white space and hyphenation fudges. If we just
%    overload it, we can get variant documents (the word before the
%    footnote is treated differently). Thanks to David Carlisle and
%    Brian Ripley for confusing and helping me on this.


Regards,
-- 
Arnaud



Reply to: