summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xltabular
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-02-04 21:37:28 +0000
committerKarl Berry <karl@freefriends.org>2019-02-04 21:37:28 +0000
commitfda9890c96660468200454591e84169e914496b2 (patch)
tree59be87415f99a2a60e466102fcafedafb385ba24 /Master/texmf-dist/tex/latex/xltabular
parent80298c081b9210519347019b19147a97b5cd657f (diff)
xltabular (4feb19)
git-svn-id: svn://tug.org/texlive/trunk@49939 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xltabular')
-rw-r--r--Master/texmf-dist/tex/latex/xltabular/xltabular.sty52
1 files changed, 23 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/xltabular/xltabular.sty b/Master/texmf-dist/tex/latex/xltabular/xltabular.sty
index 329ea83c17b..4684191127b 100644
--- a/Master/texmf-dist/tex/latex/xltabular/xltabular.sty
+++ b/Master/texmf-dist/tex/latex/xltabular/xltabular.sty
@@ -6,7 +6,7 @@
% Copyright 2018 Herbert Voss <hvoss@tug.org>
% Rolf Niepraschk <Rolf.Niepraschk@gmx.de>
%%
-\ProvidesPackage{xltabular}[2018/12/16 v0.2a `xltabular' package (hv,RN)]
+\ProvidesPackage{xltabular}[2019/01/30 v0.2b `xltabular' package (hv,RN)]
\RequirePackage{tabularx}
\let\XLT@i@tabularx=\tabularx
\let\XLT@i@endtabularx=\endtabularx
@@ -47,24 +47,21 @@
\XLT@ii@tabularx}
{\def\@currenvir{tabularx}}
-% in "longtable" increase the counter "table" only if "\caption" is used
-\AtBeginDocument{%
- \let\XLT@LT@capti@n=\LT@capti@n
- \def\LT@capti@n{%
- \@ifstar{\XLT@LT@capti@n*}{%
- \XLT@refstepcounter{\LTcaptype}%
- % because we are inside a group
- \global\let\@currentlabel=\@currentlabel
- \ifXLT@HypRef
- % revert to the patched version
- \global\let\LT@start=\XLT@Hy@LT@start
- \hyper@makecurrent{\LTcaptype}%
- \global\let\Hy@LT@currentHref\@currentHref
- \fi
- \XLT@LT@capti@n
- }%
- }%
-}
+\def\LT@caption{%
+ \noalign\bgroup\XLT@refstepcounter{\LTcaptype}%
+ % because we are inside a group
+ \global\let\@currentlabel=\@currentlabel
+ \@ifundefined{cref@currentlabel}{}{% from package "cleveref"
+ \global\let\cref@currentlabel=\cref@currentlabel
+ }
+ \ifXLT@HypRef
+ % revert to the patched version
+ \global\let\LT@start=\XLT@Hy@LT@start
+ \hyper@makecurrent{\LTcaptype}%
+ \global\let\Hy@LT@currentHref\@currentHref
+ \fi
+ \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n
+}%
%
\providecommand*\LTcaptype{table}% support of package "caption"
\def\longtable{%
@@ -75,12 +72,9 @@
\XLT@longtable
}
-% is not the hyperref version if hyperref is loaded after this package
-\AtEndOfPackage{\let\XLT@refstepcounter=\refstepcounter}
\newif\ifXLT@HypRef
\AtBeginDocument{%
- % is the hyperref version if hyperref is loaded
- \let\XLT@@refstepcounter=\refstepcounter
+ \let\XLT@refstepcounter=\refstepcounter
\@ifpackageloaded{hyperref}{\XLT@HypReftrue}{\XLT@HypReffalse}%
\ifXLT@HypRef
% save the patched version
@@ -88,7 +82,7 @@
% revert to the unpatched versions
\@ifundefined{scr@LT@array}{%
\@ifundefined{adl@LT@array}{%
- % hyperref has \LT@array patched
+ % hyperref has \LT@array patched directly
\let\LT@array=\XLT@LT@array
}{%
% hyperref has \adl@LT@array patched, not \LT@array
@@ -99,13 +93,13 @@
\let\scr@LT@array=\XLT@scr@LT@array
}%
\fi
- \let\XLT@@LT@array=\LT@array
\def\LT@array{%
- % make the call of \refstepcounter in \XLT@@LT@array ineffective
- \def\refstepcounter##1{%
- \let\refstepcounter=\XLT@@refstepcounter
+ % make the call of \refstepcounter inside of \XLT@LT@array ineffective
+ \renewcommand*\refstepcounter[2][]{%
+ % make next calls effective again
+ \let\refstepcounter=\XLT@refstepcounter
}%
- \XLT@@LT@array
+ \XLT@LT@array
}%
}
%