diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/dataref/dataref.pdf | bin | 249409 -> 250799 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/dataref/dataref.dtx | 76 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/dataref/dataref.sty | 41 |
3 files changed, 73 insertions, 44 deletions
diff --git a/Master/texmf-dist/doc/latex/dataref/dataref.pdf b/Master/texmf-dist/doc/latex/dataref/dataref.pdf Binary files differindex dbbc8c98bb8..0a0b2b6f332 100644 --- a/Master/texmf-dist/doc/latex/dataref/dataref.pdf +++ b/Master/texmf-dist/doc/latex/dataref/dataref.pdf diff --git a/Master/texmf-dist/source/latex/dataref/dataref.dtx b/Master/texmf-dist/source/latex/dataref/dataref.dtx index ff126d27305..50fcb2dac9c 100644 --- a/Master/texmf-dist/source/latex/dataref/dataref.dtx +++ b/Master/texmf-dist/source/latex/dataref/dataref.dtx @@ -1,25 +1,21 @@ % \iffalse meta-comment % -% The MIT License (MIT) - % Copyright (c) 2013 Christian Dietrich +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Christian Dietrich % -% Permission is hereby granted, free of charge, to any person obtaining a copy of -% this software and associated documentation files (the "Software"), to deal in -% the Software without restriction, including without limitation the rights to -% use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -% the Software, and to permit persons to whom the Software is furnished to do so, -% subject to the following conditions: -% -% The above copyright notice and this permission notice shall be included in all -% copies or substantial portions of the Software. -% -% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -% FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -% COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -% IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +% This work consists of the files dataref.dtx and dataref.ins +% and the derived file dataref.sty. % \fi % % \iffalse @@ -28,11 +24,11 @@ %</driver> %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{dataref} -%<package> [2015/04/21 v0.4 dataref] +%<package> [2015/09/17 v0.5 dataref] % %<*driver> \documentclass{ltxdoc} -\usepackage[usagereport]{dataref}[2015/04/21] +\usepackage[usagereport]{dataref}[2015/09/17] \EnableCrossrefs \CodelineIndex \RecordChanges @@ -189,6 +185,8 @@ % % The helptext for a key is obtained by using the \cmd{\drefhelp} macro. It checks all defined helps (in linear order, first defined, first matched), and prints the first matching help text. % +% For \textbf{LuaTeX}: When using this \TeX{} engine, only Lua (string.find) +% regular expressions are supported as patterns. % \begin{quote} % \verb|\drefhelp{/med A/mice race}| % \end{quote} @@ -550,12 +548,10 @@ % % \begin{macrocode} \RequirePackage{pgf} +\RequirePackage{iftex} \RequirePackage{kvoptions} \usepgflibrary{fpu} \usepackage{etoolbox} -\let\origforlistloop\forlistloop -\usepackage{etextools} -\let\forlistloop\origforlistloop \RequirePackage{xcolor} % \end{macrocode} @@ -623,12 +619,6 @@ \immediate\write\@auxout{\noexpand\dref@found{\drefcurrentkey}{\dref@thepage}}% }{% \immediate\write\@auxout{\noexpand\dref@notfound{\drefcurrentkey}{\dref@thepage}}% - \ifdref@ignoremissing% - \typeout{Dref warning: undefined key `\drefcurrentkey'}% - \dref@mkannotate{UNDEFINED: \drefcurrentkey}% - \else% - \dref@error{Dref error: undefined key `\drefcurrentkey'}% - \fi% }% \immediate\write\@auxout{\noexpand\dref@referenced{\drefcurrentkey}{\dref@thepage}}% } @@ -688,8 +678,32 @@ % % \begin{macro}{\dref@help@match} % \begin{macrocode} +%% dref@ifstrmatch is copied from etextools, but etextools is +%% incompatible with etoolbox +%% \ifstrmatch{ pattern }{ string }{ true }{ false } +\ifPDFTeX% +\let\dref@strmatch\pdfmatch +\fi +\ifLuaTeX% +\newcommand{\dref@strmatch}[2]{% + \directlua{% + local match = string.find("\luaescapestring{#2}", "\luaescapestring{#1}");% + if match then + tex.print("1"); + else + tex.print("0"); + end + }% +} +\fi +\long\def\dref@firstoftwo#1#2{\z@#1} %% for romannumeral +\long\def\dref@secondoftwo#1#2{\z@#2}%% for romannumeral +\newcommand{\dref@ifstrmatch}[2]{% + \romannumeral\csname dref@% + \ifnum\dref@strmatch{#1}{#2}=1 first\else second\fi oftwo\endcsname% +} \newcommand{\dref@help@match}[2]{% - \ifstrmatch{#1}{#2}% + \dref@ifstrmatch{#1}{#2}% } % \end{macrocode} % \end{macro} @@ -999,7 +1013,7 @@ \expandafter\def\expandafter\dref@usagereport@strippath@\dref@datapath#1\blanktest{#1} \newcommand{\dref@usagereport@strippath}[1]{% - \expandafter\ifstrmatch\expandafter{\expandafter^\dref@datapath.*$}{#1}% + \expandafter\dref@ifstrmatch\expandafter{\expandafter^\dref@datapath.*$}{#1}% {\dref@usagereport@strippath@#1\blanktest}% {#1}% } diff --git a/Master/texmf-dist/tex/latex/dataref/dataref.sty b/Master/texmf-dist/tex/latex/dataref/dataref.sty index adda58c5552..381d57469af 100644 --- a/Master/texmf-dist/tex/latex/dataref/dataref.sty +++ b/Master/texmf-dist/tex/latex/dataref/dataref.sty @@ -22,10 +22,9 @@ %% %% This work consists of the files dataref.dtx and dataref.ins %% and the derived file dataref.sty. - \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{dataref} - [2015/04/21 v0.4 dataref] + [2015/09/17 v0.5 dataref] \ifx\drefloaded\undefined \let\drefloaded=\relax @@ -38,12 +37,10 @@ \def\dref@error#1{\PackageError{dref}{#1}{}}% \fi \RequirePackage{pgf} +\RequirePackage{iftex} \RequirePackage{kvoptions} \usepgflibrary{fpu} \usepackage{etoolbox} -\let\origforlistloop\forlistloop -\usepackage{etextools} -\let\forlistloop\origforlistloop \RequirePackage{xcolor} \SetupKeyvalOptions{ @@ -88,12 +85,6 @@ \immediate\write\@auxout{\noexpand\dref@found{\drefcurrentkey}{\dref@thepage}}% }{% \immediate\write\@auxout{\noexpand\dref@notfound{\drefcurrentkey}{\dref@thepage}}% - \ifdref@ignoremissing% - \typeout{Dref warning: undefined key `\drefcurrentkey'}% - \dref@mkannotate{UNDEFINED: \drefcurrentkey}% - \else% - \dref@error{Dref error: undefined key `\drefcurrentkey'}% - \fi% }% \immediate\write\@auxout{\noexpand\dref@referenced{\drefcurrentkey}{\dref@thepage}}% } @@ -122,8 +113,32 @@ \def\drefref#1{% \dref@unexpandable{#1}% } +%% dref@ifstrmatch is copied from etextools, but etextools is +%% incompatible with etoolbox +%% \ifstrmatch{ pattern }{ string }{ true }{ false } +\ifPDFTeX% +\let\dref@strmatch\pdfmatch +\fi +\ifLuaTeX% +\newcommand{\dref@strmatch}[2]{% + \directlua{% + local match = string.find("\luaescapestring{#2}", "\luaescapestring{#1}");% + if match then + tex.print("1"); + else + tex.print("0"); + end + }% +} +\fi +\long\def\dref@firstoftwo#1#2{\z@#1} %% for romannumeral +\long\def\dref@secondoftwo#1#2{\z@#2}%% for romannumeral +\newcommand{\dref@ifstrmatch}[2]{% + \romannumeral\csname dref@% + \ifnum\dref@strmatch{#1}{#2}=1 first\else second\fi oftwo\endcsname% +} \newcommand{\dref@help@match}[2]{% - \ifstrmatch{#1}{#2}% + \dref@ifstrmatch{#1}{#2}% } \newcommand{\dref@help}[2][]{% \pgfkeysifdefined{#2/help}{% @@ -364,7 +379,7 @@ \expandafter\def\expandafter\dref@usagereport@strippath@\dref@datapath#1\blanktest{#1} \newcommand{\dref@usagereport@strippath}[1]{% - \expandafter\ifstrmatch\expandafter{\expandafter^\dref@datapath.*$}{#1}% + \expandafter\dref@ifstrmatch\expandafter{\expandafter^\dref@datapath.*$}{#1}% {\dref@usagereport@strippath@#1\blanktest}% {#1}% } |