summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/memoir/mempatch.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/memoir/mempatch.dtx')
-rw-r--r--Master/texmf-dist/source/latex/memoir/mempatch.dtx107
1 files changed, 104 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/memoir/mempatch.dtx b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
index 8888e87e972..9af83830b3e 100644
--- a/Master/texmf-dist/source/latex/memoir/mempatch.dtx
+++ b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
@@ -2,7 +2,7 @@
%
% mempatch.dtx
% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-% Maintainer: Lars Madsen (daleif+memoir at imf dot au dot dk)
+% Maintainer: Lars Madsen (daleif at imf dot au dot dk)
% Copyright 2001 --- 2010 Peter R. Wilson
%
% This work may be distributed and/or modified under the
@@ -20,7 +20,7 @@
%
%
% \fi
-% \CheckSum{514}
+% \CheckSum{612}
%
% \def\dtxfile{\texttt{mempatch.dtx}}
% \def\fileversion{v1.0} \def\filedate{2003/10/04}
@@ -309,6 +309,7 @@
%% With thanks to Heiko Oberdiek, if you use hyperref dated 2006/11/15
%% or later, memhfixc will be automatically loaded after hyperref.
%%
+%% Version 1.16 2013/05/16
%% Version 1.15 2010/08/17
%% Version 1.14 2010/06/10
%% Version 1.13 2010/04/19
@@ -330,7 +331,7 @@
%
%
% \begin{macrocode}
-\ProvidesPackage{memhfixc}[2010/08/17 v1.15 nameref/hyperref package fixes for memoir class]
+\ProvidesPackage{memhfixc}[2013/05/16 v1.16 nameref/hyperref package fixes for memoir class]
% \end{macrocode}
%
% \begin{macro}{\M@hfixcfinish}
@@ -798,6 +799,106 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@footnotemark}
+% \changes{v1.16}{2013/05/08}{Slight change to hyperfootnotes redefinition of \cs{@footnotemark}}
+% When \Lpack{hyperref} is loaded with the \texttt{hyperfootnotes}
+% options, then \cs{@footnotemark} is overwritten, and our added
+% feature which automatically separate multiple footnotes with
+% commas is lost. It is however very easy to resurrect.
+% \begin{macrocode}
+\ifHy@hyperfootnotes
+ \def\@footnotemark{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}%
+ \m@mmf@check% <--- added
+ \nobreak\fi
+ \stepcounter{Hfootnote}%
+ \global\let\Hy@saved@currentHref\@currentHref
+ \hyper@makecurrent{Hfootnote}%
+ \global\let\Hy@footnote@currentHref\@currentHref
+ \global\let\@currentHref\Hy@saved@currentHref
+ \hyper@linkstart{link}{\Hy@footnote@currentHref}%
+ \@makefnmark
+ \hyper@linkend
+ \m@mmf@prepare% <--- added
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax
+ }%
+\fi
+
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \changes{v1.16}{2013/05/14}{Added fix for \cs{@starttoc}}
+% \begin{macro}{\@starttoc}
+% In memoir we altered \cs{@starttoc} such that \cs{tableofcontents}
+% could be used multiple times. \Lpack{hyperref} resets this. So here
+% is our reset of that reset.
+% \begin{macrocode}
+\Hy@AtBeginDocument{%
+ \ifx\hyper@last\@undefined
+ \def\@starttoc#1{%
+ \begingroup\makeatletter
+ \IfFileExists{\jobname.#1}{%
+ \Hy@WarningNoLine{%
+ old #1 file detected, not used; run LaTeX again%
+ }%
+ }{}%
+ \if@filesw
+% \end{macrocode}
+% We rewrite this part to match our definition. The rest is a copy
+% from \texttt{hyperref.sty}.
+% \begin{macrocode}
+ \AtEndDocument{%
+ \expandafter\ifx\csname tf@#1\endcsname\relax
+ \expandafter\newwrite\csname tf@#1\endcsname
+ \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+ \fi
+ }
+ \fi
+ \@nobreakfalse
+ \endgroup
+ }%
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.6k}{2013/05/16}{Added hyperref support for page notes}
+% In order to enable hyperlinks for page notes, we need a few extra
+% things. First of all we only enable hyperlinked page noted if hyper
+% footnotes are enabled, seems a good choice.
+% \begin{macrocode}
+\ifHy@hyperfootnotes
+% \end{macrocode}
+% Record the current hyperref anchor in the page note data.
+% \begin{macrocode}
+ \let\m@m@pnwrite@fourtharg\m@m@pnwrite@fourtharg@hyperref
+% \end{macrocode}
+% Make the note typesetter use the anchor data.
+% \begin{macrocode}
+ \let\pagenoteanchor\pagenotehyperanchor
+% \end{macrocode}
+% Fill in two hook responsable for turning the note marker in the text
+% into a hyperlink. The code is more or less copied from
+% \Lpack{hyperref}'s footnote handling.
+% \begin{macrocode}
+ \newcounter{Hpagenote}
+ \@namedef{mem@pnmm@start@hook}{%
+ \stepcounter{Hpagenote}%
+ \global\let\Hy@saved@currentHref\@currentHref
+ \hyper@makecurrent{Hpagenote}%
+ \global\let\Hy@pagenote@currentHref\@currentHref
+ \global\let\@currentHref\Hy@saved@currentHref
+ \hyper@linkstart{link}{\Hy@pagenote@currentHref}%
+ }
+ \@namedef{mem@pnmm@end@hook}{\hyper@linkend}
+\fi
+
+% \end{macrocode}
+%
% The end of the \Lpack{hyperref} related patches.
%
% \begin{macrocode}