summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/memoir/mempatch.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/memoir/mempatch.dtx')
-rw-r--r--macros/latex/contrib/memoir/mempatch.dtx34
1 files changed, 32 insertions, 2 deletions
diff --git a/macros/latex/contrib/memoir/mempatch.dtx b/macros/latex/contrib/memoir/mempatch.dtx
index 23423d346e..eeb291600c 100644
--- a/macros/latex/contrib/memoir/mempatch.dtx
+++ b/macros/latex/contrib/memoir/mempatch.dtx
@@ -20,7 +20,7 @@
%
%
% \fi
-% \CheckSum{614}
+% \CheckSum{634}
%
% \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.18 2019/10/24
%% Version 1.17 2013/05/30
%% Version 1.16 2013/05/16
%% Version 1.15 2010/08/17
@@ -332,7 +333,7 @@
%
%
% \begin{macrocode}
-\ProvidesPackage{memhfixc}[2013/05/30 v1.17 nameref/hyperref package fixes for memoir class]
+\ProvidesPackage{memhfixc}[2019/10/24 v1.18 nameref/hyperref package fixes for memoir class]
% \end{macrocode}
%
% \begin{macro}{\M@hfixcfinish}
@@ -721,8 +722,12 @@
%
% \begin{macro}{\contcaption}
% Tweak the \cs{contcaption} macro.
+%
+% \changes{v1.18}{2019/10/24}{Added a \cs{par} to get rid of a
+% sporadic space comming from \cs{refstepcounter} under hyperref}
% \begin{macrocode}
\renewcommand{\contcaption}{%
+ \par%
\refstepcounter{memhycontfloat}%
\addtocounter{\@captype}{\m@ne}\H@refstepcounter{\@captype}%
\@contcaption\@captype}
@@ -908,6 +913,31 @@
% \end{macrocode}
%
+%
+% \subsection{Patch after \Lpack{hypcap}}
+%
+% The \Lpack{hypcap} package can help with some hyperref anchor placement in
+% figure refences. But it also requires every figure or table to have
+% a caption, thus it does not understand our \cmd{\contcaption} command.
+%
+% \changes{v3.7i}{2019/10/26}{added patch for \cmd{\contcaption} when
+% \Lpack{hypcap} is loaded}
+% \begin{macrocode}
+\AtEndPackage{hypcap}{%
+ \long\def\@@contcaption##1##2{%
+ \par
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \global\@capstartfalse% added
+ \normalsize
+ \@makecaption{\csname fnum@##1\endcsname}{\ignorespaces ##2}\par
+ \endgroup}
+}
+% \end{macrocode}
+%
% The end of the \Lpack{hyperref} related patches.
%
% \begin{macrocode}