From fda9890c96660468200454591e84169e914496b2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 4 Feb 2019 21:37:28 +0000 Subject: xltabular (4feb19) git-svn-id: svn://tug.org/texlive/trunk@49939 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/xltabular/xltabular.sty | 52 ++++++++++------------ 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'Master/texmf-dist/tex/latex/xltabular') 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 % Rolf Niepraschk %% -\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 }% } % -- cgit v1.2.3