summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dataref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-21 23:42:33 +0000
committerKarl Berry <karl@freefriends.org>2015-04-21 23:42:33 +0000
commit142d903dcd96ad083d58f5518aa138a676eb68c0 (patch)
tree0f823f071a1979701ed0c9beaabfd61a13f2e850 /Master/texmf-dist/tex/latex/dataref
parent9dc6d32e5bcebd70ec60d085148b378354a82c96 (diff)
dataref (21apr15)
git-svn-id: svn://tug.org/texlive/trunk@36991 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/dataref')
-rw-r--r--Master/texmf-dist/tex/latex/dataref/dataref.sty54
1 files changed, 40 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/dataref/dataref.sty b/Master/texmf-dist/tex/latex/dataref/dataref.sty
index a08d450e1be..adda58c5552 100644
--- a/Master/texmf-dist/tex/latex/dataref/dataref.sty
+++ b/Master/texmf-dist/tex/latex/dataref/dataref.sty
@@ -25,7 +25,7 @@
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{dataref}
- [2014/10/09 v0.3 dataref]
+ [2015/04/21 v0.4 dataref]
\ifx\drefloaded\undefined
\let\drefloaded=\relax
@@ -59,13 +59,14 @@
\DeclareBoolOption{noassert}
\ProcessKeyvalOptions*
\def\dref@set#1#2{%
- \pgfkeys@temptoks{#2}%
- \expandafter\xdef\csname
- pgfk@\dref@datapath#1\endcsname{\the\pgfkeys@temptoks}%
- \ifdref@refall%
- \expandafter\dref@found\expandafter{\dref@datapath#1}{0}
- \expandafter\dref@referenced\expandafter{\dref@datapath#1}{0}%
- \fi%
+ \edef\dref@set@tmp{#2}%
+ \expandafter\pgfkeys@temptoks\expandafter{\dref@set@tmp}%
+ \expandafter\xdef\csname
+ pgfk@\dref@datapath#1\endcsname{\the\pgfkeys@temptoks}%
+ \ifdref@refall%
+ \expandafter\dref@found\expandafter{\dref@datapath#1}{0}
+ \expandafter\dref@referenced\expandafter{\dref@datapath#1}{0}%
+ \fi%
}
\def\drefset#1#2{\dref@set{#1}{#2}}
@@ -235,7 +236,7 @@
\begingroup%
\pgfset{/pgf/number format/.cd, #1}%
\dref@calc{#2}%
- \pgfmathprintnumberto[fixed,assume math mode=true,precision=10,1000 sep={}]{\pgfmathresult}{\drefresult}
+ \pgfmathprintnumberto[fixed,assume math mode=true,precision=10,1000 sep={}]{\pgfmathresult}{\drefresult}%
\xdef\drefresult{\drefresult}%
\dref@format{\pgfmathresult}%
\dref@mkannotate{\textbackslash drefcalc\{#2\}}%
@@ -245,7 +246,7 @@
\begingroup%
\pgfset{/pgf/number format/.cd, #1}%
\dref@calc{#2}%
- \pgfmathprintnumberto[fixed,assume math mode=true,precision=10,1000 sep={}]{\pgfmathresult}{\drefresult}
+ \pgfmathprintnumberto[fixed,assume math mode=true,precision=10,1000 sep={}]{\pgfmathresult}{\drefresult}%
\xdef\drefresult{\drefresult}%
\endgroup%
}
@@ -388,6 +389,16 @@
& \dref@usagereport@formatreferencelist{#1}%
& \pgfkeysifdefined{#1}{\pgfkeysvalueof{#1}}{\textbf{\color{red}undefined}}%
}
+
+\def\drefusagereportaftergroup{}
+
+\def\drefusagereportbeforerow{}
+\def\drefusagereportbeforetitle{}
+\def\drefusagereportaftertitle{}
+
+\def\drefusagereportbeforedescription{}
+
+
\newif\ifdref@withhelp
\errorcontextlines=23
\newlength{\dreflinewidth}%
@@ -403,6 +414,7 @@
\dref@usagereport@keyheader@firsttrue%
\renewcommand{\do}[1]{%
\dref@help@match{#1}{##1}{%
+ \drefusagereportbeforerow%
\dref@usagereport@keyheader{##1}%
\ifinlistcs{##1}{dref@usagereport@matchedkeys}{}{%
\listcsgadd{dref@usagereport@matchedkeys}{##1}%
@@ -410,15 +422,21 @@
}{}%
}%
\ifdref@withhelp
- \tablehead{\hline & Page & Value \\\hline}%
+ \tablehead{\drefusagereportbeforetitle%
+ \hline & Page & Value %
+ \drefusagereportaftertitle\\\hline%
+ }%
\setlength\tabcolsep{3pt}%
\dreflinewidth=\linewidth%
- \advance\dreflinewidth by -6\tabcolsep%
+ \advance\dreflinewidth by -4\tabcolsep%
+ \advance\dreflinewidth by -2\arrayrulewidth%
\begin{xtabular}{|p{0.7\dreflinewidth}|p{0.15\dreflinewidth}|p{0.15\dreflinewidth}|}%
\dolistcsloop{dref@usagereport@keys}\\\hline
+ \drefusagereportbeforedescription%
\multicolumn{3}{|p{\linewidth}|}{\csuse{dref@help@#1}}\\\hline
\end{xtabular}%
\fi%
+ \drefusagereportaftergroup%
\endgroup%
}
@@ -435,16 +453,24 @@
\dref@usagereport@keyheader@firsttrue%
\renewcommand{\do}[1]{%
\ifinlistcs{##1}{dref@usagereport@matchedkeys}{}{%
+ \drefusagereportbeforerow%
\dref@usagereport@keyheader{##1}%
}%
}%
\ifdref@withouthelp%
- \tablehead{\hline Keys without Description & Page & Value \\\hline}%
+ \tablehead{\drefusagereportbeforetitle%
+ \hline Keys without Description & Page & Value %
+ \drefusagereportaftertitle\\\hline%
+ }%
\setlength\tabcolsep{3pt}%
\dreflinewidth=\linewidth%
- \advance\dreflinewidth by -6\tabcolsep%
+ \advance\dreflinewidth by -4\tabcolsep%
+ \advance\dreflinewidth by -2\arrayrulewidth%
\begin{xtabular}{|p{0.7\dreflinewidth}|p{0.15\dreflinewidth}|p{0.15\dreflinewidth}|}%
\dolistcsloop{dref@usagereport@keys}\\\hline
+ \drefusagereportbeforedescription%
+ \multicolumn{3}{|p{\linewidth}|}{%
+ \emph{For these keys, no description was given}}\\\hline
\end{xtabular}%
\fi%
\endgroup%