texlive[49427] Master/texmf-dist: xltabular (16dec18)
commits+karl at tug.org
commits+karl at tug.org
Sun Dec 16 22:52:40 CET 2018
Revision: 49427
http://tug.org/svn/texlive?view=revision&revision=49427
Author: karl
Date: 2018-12-16 22:52:40 +0100 (Sun, 16 Dec 2018)
Log Message:
-----------
xltabular (16dec18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/xltabular/Changes
trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-doc.pdf
trunk/Master/texmf-dist/tex/latex/xltabular/xltabular.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example-hyp.tex
trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.inp
trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.tex
Modified: trunk/Master/texmf-dist/doc/latex/xltabular/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xltabular/Changes 2018-12-16 21:52:21 UTC (rev 49426)
+++ trunk/Master/texmf-dist/doc/latex/xltabular/Changes 2018-12-16 21:52:40 UTC (rev 49427)
@@ -1,3 +1,4 @@
+2.0a 2018/12/16 - better hyperref support; example files
1.0a 2018/05/23 - restore original tabularx must not be statically
0.05 2017-10-26 - set \keepXColumns
0.04 2017-10-23 - wrong references (RN)
Modified: trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-doc.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example-hyp.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example-hyp.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example-hyp.tex 2018-12-16 21:52:40 UTC (rev 49427)
@@ -0,0 +1,10 @@
+
+%---------------------------
+\setcounter{errorcontextlines}{100}
+\listfiles
+\documentclass{scrbook}
+\usepackage{caption}
+\usepackage{xltabular}
+\usepackage{hyperref}
+\input{xltabular-example.inp}
+%---------------------------
Property changes on: trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example-hyp.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.inp
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.inp (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.inp 2018-12-16 21:52:40 UTC (rev 49427)
@@ -0,0 +1,80 @@
+
+\newcommand*\showCounterTable{%
+ \noindent The Counter \textbf{table:~\arabic{table}}%
+}
+
+\begin{document}
+
+\chapter{Chapter 1}
+\section{Section 1 of Chapter 1}
+
+\showCounterTable
+\begin{xltabular}[l]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:A}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 2 of Chapter 1}
+
+\showCounterTable
+\begin{xltabular}[r]{.7\linewidth}{|c|X|X|}
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 3 of Chapter 1}
+
+\showCounterTable
+\begin{xltabular}[r]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:B}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\chapter{Chapter 2}
+\section{Section 1 of Chapter 2}
+
+\showCounterTable
+\begin{xltabular}[c]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:C}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 2 of Chapter 2}
+
+\showCounterTable
+\begin{xltabular}[c]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:D}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 3 of Chapter 2 -- some references}
+
+\begin{itemize}
+ \item Table~\ref{tab:A} is on page~\pageref{tab:A}
+ \item Table~\ref{tab:B} is on page~\pageref{tab:B}
+ \item Table~\ref{tab:C} is on page~\pageref{tab:C}
+ \item Table~\ref{tab:D} is on page~\pageref{tab:D}
+\end{itemize}
+
+\end{document}
+
+\endinput
Added: trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.tex 2018-12-16 21:52:40 UTC (rev 49427)
@@ -0,0 +1,9 @@
+
+%---------------------------
+\setcounter{errorcontextlines}{100}
+\listfiles
+\documentclass{scrbook}
+\usepackage{caption}
+\usepackage{xltabular}
+\input{xltabular-example.inp}
+%---------------------------
Property changes on: trunk/Master/texmf-dist/doc/latex/xltabular/xltabular-example.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/xltabular/xltabular.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xltabular/xltabular.sty 2018-12-16 21:52:21 UTC (rev 49426)
+++ trunk/Master/texmf-dist/tex/latex/xltabular/xltabular.sty 2018-12-16 21:52:40 UTC (rev 49427)
@@ -6,28 +6,35 @@
% Copyright 2018 Herbert Voss <hvoss at tug.org>
% Rolf Niepraschk <Rolf.Niepraschk at gmx.de>
%%
-\ProvidesPackage{xltabular}[2018/05/23 v0.1a `xltabular' package (hv,RN)]
+\ProvidesPackage{xltabular}[2018/12/16 v0.2a `xltabular' package (hv,RN)]
\RequirePackage{tabularx}
-\let\ORIGi at tabularx=\tabularx
-\let\ORIGi at endtabularx=\endtabularx
-\let\ORIGi at TX@endtabularx=\TX at endtabularx
+\let\XLT at i@tabularx=\tabularx
+\let\XLT at i@endtabularx=\endtabularx
+\let\XLT at i@TX at endtabularx=\TX at endtabularx
%
\RequirePackage{ltablex}
\keepXColumns% xltabular behaves like tabularx
%
-\let\ORIGii at tabularx=\tabularx
-\let\ORIGii at TX@endtabularx=\TX at endtabularx
+\let\XLT at ii@tabularx=\tabularx
+\let\XLT at ii@TX at endtabularx=\TX at endtabularx
+\let\XLT at longtable=\longtable
+\let\XLT at LT@start=\LT at start
+\let\XLT at LT@array=\LT at array
+\@ifundefined{scr at LT@array}{%
+ \AtBeginDocument{%
+ \@ifundefined{adl at LT@array}{}{\let\XLT at adl@LT at array=\adl at LT@array}
+ }
+}{\let\XLT at scr@LT at array=\scr at LT@array}%
+
%
-\let\ORIG at longtable=\longtable
-%
% restore original tabularx
\renewenvironment{tabularx}%
-{\let\TX at endtabularx=\ORIGi at TX@endtabularx\ORIGi at tabularx}
-{\ORIGi at endtabularx}
+{\let\TX at endtabularx=\XLT at i@TX at endtabularx\XLT at i@tabularx}
+{\XLT at i@endtabularx}
%
% define a new tabularx like the one from "ltablex"
%
-\newenvironment{xltabular}[1][x]
+\newenvironment{xltabular}[1][x]%
{\if l#1%
\LTleft\z@ \LTright\fill
\else\if r#1%
@@ -35,22 +42,26 @@
\else\if c#1%
\LTleft\fill \LTright\fill
\fi\fi\fi
- \let\TX at endtabularx=\ORIGii at TX@endtabularx
+ \let\TX at endtabularx=\XLT at ii@TX at endtabularx
\let\endtabularx\endxltabular
- \ORIGii at tabularx}
+ \XLT at ii@tabularx}
{\def\@currenvir{tabularx}}
-% In "longtable" increase the counter "table" only if "\caption" is used
+% in "longtable" increase the counter "table" only if "\caption" is used
\AtBeginDocument{%
- \let\ORIG at LT@capti at n=\LT at capti@n
+ \let\XLT at LT@capti at n=\LT at capti@n
\def\LT at capti@n{%
- \@ifstar{\ORIG at LT@capti at n*}{%
- % We use the following instead of "\refstepcounter"
- \stepcounter{\LTcaptype}%
- % We are inside a group: edef -> xdef
- \protected at xdef\@currentlabel
- {\csname p@\LTcaptype\endcsname\csname the\LTcaptype\endcsname}%
- \ORIG at LT@capti at n
+ \@ifstar{\XLT at LT@capti at n*}{%
+ \XLT at refstepcounter{\LTcaptype}%
+ % because we are inside a group
+ \global\let\@currentlabel=\@currentlabel
+ \ifXLT at HypRef
+ % revert to the patched version
+ \global\let\LT at start=\XLT at Hy@LT at start
+ \hyper at makecurrent{\LTcaptype}%
+ \global\let\Hy at LT@currentHref\@currentHref
+ \fi
+ \XLT at LT@capti at n
}%
}%
}
@@ -57,9 +68,46 @@
%
\providecommand*\LTcaptype{table}% support of package "caption"
\def\longtable{%
- \addtocounter{\LTcaptype}\m at ne
- \ORIG at longtable
-}
+ \ifXLT at HypRef
+ % revert to the unpatched version when \caption is not used
+ \global\let\LT at start=\XLT at LT@start
+ \fi
+ \XLT at longtable
+}
+
+% is not the hyperref version if hyperref is loaded after this package
+\AtEndOfPackage{\let\XLT at refstepcounter=\refstepcounter}
+\newif\ifXLT at HypRef
+\AtBeginDocument{%
+ % is the hyperref version if hyperref is loaded
+ \let\XLT@@refstepcounter=\refstepcounter
+ \@ifpackageloaded{hyperref}{\XLT at HypReftrue}{\XLT at HypReffalse}%
+ \ifXLT at HypRef
+ % save the patched version
+ \let\XLT at Hy@LT at start=\LT at start
+ % revert to the unpatched versions
+ \@ifundefined{scr at LT@array}{%
+ \@ifundefined{adl at LT@array}{%
+ % hyperref has \LT at array patched
+ \let\LT at array=\XLT at LT@array
+ }{%
+ % hyperref has \adl at LT@array patched, not \LT at array
+ \let\adl at LT@array=\XLT at adl@LT at array
+ }%
+ }{%
+ % hyperref has \scr at LT@array patched, not \LT at array
+ \let\scr at LT@array=\XLT at scr@LT at array
+ }%
+ \fi
+ \let\XLT@@LT at array=\LT at array
+ \def\LT at array{%
+ % make the call of \refstepcounter in \XLT@@LT at array ineffective
+ \def\refstepcounter##1{%
+ \let\refstepcounter=\XLT@@refstepcounter
+ }%
+ \XLT@@LT at array
+ }%
+}
%
\endinput
%%
More information about the tex-live-commits
mailing list