diff options
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/datax/datax.dtx | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Master/texmf-dist/source/latex/datax/datax.dtx b/Master/texmf-dist/source/latex/datax/datax.dtx index 198745020b0..d1f9e5c996f 100644 --- a/Master/texmf-dist/source/latex/datax/datax.dtx +++ b/Master/texmf-dist/source/latex/datax/datax.dtx @@ -17,7 +17,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[2020/02/02] %<package>\ProvidesPackage{datax} -%<package> [2020/11/29 v1.1.1 data import into LaTeX] +%<package> [2021-09-22 v1.1.2 data import into LaTeX] %<package>\RequirePackage{pgfkeys} %<package>\RequirePackage{pgfopts} % @@ -60,7 +60,7 @@ %</driver> % \fi % -%\CheckSum{19} +%\CheckSum{29} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -81,6 +81,7 @@ % \changes{v1.0}{2020/11/15}{Initial version} % \changes{v1.1}{2020/11/17}{Polishing for release} % \changes{v1.1.1}{2020/11/29}{Renaming the plugins, adding Python support} +% \changes{v1.1.2}{2021-09-22}{Removing excessive spaces} % % \GetFileInfo{datax.sty} % \DoNotIndex{} @@ -180,16 +181,17 @@ % Default data file name: \texttt{data.tex} % \begin{macrocode} \pgfkeys{ /packageoptions/dataxfile/.initial=data.tex, } +\pgfkeys{ /packageoptions/siunitxoptions/.initial={}, } % \end{macrocode} % Read any given options into family \texttt{/packageoptions/}. Then introduce % family \texttt{/datax/} where all the variables will be stored. % \begin{macrocode} \ProcessPgfPackageOptions{/packageoptions} -\pgfkeys{ /datax/.is family, datax, % - .unknown/.code={ \pgfkeyssetvalue{ % - \pgfkeyscurrentpath/\pgfkeyscurrentname % - }{ #1 } }, +\pgfkeys{ /datax/.is family, datax,% + .unknown/.code={ \pgfkeyssetvalue{% + \pgfkeyscurrentpath/\pgfkeyscurrentname% + }{ #1 } },% } % \end{macrocode} @@ -202,17 +204,24 @@ }{}{ \PackageWarning{datax}{Cannot read file `\dataxfile'} } +\newif\ifhassiunitx +\@ifpackageloaded{siunitx}{\hassiunitxtrue}{\hassiunitxfalse} % \end{macrocode} % \begin{macro}{\datax} % Include datum. If the supplied tag is unused, print bold question marks (like % |\ref|), and throw a warning. % \begin{macrocode} -\newcommand{\datax}[1]{ - \pgfkeysifdefined{/datax/#1}{ % - \pgfkeysvalueof{/datax/#1} % - }{ % - \PackageWarning{datax}{Data value `#1' undefined}\textbf{??} % - } % +\newcommand{\datax}[2][]{% + \pgfkeysifdefined{/datax/#2}{% + {% + \ifhassiunitx% + \sisetup{\pgfkeysvalueof{/packageoptions/siunitxoptions},#1}% + \fi% + \pgfkeysvalueof{/datax/#2}% + }% + }{% + \PackageWarning{datax}{Data value `#2' undefined}\textbf{??}% + }% } % \end{macrocode} % \end{macro} |