Buongiorno a tutti,
uso LaTeX da un paio di mesi su Windows XP (MiKTeX + WinEdt 5.4) e attualmente sto impaginando una dispensa universitaria. Il mio problema deriva dal conflitto tra il pacchetto hyperref ed il pacchetto endnotes. Infatti, riesco a far comparire le note alla fine di ogni capitolo, ma non si crea il link tra il numero della nota nel testo e la nota stessa. Per creare il pdf uso PDF Texify presente in WinEdt e gli altri link nel testo (indice, tabelle, figure etc.) funzionano perfettamente, per cui ho pensato che fosse un problema di conflitto o incompatibilità tra i due pacchetti, come mi è stato confermato cercando in rete e sul vostro forum, che tratta un problema in parte analogo in http://www.guit.sssup.it/phpbb/viewtopic.php?t=129&highlight=hyperref .
Oltre a ciò, se converto le endnotes in footnotes tutto funziona perfettamente.
Avrei trovato anche due soluzioni a questo problema, ma non riesco a metterle in pratica:a) http://www.mail-archive.com/lyx-users@lists.lyx.org/msg14632.html
Definizione di due nuovi comandi che però non capisco dove vadano applicati e che comunque mi danno l’idea di una soluzione “sporca”b) il Notre Dame Journal of Formal Logic ha elaborato una propria classe (jfl.cls, presente all’indirizzo http://www.nd.edu/~ndjfl/typesetting/jfl.cls) all’interno della quale dovrebbero esserci i comandi per rendere endnotes compatibile con hyperref, come viene detto a pagina 4 della loro Style Guide che si trova in http://www.nd.edu/~ndjfl/typesetting/styleguidepsnfss.pdf “NDJFL does not use footnotes. If notes are needed, endnotes are used. Labels work fine within endnotes and can be used to refer to the endnotes. The endnote command was enhanced to work with the package hyperref. Check it out.”
Non sono in grado, con le mie (in)competenze attuali, di riutilizzare il codice della loro classe in qualche modo.
Prova a scrivere questo in un file da chiamare ndenotes.sty:
`\ProvidesPackage{ndenotes}
\let\savefootnote\footnote
\skip\footins=12pt plus11pt
\footskip=18pt
\iffalse
\long\def\spfootnotetext#1{\insert\footins{%
\reset@font\footnotesize
\interlinepenalty\interfootnotelinepenalty
\splittopskip\footnotesep
\splitmaxdepth \dp\strutbox \floatingpenalty \@MM
\hsize\columnwidth \@parboxrestore
\color@begingroup
\noindent{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
\color@endgroup}}%
\fi
\newcount\footnum
\newcount\savefootnum
\def\getnumber#1#2#3*{\def\currnum{#3}}
\def\refer#1{\expandafter\getnumber#1*%
\expandafter\hyperlink\expandafter{\csname xfoot\currnum\endcsname}{\currnum}}
\@definecounter{endnote}
\def\thefootnum{\the\footnum}
\long\def\endnote#1{%
\global\advance\footnum by 1\relax\leavevmode
\expandafter\hypertarget\expandafter{\csname yfoot\the\footnum\endcsname}{}%
\expandafter\hyperlink\expandafter{\csname xfoot\the\footnum\endcsname}
{\hbox{$^{\the\footnum}$}}%
\long\expandafter\gdef\csname foot\the\footnum\endcsname{%
{\noindent\hskip-\leftmargin
\expandafter\hypertarget\expandafter{\csname xfoot\the\footnum\endcsname}{}%
%% cholak footnote numbering
\expandafter\hyperlink\expandafter{\csname yfoot\the\footnum\endcsname}
{\hbox to \leftmargin
{\hskip6.75pt\hbox to6.75pt{\hss\the\footnum.}\hss}}{}%
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\theendnote}%
\let\@currentlabel\thefootnum
\def\@currentlabelname{endnote}%
\def\@currenvir{endnote}%
\edef\@currentHref{endnote.\the\footnum}%
\hypertarget{\@currentHref}{}%
#1\strut\vskip1sp}\vskip1pt}}
\let\@currentHref\relax % assuming it will be redefined if electric
% is chosen as an option.
\long\def\endnotetext#1{%
\global\advance\footnum by 1
\long\expandafter\gdef\csname foot\the\footnum\endcsname{%
\vtop{\indent\hbox to\leftmargin
{\hskip6.75pt\hbox to6.75pt{\hss\the\footnum.}%
\hfill}{#1 \strut\vskip1sp}}\vskip1pt}}
%%% spacing around endnotes
\def\notes{%
\ifnum\footnum=0
\else
\savefootnum=\footnum
\footnum=0
\ifnum\savefootnum>1
\section*{Notes}
\else
\section*{Note}
\fi
\normalfont
\vskip-\baselineskip
\vskip-\topsep
\vskip-\parskip
\vskip1sp
\bgroup
\def\@listI{%
\leftmargin=20pt
\parsep\z@skip
\itemsep\z@skip
\listparindent\parindent
}
\let\@listi\@listI
\begin{itemize}
\item[]
\noindent\loop\ifnum\savefootnum>\footnum
\vskip\baselineskip
\global\advance\footnum by1
\csname foot\the\footnum\endcsname
\expandafter\gdef\csname foot\the\footnum\endcsname{\relax}%
\repeat
\global\footnum=0
\end{itemize}
\egroup
\fi
\leftmargin=0pt \leftskip=0pt
}
\let\footnote\endnote
\let\footnotetext\endnote`
Hyperref va caricato con le opzioni
`\hypersetup{bookmarksnumbered=true, %letterpaper,
pdfstartview={FitBH},
pdfview={FitBH},
bookmarksopenlevel=1,
bookmarksopen,
colorlinks=true,
linkcolor=cyan,
citecolor=cyan,
pagebackref,
linktocpage}`
ma non è detto che servano davvero: sono quelle raccomandate dal Notre Dame Journal.
Ciao
Enrico