fppdf.sty 1.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
% This tiny package invokes ``hyperref'' with appropriate options.
% Three modes are provided:
%   if \fppdf is defined, we configure ``hyperref'' for producing nice PDF output via dvipdfm.
%   otherwise, if WhizzyTeX is active, we do configure ``softref'' for producing DVI output
%     containing ``advi''-style hyperlinks.
%   otherwise, we configure nothing.
\ProvidesPackage{fppdf}

\@ifundefined{fppdf}{
  \newcommand{\texorpdfstring}[2]{#1}
  \newcommand{\href}[2]{#2}
  \@ifundefined{WhizzyTeX}{
    % PostScript output.
    \typeout{No hyperlinks.}
  }{
    % WhizzyTeX output.
    \typeout{Hyperlinks in advi style.}
    %
    % Dfinissons les commandes \softlink et \softtarget, employes par locallabel,
    % de faon  ce que les labels de preuves deviennent des hyperliens.
    %
    \edef\hyper@quote{\string"}
    \edef\hyper@sharp{\string#}
    \def \softlink #1#2{\special 
      {html:<A href=\hyper@quote\hyper@sharp#1\hyper@quote>}#2\special
      {html:</A>}}
    \def \softtarget #1#2{\special
      {html:<A name=\hyper@quote#1\hyper@quote>}#2\special
      {html:</A>}}
  }
}{
  % PDF output.
  \typeout{Hyperlinks in dvipdfm style.}
  \usepackage[dvipdfm,bookmarks=true,bookmarksopen=true,colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}
  \let\softlink\hyperlink
  \let\softtarget\hypertarget
}