summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/currency
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-10-25 21:34:28 +0000
committerKarl Berry <karl@freefriends.org>2018-10-25 21:34:28 +0000
commit56ff75d2dc5bee2624945e8dd43945f1670e040d (patch)
tree6b9cb281b97f2542f9968a2f592b8e4cfa615e86 /Master/texmf-dist/tex/latex/currency
parent4f28912f38990fab7aac77cdaba57f15b9d4bd0b (diff)
currency (25oct18)
git-svn-id: svn://tug.org/texlive/trunk@48990 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/currency')
-rw-r--r--Master/texmf-dist/tex/latex/currency/currency.sty34
1 files changed, 19 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/currency/currency.sty b/Master/texmf-dist/tex/latex/currency/currency.sty
index c098f2b7f47..5e2baf8f882 100644
--- a/Master/texmf-dist/tex/latex/currency/currency.sty
+++ b/Master/texmf-dist/tex/latex/currency/currency.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2015 by Scott Pakin <scott+dtx@pakin.org>
+%% Copyright (C) 2018 by Scott Lejay
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{currency}
- [2017/05/25 v0.1 .dtx currency file]
+ [2018/10/22 v0.4 .dtx currency file]
\RequirePackage{siunitx}
\RequirePackage{pgfkeys}
\RequirePackage{etoolbox}
@@ -90,18 +90,17 @@
\keys_set:nV {siunitx} {\SetPrecision}%
}}%
\ExplSyntaxOff
-\newcommand{\DefineCurrency}[2]{%
-\pgfkeys{/currency/#1/.style={#2}}%%
-\global\expandafter\DeclareDocumentCommand\csname d#1\endcsname{o m}{%
+\ExplSyntaxOn
+\DeclareDocumentCommand{\displayCurrency}{m o m}{
\begingroup%
\sisetup{round-mode=places,round-precision=2}
-\IfNoValueTF{##1}%
+\IfNoValueTF{#2}%
{\pgfkeys{/currency/.cd,#1,currency}}%
- {\pgfkeys{/currency/.cd,#1,currency,##1}}%
+ {\pgfkeys{/currency/.cd,#1,currency,#2}}%
\ifbool{currencynumber}%
{\sisetup{parse-numbers=true}}%
{\sisetup{parse-numbers=false}}%
-\edef\value{##2}% store the value of the currency
+\edef\value{#3}% store the value of the currency
\ifprintbefore%
\pgfkeys{/currency/font}%
\pgfkeys{/currency/before}%
@@ -117,19 +116,23 @@
\pgfkeys{/currency/after}%
\fi%
\endgroup%
- }%
- % define the currency symbol as \cXXX with one optional argument
- \global\expandafter\DeclareDocumentCommand\csname c#1\endcsname{o}{%
+}
+\DeclareDocumentCommand{\displayCurrencySymbol}{m o}{
\begingroup%
- \IfNoValueTF{##1}%
+ \IfNoValueTF{#2}%
{\pgfkeys{/currency/.cd,#1,currency}}%
-{\pgfkeys{/currency/.cd,#1,currency,##1}}%
+{\pgfkeys{/currency/.cd,#1,currency,#2}}%
\pgfkeys{/currency/font}%
\pgfkeys{/currency/before}%
- \text{\pgfkeys{/currency/prefix}\currencyunit}
+ \text{\pgfkeys{/currency/prefix}\currencyunit}%
\pgfkeys{/currency/after}%
\endgroup%
- }%
+}
+\ExplSyntaxOff
+\newcommand{\DefineCurrency}[2]{%
+\pgfkeys{/currency/#1/.style={#2}}%%
+\csgdef{d#1}{\displayCurrency{#1}}
+\csgdef{c#1}{\displayCurrencySymbol{#1}}
}%
\pgfkeys{/currency/@iso/.style={kind=iso}}
\pgfkeys{/currency/@symb/.style={kind=symbol}}
@@ -138,6 +141,7 @@
\pgfkeys{/currency/@na/.style={kind=name}}
\pgfkeys{/currency/@plural/.style={kind=plural}}
\pgfkeys{/currency/@pl/.style={kind=plural}}
+\pgfkeys{/currency/no-parse/.style={number=false}}
\endinput
%%
%% End of file `currency.sty'.