summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/euro/euro.dtx
blob: e65b69c8348d61c9f61b9facca0e8b7b8359e2bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
% \iffalse
%% File: euro.dtx      Copyright (C) 1999--2005    Melchior FRANZ
%% $Id: euro.dtx,v 1.14 2005/03/07 14:22:19 m Exp $
%% $Version: 1.1 $
%<*preamble>
%
%
%
% on Unix/Linux just run "make" to get the style file and the documentation;
% else generate the driver euro.ins (if you don't already have it):
%
%     $ latex euro.dtx
%
% Now generate the style file:
%
%     $ tex euro.ins
%
% And finally to produce the documentation run LaTeX three times:
%
%     $ latex euro.dtx
%
%
%
%
% This package needs the fp-package!
%
% fp      -- CTAN//macros/latex/contrib/other/fp/  --  (by Michael MEHLICH)
%
%$
%% ====================================================================
%%  @LaTeX-package-file{
%%     author          = "Melchior FRANZ",
%%     version         = "1.1",
%%     date            = "7 March 2005",
%%     filename        = "euro.dtx",
%%     address         = "Melchior FRANZ
%%                        Rieder Hauptstrasse 52
%%                        A-5212 SCHNEEGATTERN
%%                        AUSTRIA",
%%     telephone       = "++43 7746 3109",
%%     URL             = "http://members.aon.at/mfranz/TeX/",
%%     email           = "mfranz \# aon : at",
%%     codetable       = "ISO/ASCII",
%%     keywords        = "euro",
%%     supported       = "yes",
%%     docstring       = "This document describes the euro package, which
%%                        converts arbitrary national currency amounts
%%                        using the Euro as base unit, and typesets monetary amounts
%%                        in almost any desired way. Write e.g. \ATS{17.6} to get
%%                        something like `17,60 \"oS  (1,28 Euro)' automatically.
%%                        Conversion rates for the so-called Euro-zone countries
%%                        are already built-in. Further rates can be added easily."
%%  }
%% ====================================================================
%
% COPYRIGHT NOTICE:
% This package is free software that can be redistributed and/or modified
% under the terms of the LaTeX Project Public License as specified
% in the file macros/latex/base/lppl.txt on any CTAN archive server.
%
% Note that you may freely distribute modified versions of this documentation, with one
% exception: If you modify or remove section "The European Union & Software Patents",
% you agree that your and/or your company's/institution's name may be listed in said
% section in any official distribution.
%</preamble>
%
%
%
%<*batchfile>
\begin{filecontents}{euro.ins}
\def\batchfile{euro.ins}
\input docstrip.tex
\askforoverwritefalse
\keepsilent
\generate{\file{euro.sty}{\from{euro.dtx}{package}}}
\endbatchfile
\end{filecontents}
%</batchfile>
%
%
%<*driver>
\def\fileversion{1.1}
\def\filedate{2005/03/07}
\documentclass{ltxdoc}
%
%
%
\ifx\makehyperref\EUROundefined
    \newcommand*\texorpdfstring[2]{#1}
    \newcommand*\color[1]{}
\else   ^^A for "make hyper"
    \usepackage{hyperref}
    \hypersetup{
        bookmarksopen,
        colorlinks,
        pdftitle={The euro package},
        pdfauthor={Melchior FRANZ},
        pdfsubject={${}$Id: euro.dtx,v 1.14 2005/03/07 14:22:19 m Exp ${}$},
        pdfkeywords={currency, euro, monetary, conversion}
    }
    \usepackage[pdftex]{graphicx,color}
\fi
%
%
%
\IfFileExists{euro.sty}
  {\usepackage{euro}[1999/05/15]\let\EUROSTYfound\active}
  {\GenericWarning{euro.dtx}
    {Package file `euro.sty' not found. All the instructive^^J^^A
    examples will be replaced by boldfaced question marks.^^J^^A
    (Generate `euro.sty' by (La)TeXing `euro.ins' and process^^J^^A
    `euro.dtx' three times to get the documentation right.)^^J}
  \newcommand*\EURO[1]{\EUROii}
  \newcommand*\EUROii[2][]{\textbf{??}}
  \newcommand*\EUROFORMAT[2]{}
  \newcommand*\EUROADD[3]{}
  \newcommand*\EUROSYM[2]{}}
%
\usepackage{multicol}
\setcounter{tocdepth}{2}
\begin{document}
\DocInput{euro.dtx}
\end{document}
%</driver>
% \fi
%
%
% \CheckSum{452}
% \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
%   Lower-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
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \newcommand*\opt{\textsf}
% \newcommand*\DescribeOption[1]{\leavevmode
%   \marginpar{\raggedleft\opt{\strut#1\strut}}\ignorespaces}
%
% \newcommand*\ATS{\EURO{ATS}}
% \newcommand*\EUR{\EURO{EUR}}
% \newcommand*\DEM{\EURO{DEM}}
% \newcommand*\ESP{\EURO{ESP}}
% \newcommand*\ITL{\EURO{ITL}}
% \newcommand*\USD[1]{{%
%   \EUROFORMAT{main}{\in}%
%   \EUROFORMAT{in}{\val\,\$}%
%   \EUROFORMAT{EUR}{\form,.,\round{-2}}%
%   \EURO{EUR}{#1}}}
% \newcommand*\NUM[1]{{%
%   \EUROFORMAT{main}{\in}%
%   \EUROFORMAT{in}{\val}%
%   \EUROFORMAT{EUR}{\form,.,\round{-10}}%
%   \EURO{EUR}{#1}}}
%
%
% \makeatletter
% ^^A Don't use this! It's really ugly!      :-(
% \newcommand*\euro{\unitlength.7em
%   \begin{picture}(1.2,1)(-.2,.1)
%     \linethickness{.05em}
%     \qbezier(.8,.9)(.5,1.2)(.1,.87)
%     \qbezier(.1,.87)(-.0,.78)(0,.5)
%     \qbezier(.0,.5)(-.0,.22)(.35,.1)
%     \qbezier(.35,.1)(.54,.02)(.77,.22)
%     \put(-.12,.65){\line(1,0){.9}}
%     \put(-.12,.46){\line(1,0){.8}}
%   \end{picture}}
%
% \newenvironment{example}[1][.45\textwidth]
%   {\par\medskip\begin{tabular}{p{#1}l}}
%   {\end{tabular}\noindentafter\medbreak}
%
% \newenvironment{syntax}
%   {\par\medskip\def\<##1>{$\langle$\textit{##1}$\rangle$}%
%    \indent\begin{tabular}{l}}
%   {\end{tabular}\noindentafter\medbreak}
%
% \newcommand*\noindentafter{\@nobreaktrue\everypar{{\setbox\z@\lastbox}}}
%
% \newenvironment{labeling}[1]
%  {\list{}{\settowidth{\labelwidth}{\textbf{#1}}
%  \leftmargin\labelwidth\advance\leftmargin\labelsep
%  \def\makelabel##1{\textbf{##1}\hfil}}}{\endlist}
%
% \makeatother
%
% \changes{v0.1}{1999/02/01}{initial version}%
% \changes{v0.2}{1999/05/15}{interface completely new; integer rounding implemented}%
% \changes{v1.0}{2001/10/12}{greek currency added}%
% \changes{v1.1}{2003/02/19}{specific currency formats inherit generic settings}%
%
%
%
%
% \title{The \texttt{euro} package}
% \author{Melchior \textsc{FRANZ}}
% \date{March 7, 2005}
% \maketitle
%
%
%
% \begin{abstract}
% \EUROSYM{EUR}{\euro}^^A  introduce the Euro symbol for within the abstract only
%
% This article describes the |euro| package^^A
%      \footnote{This package has version number \fileversion, last revised \filedate.},
% which converts arbitrary currency units into each other using the \emph{Euro}
% (official symbol \euro
%      \footnote{The \euro\ symbol in this documentation is
%      `handmade'---it is really ugly and not to be used in real documents. Take the well designed symbol
%      defined e.\,g.~in the |eurosym| package by \textsc{Henrik Theiling} eventually using
%      the |eurofont| package by \textsc{Rowland McDonnell} to select the proper fo(u)nt/shape.}^^A
% ) as base unit, and formats monetary amounts in almost any desired way.
% The respective conversion rates are predefined for the national
% currency units of the \emph{Euro-zone} countries, every other
% currency unit can easily be added.
% The package allows to type e.\,g.\ |\ATS{17.6}| to get something
% like \ATS{17.6}. All necessary calculations are with high precision done
% by the great |fp| package^^A
%      \footnote{\(\langle\)|CTAN//macros/latex/contrib/other/fp/|\(\rangle\)}
% by \textsc{Michael Mehlich},
% which you have to install to get this package working.
% The package complies with the concerned rules and orders of the European
% Council.
% \end{abstract}
%
%
%
% {\setlength{\parskip}{0pt}\tableofcontents}
% \addtocontents{toc}{\protect\begin{multicols}{2}}
%
%
% \section{Introduction}
%
% Twelve of the fifteen members of the European Union have agreed
% to replace their national currencies by a common currency, the
% \emph{Euro}. Before the 1\textsuperscript{st} of January 2001 the Euro was only a
% unit for calculations, with fixed conversion rates for
% each of the old currencies. Since then the Euro is actual money with
% coins and bank notes. The Francs, the D-Mark, the Schilling,
% they are history.
% Several further countries will join the European Union over
% the next years, and sooner or later also the so-called \emph{Euro-zone}.
% It's still common practice in Europe to write monetary amounts both in the national
% currency and in the new \euro~currency,
% thus helping to become familiar with the \emph{Euro}.
%
% But it's a nuisance to convert every value by hand or even with
% a calculator. Let our computers do all the hard work.
% Although \TeX\ is unable to do such calculations with
% its basic arithmetic functions, there's a way out: The |fp| package
% allows to deal with numbers ranging from
% \(-999999999999999999{,}999999999999999999\) to
% \(+999999999999999999{,}999999999999999999\) with high precision.
%
% Since there are so many currencies and different possible formats,
% this package provides only a customizable interface. All parameters are
% predefined in a common way, though, so that no further definitions will be
% necessary in most cases. The package tries to load an optional file
% `|euro.cfg|' where such local customizing commands may be placed in
% (see section~\ref{sec:config} for further explanation).
%
%
%
%
%
% \section{How to use the package}
%
% \subsection{The main macro}
%
% The \DescribeMacro{\EURO}|\EURO| command does the main work.
% It takes the \textit{source currency unit,} an optional \textit{destination currency unit,}
% both as three-digits \textsc{ISO} currency codes (see table \ref{tab:iso}), and
% the respective \emph{money amount}.
%
% \begin{syntax}
% |\EURO{|\<source currency unit>|}[|\<destination currency unit>|]{|\<amount>|}|
% \end{syntax}
%
%
% \begin{table}
% \begin{quote}
% \begin{center}
% \begin{tabular}{ll@{\hspace{2cm}}ll}
% \texttt{EUR}& Europe&    \texttt{GRD}& Greece\\
% \texttt{ATS}& Austria&   \texttt{IEP}& Ireland\\
% \texttt{BEF}& Belgium&   \texttt{ITL}& Italy\\
% \texttt{DEM}& Germany&   \texttt{LUF}& Luxembourg\\
% \texttt{ESP}& Spain&     \texttt{NLG}& The Netherlands\\
% \texttt{FIM}& Finland&  \texttt{PTE}& Portugal\\
% \texttt{FRF}& France
% \end{tabular}
%
% \caption{ISO currency codes of the \emph{Euro} and of the twelve \emph{Euro-zone} countries.}
% \label{tab:iso}
% \end{center}
% \end{quote}
% \end{table}
%
% A dot is to be used as \emph{decimal `point'} separating a number's integer and
% fractional part. Numbers may of course be negative.
% If the optional destination currency unit is omitted, the \emph{Euro} is taken.
%
% \begin{example}
% |\EURO{BEF}[FIM]{70}|&  \EURO{BEF}[FIM]{70}\\
% |\EURO{FIM}[BEF]{70}|&  \EURO{FIM}[BEF]{70}\\
% |\EURO{BEF}[BEF]{70}|&  \EURO{BEF}[BEF]{70}\rlap{\hspace{3.5em}[surprised?]}\\
% |\EURO{FIM}{17.8}|&     \EURO{FIM}{17.8}
% \end{example}
% \null
%
%
%
%
% \subsection{How to change the local style}
%
% The ISO currency codes don't really look good in running text. You
% can replace them by some other currency symbol or tag using the
% \DescribeMacro{\EUROSYM}|\EUROSYM| command.
%
% \begin{syntax}
% |\EUROSYM{|\<currency unit>|}{|\<symbol>|}|
% \end{syntax}
%
% We Austrians, for example, prefer to write `\"oS' instead of `ATS'.
% We don't have to write |\EUROSYM{ATS}{\"oS}| though, because this national
% style (like those of some other countries) is already predefined. If your
% national style is still missing, please drop me a line, and I will insert it.
% Meanwhile the \textsc{ISO} currency codes are used in such cases.
%
% \begin{example}
% |\EURO{FRF}{16.3}|&      \EURO{FRF}{16.3}\\
% |\EUROSYM{FRF}{Francs}|&\\
% |\EURO{FRF}{16.3}|&      \EUROSYM{FRF}{Francs}\EURO{FRF}{16.3}
% \end{example}
%
% The official Euro symbol is not provided by default, since there are a lot of
% different fonts and methods to produce an \euro\ sign. Type
% |\EUROSYM{EUR}{|\(\langle\)\textit{euro symbol}\(\rangle\)|}| to
% replace the word `Euro' with your local \euro\ sign.
% (I'm still hoping that some day the text companion fonts will contain the official in
% addition or instead of the phantasy \emph{Euro} symbols.)
% This documentation, for example, says |\EUROSYM{EUR}{\euro}|
% because it has its own |\euro| symbol built-in. (Isn't it beautiful?)
%
% \begin{example}
% |\EURO{LUF}{137.8}|&      \EURO{LUF}{137.8}\\
% |\EUROSYM{EUR}{\euro}|&\\
% |\EURO{LUF}{137.8}|&      \EUROSYM{EUR}{\euro}\EURO{LUF}{137.8}
% \end{example}
%
% \EUROSYM{EUR}{\euro}    ^^A define this globally now
%
%
% Writing e.\,g.~|\EURO{ATS}{...}| again and again is cumbersome, so it's recommended to
% define macros for the most often used currency units. You may put such definitions
% into your local configuration file (see section~\ref{sec:config}).
%
% \begin{example}
% |\newcommand*\ATS{\EURO{ATS}}|\\
% |\ATS{9.90}|& \ATS{9.90}\\
% |\ATS[ITL]{19.90}|& \ATS[ITL]{19.90}
% \end{example}
% \null
%
%
%
%
% \subsection{The package options}
% \label{sec:options}
%
% The |euro| package provides six package options. See table~\ref{tab:options} for
% a short demonstration.
%
% \begin{labeling}{\opt{emdash}~~}
% \item[\textbf{\opt{eco}}]
%   The \opt{eco} option typesets monetary amounts as, I think,
%   economists prefer it, with \textsc{ISO} codes preceding the values.
% \item[\textbf{\opt{dots}}]
%   The \opt{dots} option inserts dots as three-digits group
%   separators. (Default is a little space like \rule{.4pt}{.75em}\,\rule{.4pt}{.75em}.)
% \item[\textbf{\opt{table}}]
%   Turns the \emph{table mode} globally on.
%   While integers are normally printed without decimal point and fractional part (sic!),
%   it may especially in tables be desirable to typeset a decimal point followed by a dash.
%   See section \ref{sec:align} for how to keep this behavior local to a particular table.
% \item[\textbf{\opt{emdash}}]
%   Lets the \opt{table} dashes be `---'. Doesn't turn on \emph{table mode}.
%   (This option is selected by default, so it doesn't make much sense at
%   the moment. But this might change some day.)
% \item[\textbf{\opt{endash}}]
%   Lets the \opt{table} dashes be `--'. Doesn't turn on \emph{table mode}.
% \item[\textbf{\opt{zeros}}]
%   Lets zeros be printed instead of dashes. Doesn't turn on \emph{table mode}.
% \end{labeling}
%
%
% \begin{table}
% \begin{center}
%^^A the options are only faked here   ;-)
% \makeatletter
% \begin{tabular}{lr}%
% |\EURO{ATS}{1000}| with&\\[.5ex]
% \hline\\[-1.5ex]
% (default settings)&
%   \EURO{ATS}{1000}\\
% \opt{dots}&\let\EURO@lsep.\let\EURO@rsep.^^A
%   \EURO{ATS}{1000}\\
% \opt{endash}&\let\EURO@table\EURO@endash
%   \EUROFORMAT{main}{\table\in\ (\out)}^^A
%   \EURO{ATS}{1000}\\
% \opt{emdash}&\let\EURO@table\EURO@emdash
%   \EUROFORMAT{main}{\table\in\ (\out)}^^A
%   \EURO{ATS}{1000}\\
% \opt{zeros}&\let\EURO@table\EURO@zeros
%   \EUROFORMAT{main}{\table\in\ (\out)}^^A
%   \EURO{ATS}{1000}\\
% \opt{eco}&
%   \EUROFORMAT{in}{\iso~\val}^^A
%   \EUROFORMAT{out}{\iso~\val}^^A
%   \EURO{ATS}{1000}\\
% \opt{eco,endash}&\let\EURO@table\EURO@endash
%   \EUROFORMAT{main}{\table\in\ (\out)}^^A
%   \EUROFORMAT{in}{\iso~\val}^^A
%   \EUROFORMAT{out}{\iso~\val}^^A
%   \EURO{ATS}{1000}\\
% \opt{eco,emdash}&\let\EURO@table\EURO@emdash
%   \EUROFORMAT{main}{\table\in\ (\out)}^^A
%   \EUROFORMAT{in}{\iso~\val}^^A
%   \EUROFORMAT{out}{\iso~\val}^^A
%   \EURO{ATS}{1000}\\
%   \end{tabular}
% \end{center}
% \caption{Package options}
% \label{tab:options}
% \end{table}
%
%
%
%
% \subsection{Adding currency units}
%
% If some day further countries will join the \emph{Euro-zone,} you can easily
% add their currency units to your document files or, better, to
% your local `|euro.cfg|' configuration file.
% The |euro| package will then, of course, be updated as soon as possible.
%
% \begin{syntax}
% |\EUROADD{|\<ISO code>|}{|\<national style/symbol>|}{|\<conversion rate>|}|
% \end{syntax}
%
% The conversion rate describes, how many units of the new currency
% equal 1~\euro. You can also add currencies, that will
% probably never become member of the \emph{Euro-zone,} like the US-\$. But be aware that such
% conversion rates may change daily/hourly! See \(\langle\)|http://europa.eu.int/|\(\rangle\) for the
% actual rates. The used \textsc{ISO} code serves as identifier for the
% respective currency unit.
%
% \EUROADD{GBP}{\textit{\char`\$}}{0.6694}
% \begin{example}
% |%  1 Euro = 0.6694 Pound Sterling    (March 11, 1999)|\hspace*{-4.5cm}\\
% |%|\\
% |\EUROADD{GBP}{\textsterling}{0.6694}|\hspace*{-3cm}\\
% |\newcommand*\GBP{\EURO{GBP}}|\\
% \\
% |\GBP{47.11}|&            \EURO{GBP}{47.11}\\
% |\GBP[FRF]{47.11}|&       \EURO{GBP}[FRF]{47.11}\\
% |\EURO{EUR}[GBP]{1}|&     \EURO{EUR}[GBP]{1}
% \end{example}
%
% The pound symbol in this example looks a bit too slanted. You'd better take
% |\textsterling| from the |textcomp| package, which I didn't.
%
%
%
%
%
%
% \section{Further customization}
% \label{sec:format}
%
% The desirable format for monetary amounts may differ from country to country and from purpose to purpose.
% The |euro| package uses three kinds of format strings to customize the format, each of which may
% consist of some \emph{reserved keywords} and any other \TeX\ commands. It's a good idea
% to put such commands in your local configuration file (see section~\ref{sec:config}).
%
%
%
% \subsection{The main format}
%
% The main format defines how source and destination currency shall be arranged.
%
% \begin{syntax}
% |\EUROFORMAT{main}{|\<main format string>|}|
% \end{syntax}
%
% The \emph{reserved keywords} |\in| and |\out| stand for the source and the destination currency.
% The following table shows some possible formats with the first line showing the
% default definition.
%
% \begin{example}[.58\hsize]
%                                         & |\EURO{ATS}{30}| yields\\[.5ex]
% \hline\\[-1.5ex]
% |\EUROFORMAT{main}{\in\ (\out)}|&         \EURO{ATS}{30}\\
% |\EUROFORMAT{main}{\in\slash\out}|&       \EUROFORMAT{main}{\in\slash\out}\EURO{ATS}{30}\\
% |\EUROFORMAT{main}{\in\ ($=$\,\out)}|&    \EUROFORMAT{main}{\in\ ($=$\,\out)}\EURO{ATS}{30}\\
% |\EUROFORMAT{main}{\in\ (that is \out)}|& \EUROFORMAT{main}{\in\ (that is \out)}\EURO{ATS}{30}\\
% |\EUROFORMAT{main}{\out}|&                \EUROFORMAT{main}{\out}\EURO{ATS}{30}
% \end{example}
% \null
%
%
%
%
% \subsection{The currency format}
%
%
% The currency format defines how the source and the destination currency
% shall be formatted.
%
% \begin{syntax}
% |\EUROFORMAT{in}{|\<currency format string>|}|\\
% |\EUROFORMAT{out}{|\<currency format string>|}|
% \end{syntax}
%
% The \emph{reserved keywords} |\val|, |\iso| and |\sym| have a special meaning, but
% almost every other \TeX\ command may be used as well.
%
% \medskip\indent
% \begin{tabular}{@{\texttt\bgroup}l@{\egroup\quad}p{.8\hsize}}
% \string\val&   monetary amount\\
% \string\iso&   \textsc{ISO} currency code\\
% \string\sym&   national currency style\slash tag (if defined; \textsc{ISO} code else)\\
% \end{tabular}
%
% \medskip\noindent
% For some currency units
% the |\sym| command produces only the \textsc{ISO} code instead of the national style,
% which I didn't know. This will (with your help!) be changed in future releases.
% The following table shows the most obvious arrangements. All said about the |in| format
% string is also true for the |out| format.
%
% {\EUROFORMAT{main}{\in}\newcommand\EUROaux{\hspace{1.2cm}}
% \begin{example}[.58\textwidth]
% with |\EUROFORMAT{main}{\in}|  & |\EURO{ATS}{30}| yields\\
% \hspace{2cm}and&\\[.5ex]
% \hline\\[-1.5ex]
% |\EUROFORMAT{in}{\val~\sym}|&  \EUROaux\EURO{ATS}{30}\\
% |\EUROFORMAT{in}{\val~\iso}|&  \EUROaux\EUROFORMAT{in}{\val~\iso}\EURO{ATS}{30}\\
% |\EUROFORMAT{in}{\sym~\val}|&  \EUROaux\EUROFORMAT{in}{\sym~\val}\EURO{ATS}{30}\\
% |\EUROFORMAT{in}{\iso~\val}|&  \EUROaux\EUROFORMAT{in}{\iso~\val}\EURO{ATS}{30}
% \end{example}}
% \null
%
%
%
%
%
%
%
% \subsection{The number format}
%
% The number format, finally, defines how the numbers themselves should be
% typeset considering positive\slash negative numbers, rounding and so on.
%
% \begin{syntax}
% |\EUROFORMAT{all}{|\<number format>|}|\\
% |\EUROFORMAT{|\<ISO currency code>|}{|\<number format>|}|
% \end{syntax}
%
% The definitions labeled with |all| will be used for all currency units.
% By using |\EUROFORMAT| with one of the three-digits \textsc{ISO} codes
% as the first argument, these general settings can be overridden for this
% currency.
% Only the \emph{Italian Lira} is defined this way by default, because it
% wouldn't make sense to write \emph{Lira} amounts with two fractional digits
% like the other European currencies.^^A
% \footnote{The package, for example, says something like
% \texttt{\string\EUROFORMAT\char`\{ITL\char`\}\char`\{\string\round\char`\{0\char`\}\char`\}}.} ^^A   8-P
%
% The \textit{number format string} may contain the commands |\form|,
% |\round|, |\zero|, |\plus|, and |\minus|, each of which takes one or
% more arguments. You have only to mention the points that shall differ
% from the default behavior.
% Such a number format might look horrible like this
%
% \begin{example}
% |\EUROFORMAT{all}{%|\\
% |  \form{\,}{,}{\,}%|\\
% |  \round{-2}%|\\
% |  \zero{0}{0}{}%|\\
% |  \plus{}{}%|\\
% |  \minus{\(-\)}{}}|
% \end{example}
%
% which, by fortune, is the predefined default format\footnote{Well, that is a lie: In fact,
% it is only the equivalent of the default definition, which is defined in another way.},
% but it might as well be empty or contain only one of the commands and its arguments.
% Here again all arguments are predefined quite reasonably, so you won't have
% to bother with these verbose definitions.
%
% To make further explanations easier, figure~\ref{fig:nomencl} describes the elements
% that a number may consist of (using my own nomenclature).
%
% \begin{center}
% \begin{figure}
% {\setlength{\unitlength}{1mm}
% \begin{picture}(80,60)(-15,10)
%   \put(50,55){\makebox(0,0)[l]{preamble}}
%     \put(48,55){\line(-1,0){46.5}}
%     \put(1.5,55){\line(0,-1){27}}
%   \put(50,50){\makebox(0,0)[l]{integer part}}
%     \put(3,24){\makebox(8,10){\downbracefill}}
%     \put(48,50){\line(-1,0){41}}
%     \put(7,50){\line(0,-1){19}}
%   \put(50,45){\makebox(0,0)[l]{decimal point}}
%     \put(48,45){\line(-1,0){36.5}}
%     \put(11.5,45){\line(0,-1){17}}
%   \put(50,40){\makebox(0,0)[l]{fractional part}}
%     \put(12.5,24){\makebox(11,10){\downbracefill}}
%     \put(48,40){\line(-1,0){30}}
%     \put(18,40){\line(0,-1){9}}
%   \put(50,35){\makebox(0,0)[l]{postamble (none in this example)}}
%     \put(48,35){\line(-1,0){23}}
%     \put(25,35){\line(0,-1){7}}
% \put(0,25){\makebox(0,0)[l]{\(-\)1 000,234 567}}
%   \put(50,15){\makebox(0,0)[l]{fractional group separator}}
%     \put(48,15){\line(-1,0){30}}
%     \put(18,15){\line(0,1){8}}
%   \put(50,10){\makebox(0,0)[l]{integer group separator}}
%     \put(48,10){\line(-1,0){43}}
%     \put(5,10){\line(0,1){13}}
% \end{picture}}
% \caption{Elements that a number may consist of.}
% \label{fig:nomencl}
% \end{figure}
% \end{center}
%
%
%
%
%
% \subsubsection{The \texttt{\char`\\form} command}
%
% The \DescribeMacro{\form}|\form| command takes three arguments: the \emph{integer group separator},
% the \emph{decimal point} and the \emph{fractional group separator}.
%
% \begin{syntax}
% |\form|\\
% |  {|\<integer group separator>|}|\\
% |  {|\<decimal point>|}|\\
% |  {|\<fractional group separator>|}|
% \end{syntax}
%
%
% \begin{description}
% \item[group separators:]
%   separate groups of three decimal digits to improve legibility of bigger numbers.
%   It's a small space by default, but taking a space, a dot or just nothing might be
%   desirable in some cases.
% \item[decimal point:]
%   separates a number's integer part from the fractional part. It's a comma by default.
%
%   {\EUROFORMAT{main}{\in}
%   \EUROFORMAT{in}{\align\val\hspace*{1cm}}
%   \newcommand*\test[3]{\EUROFORMAT{EUR}{\form{#1}{#2}{#3}}\EURO{EUR}{1000.12345}}
%   \medskip\noindent
%   \begin{center}
%   \begin{tabular}{lr}
%   |\form{.}{,}{.}|&        \test{.}{,}{.}\\
%   |\form{\,}{,}{\,}|&      \test{\,}{,}{\,}\\
%   |\form{~}{,}{~}|&        \test{~}{,}{~}\\
%   |\form{}{,}{}|&          \test{}{,}{}\\
%   |\form{,}{.}{,}|&        \test{,}{.}{,}\\
%   |\form{,}{$\cdot$}{,}|&  \test{,}{$\cdot$}{,}
%   \end{tabular}
%   \end{center}}
% \end{description}
%
%
%
%
% \subsubsection{The \texttt{\char`\\round} command}
%
% The \DescribeMacro{\round}|\round| command takes the \emph{rounding number} as argument.
%
% \begin{syntax}
% |\round{|\<rounding number>|}|
% \end{syntax}
%
% It describes where to round the given money amount. Positive values round to integer digits,
% negative numbers round to fractional digits. Numbers lower than \(-9\) suppress rounding.
%
%   {\EUROFORMAT{main}{\align\in}
%   \EUROFORMAT{in}{\val}
%   \newcommand*\test[1]{\EUROFORMAT{EUR}{\round{#1}}\EURO{EUR}{12345.67898765}}
%   \medskip\noindent
%   \begin{center}
%   \begin{tabular}{r@{\hspace{1cm}}r@{\hspace{1.8cm}}}%
%   \textit{rounding}& \textit{result}\\[.5ex]
%   \hline\\[-1.5ex]
%    |-10|&      \test{-10}\\
%    |-4|&      \test{-4}\\
%    |-3|&      \test{-3}\\
%    |-2|&      \test{-2}\\
%    |-1|&      \test{-1}\\
%    |0|&       \test{0}\\
%    |1|&       \test{1}\\
%    |2|&       \test{2}\\
%    |3|&       \test{3}\\
%    |4|&       \test{4}\\
%    |5|&       \test{5}
%   \end{tabular}
%   \end{center}}
%
%
%
%
% \subsubsection{The \texttt{\char`\\zero} command}
%
% The \DescribeMacro{\zero}|\zero| command describes how to deal with zeros. It takes
% three arguments: the \emph{overall zero} part, the \emph{integer zero} part and the
%  \emph{fractional zero} part.
%
% \begin{syntax}
% |\zero{|\<overall zero>|}{|\<integer zero>|}{|\<fractional zero>|}|
% \end{syntax}
%
% \noindent
% The following table shows some of the possible settings. The first entry is
% the predefined one, which should be used for running text.
% The last line shows the number format that is obtained in table mode with
% the default style \DescribeOption{emdash}\opt{emdash} selected.
%
%   {\makeatletter
%   \EUROFORMAT{main}{\align\in}
%   \EUROFORMAT{in}{\val}
%   \newcommand*\test[4]{\EUROFORMAT{EUR}{\zero{#1}{#2}{#3}}\EURO{EUR}{#4}}
%   \def\|{\hspace{.1em}}
%   \medskip\noindent
%   \begin{center}
%   \begin{tabular}{rr@{\hspace{1cm}}r@{\hspace{1cm}}r@{\hspace{1cm}}}%
%                    & \texttt{0\rlap{.0}} & \texttt{0\rlap{.3}} & \texttt{3\rlap{.0}}\\[.5ex]
%   \hline\\[-1.5ex]
%   |\zero{0}{0}{}|&  \test{0}{0}{}{0}& \test{0}{0}{}{0.3}& \test{0}{0}{}{3.0}\\
%   |\zero{0}{0}{,00}|&  \test{0}{0}{,00}{0}& \test{0}{0}{,00}{0.3}& \test{0}{0}{,00}{3.0}\\
%   |\zero{0}{}{}|&  \test{0}{}{}{0}& \test{0}{}{}{0.3}& \test{0}{}{}{3.0}\\
%   |\zero{---\EURO@align{,---}}{---}{,---}|&
%     \quad\test{---\EURO@align{,---}}{---}{,---}{0}&
%     \test{---\EURO@align{,---}}{---}{,---}{0.3}&
%     \test{---\EURO@align{,---}}{---}{,---}{3.0}\\
%   |\zero{0}{---}{,---}|&
%     \test{0}{---}{,---}{0}&
%     \test{0}{---}{,---}{0.3}&
%     \test{0}{---}{,---}{3.0}\\
%   \end{tabular}
%   \end{center}}
%
% \bigskip\noindent
% The |\EURO@align| command will get replaced by |\rlap| if alignment was requested.
% You only have to state it in the first argument, if you want to align zero
% amounts in tables.
%
%
%
%
% \subsubsection{The \texttt{\char`\\plus} and \texttt{\char`\\minus} commands}
%
% The \DescribeMacro{\plus}|\plus| and |\minus| commands allow to
% define a preamble\slash postamble for positive and negative numbers, respectively.
% \DescribeMacro{\minus}^^A
%
% \begin{syntax}
% |\plus{|\<positive preamble>|}{|\<positive postamble>|}|\\
% |\minus{|\<negative preamble>|}{|\<negative postamble>|}|
% \end{syntax}
%
% While |\plus| isn't used by default, |\minus| is defined to provide a preceding
% minus sign for negative numbers.
%
%   {\EUROFORMAT{main}{\align\in\hspace*{10mm}}
%   \EUROFORMAT{in}{\val}
%   \newcommand*\test[3]{\EUROFORMAT{EUR}{\minus{#1}{#2}}\EURO{EUR}{#3}}
%   \medskip\noindent
%   \begin{center}
%   \begin{tabular}{rrr}%
%                    &  positive numbers         & negative numbers\\[.5ex]
%   \hline\\[-1.5ex]
%   |\minus{\(-\)}{}|&  \test{\(-\)}{}{12000}& \test{\(-\)}{}{-12000}\\
%   |\minus{(}{)}|&     \test{(}{)}{.79}&      \test{(}{)}{-.79}\\
%   |\minus{\color{red}(}{)}|&^^A
%     \test{\color{red}(}{)}{123.456}&^^A
%     \test{\color{red}(}{)}{-123.456}\\^^A
%   |\minus{\color{red}\(-\)}{}|\qquad&^^A
%     \test{\color{red}\(-\)}{}{10}&^^A
%     \test{\color{red}\(-\)}{}{-10}^^A
%   \end{tabular}
%   \end{center}}
%
%
%
%
%
% \subsection{Tables and alignment}
% \label{sec:align}
%
% To achieve proper alignment in tables there's an |\align| command that
% can be used in any of the different format strings no matter if it's a
% \emph{main}, an \emph{in}, \emph{out}, or one of the \emph{number} formats.
% This command is to be stated before the
% concerned |\in|, |\out|, or |\val| command, respectively.
% It lets a number's fractional part have
% no width, thus allowing to align such numbers properly in a flush-right
% table column (|r| column). The example below also shows how to use
% the \DescribeMacro{\table}|\table| keyword. It turns the \opt{table}
% mode on for the current table. To turn it on for the whole document,
% use the \opt{table} package option. If you find the `---' dashes
% too long, you can load the package with the \DescribeOption{endash}\opt{endash}
% option.
%
%
% \medskip
% \newcommand*\ALNUM{\EUROFORMAT{main}{\table\in}\EUROFORMAT{in}{\align\val}\EURO{EUR}}
% \begin{tabular}{lr}
% |\newcommand*\ALNUM{%|\\
% |  \EUROFORMAT{main}{\table\in}%    % no \out currency|\hspace*{-2cm}\\
% |  \EUROFORMAT{in}{\align\val}%     % no symbol/ISO code|\hspace*{-10cm}\\
% |  \EURO{EUR}}%|\\[2ex]
% |\begin{tabular}{r}|&\\
% |\textbf{costs}\\|&     \textbf{costs}\\
% |\ALNUM{123456}\\|&     \ALNUM{123456}\\
% |\ALNUM{1234.56}\\|&    \ALNUM{1234.56}\\
% |\ALNUM{12.3456}\\|&    \ALNUM{12.3456}\\
% |\ALNUM{0.123456}|&     \ALNUM{0.123456}\\
% |\end{tabular}|
% \end{tabular}
%
% \medskip\noindent
% It may be necessary to put a |\hspace| after such an aligned number,
% especially when it is applied more than once. The second column would
% have to be |\llap|ped in this case.
%
% \medskip
% \newcommand*\IEP{^^A
%   \EUROFORMAT{main}{\align\in\hspace{1.8cm}\llap{\align\out}}^^A
%   \EUROFORMAT{in}{\val}^^A
%   \EUROFORMAT{out}{\val}^^A
%   \EURO{IEP}}
% \begin{example}[.9\textwidth]
% |\newcommand*\IEP{%|\\
% |  \EUROFORMAT{main}{\align\in\hspace{1.8cm}\llap{\align\out}}%|\hspace*{-1cm}\\
% |  \EUROFORMAT{in}{\val}%|\\
% |  \EUROFORMAT{out}{\val}%|\\
% |  \EURO{IEP}}|
% \end{example}
% \null
%
% \begin{tabular}{llr}
% |\begin{tabular}{lr}|&\\
% |\bf Month& \bf Irish Pound/Euro\\|& \bf Month& \bf Irish Pound/Euro\\
% |January&   \IEP{6070.83}\\|&   January&  \IEP{6070.83}\\
% |February&  \IEP{1200}\\|&      February& \IEP{1200}\\
% |March&     \IEP{0.123}\\|&     March&    \IEP{0.123}\\
% |April&     \IEP{441.0358}|&    April&    \IEP{441.0358}\\
% |\end{tabular}|
% \end{tabular}
%
% \medskip\noindent
% It would have been much simpler, though, not to combine two
% columns in one |\EURO| command, but to use two separate entries.
% \medskip
%
%
%
%
% \subsection{Dirty tricks}
%
%
% Of course, the format doesn't have to deal with the \euro, nor with monetary amounts
% at all. (The |EUR| currency in the following examples has no meaning,
% we could also have used any other currency, provided that no |\out| command
% is used within the \emph{format string.})
%
% \begin{example}[.6\textwidth]
% |\newcommand*\USD[1]{{%|\\
% |  \EUROFORMAT{main}{\in}%|\\
% |  \EUROFORMAT{in}{\val\,\$}%|\\
% |  \EUROFORMAT{EUR}{\form{,}{.}{,}\round{-2}}%|\hspace*{-1cm}\\
% |  \EURO{EUR}{#1}}}|\\[1.5ex]
% |\USD{-123450.6789}|& \USD{-123450.6789}\\[1ex]
% \end{example}
%
% These examples are probably too complicated for the simple things they do.
% But they may serve as examples of how to use some of the customization
% commands.
%
% \begin{example}[.6\textwidth]
% |\newcommand*\NUM[1]{{%|\\
% |  \EUROFORMAT{main}{\in}%|\\
% |  \EUROFORMAT{in}{\val}%|\\
% |  \EUROFORMAT{EUR}{\form{,}{.}{,}\round{-10}}%|\hspace*{-1cm}\\
% |  \EURO{EUR}{#1}}}|\\[1.5ex]
% |\NUM{1000} red ants|& \NUM{1000} red ants
% \end{example}
% \null
%
%
%
% \subsection{The default settings}
%
% The following lines show how the |\EURO| command's default behavior
% could have been defined. The real settings, however, were defined on
% a lower programming level.
%
% \begin{example}[.6\textwidth]
% |\EUROFORMAT{main}{\in\ (\out)}|\\
% |\EUROFORMAT{in}{\val~\sym}|\\
% |\EUROFORMAT{out}{\val~\sym}|\\
% |\EUROFORMAT{all}{%|\\
% |  \form{\,}{,}{\,}%|\\
% |  \round{-2}%|\\
% |  \zero{0}{0}{}%|\\
% |  \plus{}{}%|\\
% |  \minus{\(-\)}{}}|\\
% |\EUROFORMAT{ITL}{%|\\
% |  \round{0}}|
% \end{example}
% \null
%
%
%
% \subsection{The configuration file}
% \label{sec:config}
%
% If you want to change the predefined settings, create a
% file named `|euro.cfg|' and put it in a directory, where \TeX\
% can find it. This configuration file will then be loaded
% at the end of the |euro.sty| file, so you may redefine
% any settings or commands, select package options and even
% introduce new package options. But if you intend to give
% your documents to others, don't forget to give them the
% required configuration files, too! That's how such a file
%  could look like:
%
% \begin{example}[.92\textwidth]
% |% introduce the US-Dollar and the British Pound Sterling|\\
% |\EUROADD{USD}{\$}{1.0891}|\\
% |\EUROADD{GBP}{\textsterling}{0.6694}|
% \end{example}
%
% \indent
% \begin{example}[.85\textwidth]
% |% let Italian Lire be rounded to 10s|\\
% |\EUROFORMAT{ITL}{\round{1}}|\\
% |% and let their symbol be only `L.'|\\
% |\EUROSYM{ITL}{L.}|
% \end{example}
%
% \indent
% \begin{example}[.92\textwidth]
% |% declare a new package option `bold',|\\
% |% which typesets the source currency in boldface type|\\
% |\DeclareOption{bold}{%|\\
% |  \EUROFORMAT{main}{\textbf{\in} (\out)}}|
% \end{example}
%
% \indent
% \begin{example}[.85\textwidth]
% |% always select the `endash' option|\\
% |\ExecuteOptions{endash}|\\
% |\endinput|
% \end{example}
% \null
%
%
%
%
% \section*{The European Union \&\ Patents on Software}
%
%^^A^^  NOTE TO DISTRIBUTORS: If you feel like distributing the euro package documentation with
%^^A^^  this section removed or modified, note the special copyright clause that applies in this case!
%
% Because this package is dedicated to the European Union's official currency,
% I feel the obligation --~in the name of freedom and democracy, and as a citizen
% of the EU~-- to comment on today's decision on the ``Computer Implemented
% Inventions Directive'':
%
% Today, 2005/03/07, unelected bureaucrats --~the European Council of ministers~-- decided
% to ignore the objections and clear will of the elected European Parliament, those of the
% Committee on Legal Affairs~(JURI), the presidency of the European Parliament, of several
% national parliaments, and nothing less than the interests of the citizens of the European Union.
% Instead, they chose to fulfill the wishes of software industry giants (some of which have
% been convicted of abusing their monopoly power in several countries), and the wishes of
% bureaucrats from the European Patent Office, which has illegally granted 30.000~software
% patents already.
%
% This is an incredible offense and disgusting abuse of power. It has yet to be
% investigated, which r\^ole corruption played in this plot, for which there
% seem to be strong signs. We are facing nothing less than an oligarchy of
% unelected bureaucrats who feel more obliged to maintaining the wealth of the richest
% man on earth, than the interests of the European citizens and the European
% economy. There is still hope that the European Parliament will reject the
% directive in the second reading. This appeal will remain in the documentation, though,
% as long as the European Parliament is treated as a fig leaf for undemocratic decisions.
% And should this directive become effective, and should I ever encounter conflicts
% with software patent claims in \emph{any} of my software packages, the |euro|~package
% will be the first that I will withdraw.
%
% This is a sad day. Shame on the European~Council! Shame on the European~Commission!
%
%
%
%
%
% \begin{thebibliography}{0}
% \bibitem{Duden}{Duden, Volume 1: \textit{Die Rechtschreibung.} Bibliographisches Institut,
%   Mann\-heim--Wien--Z\"urich, 1986, 19th~edition.}
%
% \bibitem{EUrates}{European Council: \textit{Council Regulation (EC) No.~2866/98 of 31~December~1998
%   on the conversion rates between the euro and the currencies of the Member States adopting
%   the euro.} Official Journal L~359. 31~December~1998.}
%
% \bibitem{EUratesGRD}{European Council: \textit{Council Regulation (EC) No.~1478/2000 of 19~June 2000
%   amending Regulation (EC) No.~2866/98 on the conversion rates between the euro and the currencies
%   of the Member States adopting the euro.} Official Journal L~167. 7~July~2000.}
%
% \bibitem{EUround}{European Council: \textit{Certain provisions related to the introduction of the
%   Euro.} Council Regulation 1103/97, 17~June~1997.}
%
% \bibitem{DEK}{\textsc{Knuth, Donald Ervin:} \textit{The \TeX book.}
%   Addison--Wesley Publishing Company, Reading/Massachusetts, 1989, 16th~edition.}
%
% \bibitem{Tschichold}{\textsc{Tschichold, Jan:} \textit{Ausgew\"ahlte Aufs\"atze
%   \"uber Fragen der Gestalt des Buches und der Typographie.}
%   Birkh\"auser, Basel, 1987, 2nd~edition.}
% \end{thebibliography}
%
%
%
% \StopEventually{\addtocontents{toc}{\protect\end{multicols}}}
%
%
%
%
%
%
%
%
%^^A max 72 columns
%^^A--------------------------------------------------------------------
%
%
%
%
% \section{The implementation}
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{euro}[2003/02/19 v1.1 euro  (mf)]
\RequirePackage{fp-basic}
\RequirePackage{fp-snap}
\FPmessagesfalse
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The engine}
%
% \begin{macro}{\EURO@zero}
% \begin{macro}{\EURO@lzero}
% \begin{macro}{\EURO@rzero}
% \begin{macro}{\EURO@lminus}
% \begin{macro}{\EURO@rminus}
% \begin{macro}{\EURO@lplus}
% \begin{macro}{\EURO@rplus}
% \begin{macro}{\EURO@align}
% \begin{macro}{\EURO@lsep}
% \begin{macro}{\EURO@lsep}
% \begin{macro}{\EURO@point}
% \begin{macro}{\EURO@round}
% These macros are for internal use only. They partly predefine the
% format strings. Never change them here, but create a `|euro.cfg|'
% file, where you can redefine them without causing undesirable
% side effects.
%
%    \begin{macrocode}
\newcommand*\EURO@zero{0}
\newcommand*\EURO@lzero{0}
\newcommand*\EURO@rzero{}
\newcommand*\EURO@lminus{\(-\)}
\newcommand*\EURO@rminus{}
\newcommand*\EURO@lplus{}
\newcommand*\EURO@rplus{}
\newcommand*\EURO@align{}
\newcommand*\EURO@lsep{\,}
\newcommand*\EURO@rsep{\,}
\newcommand*\EURO@point{,}
\newcommand*\EURO@round{-2}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\EURO}
% \begin{macro}{\EURO@@}
% \begin{macro}{\EURO@scan}
% These macros manage the whole package. All the \emph{format string}
% macros (also called \emph{keywords}) are defined here locally.
% Note the beautiful |####|s! \texttt{;-)}
%
%    \begin{macrocode}
\newcommand*\EURO[1]{\bgroup\def\EURO@icurr{#1}\EURO@@}
\newcommand*\EURO@@[2][EUR]{\FPset\EURO@ival{#2}%
  \def\EURO@set##1##2##3##4##5{\FPset##5{##1}}%
  \csname EURO@@\EURO@icurr\endcsname\EURO@ifac
  \csname EURO@@#1\endcsname\EURO@ofac
  \FPdiv\EURO@oval\EURO@ival\EURO@ifac
  \FPmul\EURO@oval\EURO@oval\EURO@ofac
  \def\EURO@set##1##2##3##4##5{\def##5{##4}}%
  \EURO@@main\EURO@
  \EURO@@all\EURO@dflt
  \let\EURO@set\EURO@scan
  \def\in{{\csname EURO@@\EURO@icurr\endcsname\EURO@ival
    \def\EURO@set####1####2####3{}\EURO@@in}}%
  \def\out{{\csname EURO@@#1\endcsname\EURO@oval
    \def\EURO@set####1####2####3{}\EURO@@out}}%
  \def\align{\def\EURO@align####1{\rlap{####1}\let\EURO@align\relax}}%
  \let\table\EURO@table
  \def\form##1##2##3{\def\EURO@lsep{##1}\def\EURO@rsep{##3}%
    \def\EURO@point{##2}}%
  \def\round##1{\def\EURO@round{##1}}%
  \let\zero\EURO@setzero
  \def\minus##1##2{\def\EURO@lminus{##1}\def\EURO@rminus{##2}}%
  \def\plus##1##2{\def\EURO@lplus{##1}\def\EURO@rplus{##2}}%
  \EURO@\egroup}
\newcommand*\EURO@scan[5]{%
  \def\val{\FPifzero#5\EURO@zero\else\EURO@num#5\fi}%
  \def\iso{#2}\def\sym{#3}\def\EURO@form{\EURO@dflt#4}%
  \ifx\EURO@form\empty\let\EURO@form\EURO@dflt\fi
  \EURO@form}%
\newcommand*\EURO@setzero[3]{\def\EURO@zero{#1}%
  \def\EURO@lzero{#2}\def\EURO@rzero{#3}}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\EUROSYM}
% \begin{macro}{\EUROFORMAT}
% \begin{macro}{\EUROADD}
% These macros replace the third\slash fourth parameter of the
% respective currency entry with another currency code\slash
% format string, or add a new currency entry.
%
%    \begin{macrocode}
\newcommand*\EUROSYM[2]{%
  \def\EURO@set##1##2##3##4{\toks@={\EURO@set{##1}{##2}{#2}{##4}}%
    \expandafter\edef\csname EURO@@#1\endcsname{\the\toks@}}%
  \csname EURO@@#1\endcsname}
\newcommand*\EUROFORMAT[2]{%
  \def\EURO@set##1##2##3##4{\toks@={\EURO@set{##1}{##2}{##3}{#2}}%
    \expandafter\edef\csname EURO@@#1\endcsname{\the\toks@}}%
  \csname EURO@@#1\endcsname}
\newcommand*\EUROADD[3]{%
  \expandafter\def\csname EURO@@#1\endcsname{\EURO@set{#3}{#1}{#2}{}}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\EURO@num}
% \begin{macro}{\EURO@split}
% Takes a macro containing a number, passes the integer part to |\EURO@grp| and
% outputs everything else, cares about rounding and such\dots
%
%    \begin{macrocode}
\newcommand*\EURO@num[1]{{%
  \FPifneg#1%
    \EURO@lminus\let\EURO@post\EURO@rminus\FPneg#1#1%
  \else
    \EURO@lplus\let\EURO@post\EURO@rplus
  \fi
  \EURO@rround#1%
  \let\EURO@aux#1%
  \FPtrunc#1#10%
  \FPifzero#1\EURO@lzero\else\EURO@grp#1\fi
  \EURO@align{%
     \FPsub\EURO@aux\EURO@aux#1%
     \FPifzero\EURO@aux
       \ifnum\EURO@round<0 \EURO@rzero\fi
     \else
       \ifnum\EURO@round<0
         \ifnum\EURO@round<-9
           \FPclip\EURO@aux\EURO@aux
         \else
           \FPtrunc\EURO@aux\EURO@aux{-\EURO@round}%
         \fi
         \EURO@point
         \expandafter\EURO@split\EURO@aux\relax\relax\relax\EURO@
       \fi
     \fi
     \EURO@post}}%
  \let\EURO@align\relax}
\newcommand*\EURO@split{}
\def\EURO@split0.#1#2#3#4\EURO@{#1#2#3%
  \EURO@threedig#4\relax\relax\relax\EURO@}
\newcommand*\EURO@threedig[3]{%
  \if#1\relax
    \let\EURO@\relax
  \else
    \EURO@rsep#1#2#3\let\EURO@\EURO@threedig
  \fi\EURO@}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\EURO@rround}
% \begin{macro}{\EURO@rfac}
% Takes a macro containing a number, returns it rounded.
% |\EURO@rfac| calculates the rounding factor \(10^r\)
% for positive \(r\) (\emph{rounding number}).
%
%    \begin{macrocode}
\newcommand*\EURO@rround[1]{%
  \count@=\EURO@round\relax
  \ifnum\count@<1%
    \count@-\count@
    \FPround#1#1\count@
  \else
    \FPset\EURO@aux1%
    \EURO@rfac\EURO@aux\count@
    \FPdiv#1#1\EURO@aux
    \FPround#1#10%
    \FPmul#1#1\EURO@aux
  \fi}
\newcommand*\EURO@rfac[2]{%
  \ifnum#2>0 \advance#2-1 \EURO@rfac#1#2\FPmul#1#1{10}\fi}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\EURO@grp}
% Let's do some recursion---it's fun! (This macro does the three-digit grouping.)
%
%    \begin{macrocode}
\newcommand*\EURO@grp[1]{\bgroup%
  \FPtrunc#1#10%
  \FPiflt#1{1000}%
    #1%
  \else
    \let\EURO@aux=#1%
    \FPdiv#1#1{1000}%
    \FPtrunc#1#10%
    \EURO@grp#1%
    \FPmul#1#1{1000}%
    \FPsub\EURO@aux\EURO@aux#1%
    \FPtrunc\EURO@aux\EURO@aux0%
    \count0=\EURO@aux\relax
    \EURO@lsep
    \ifnum\count0<100 0\ifnum\count0<10 0\fi\fi\EURO@aux
  \fi\egroup}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The facts}
%
% \begin{macro}{\EURO@@ATS}
% \begin{macro}{\EURO@@BEF}
% \begin{macro}{\EURO@@DEM}
% \begin{macro}{\EURO@@ESP}
% \begin{macro}{\EURO@@FIM}
% \begin{macro}{\EURO@@FRF}
% \begin{macro}{\EURO@@GRD}
% \begin{macro}{\EURO@@IEP}
% \begin{macro}{\EURO@@ITL}
% \begin{macro}{\EURO@@LUF}
% \begin{macro}{\EURO@@NLG}
% \begin{macro}{\EURO@@PTE}
% \begin{macro}{\EURO@@EUR}
% These values have been irrevocably fixed by the European Council on suggestion
% by the European Commission and been published in the \emph{Council Regulation (EC) No.~2866/98}
% \cite{EUrates} and \emph{No.~1478/2000} \cite{EUratesGRD}
% (taken from |http://europa.eu.int/|).
%
%    \begin{macrocode}
\newcommand*\EURO@@ATS{\EURO@set{13.7603}{ATS}{\"oS}{}}
\newcommand*\EURO@@BEF{\EURO@set{40.3399}{BEF}{BEF}{}}
\newcommand*\EURO@@DEM{\EURO@set{1.95583}{DEM}{DM}{}}
\newcommand*\EURO@@ESP{\EURO@set{166.386}{ESP}{Pt.}{}}
\newcommand*\EURO@@FIM{\EURO@set{5.94573}{FIM}{FIM}{}}
\newcommand*\EURO@@FRF{\EURO@set{6.55957}{FRF}{FRF}{}}
\newcommand*\EURO@@GRD{\EURO@set{340.750}{GRD}{GRD}{}}
\newcommand*\EURO@@IEP{\EURO@set{.787564}{IEP}{IEP}{}}
\newcommand*\EURO@@ITL{\EURO@set{1936.27}{ITL}{Lit.}{}}
\newcommand*\EURO@@LUF{\EURO@set{40.3399}{LUF}{LUF}{}}
\newcommand*\EURO@@NLG{\EURO@set{2.20371}{NLG}{NLG}{}}
\newcommand*\EURO@@PTE{\EURO@set{200.482}{PTE}{PTE}{}}
\newcommand*\EURO@@EUR{\EURO@set{1.00000}{EUR}{Euro}{}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\EURO@@main}
% \begin{macro}{\EURO@@in}
% \begin{macro}{\EURO@@out}
% \begin{macro}{\EURO@@all}
% Define the generic format macros and `fill' them with
% some default settings. Define the number format for
% the \emph{Italian Lira} and the package options,
% load the optional `|euro.cfg|' file and, finally:
% Exit.
%
%
%    \begin{macrocode}
\newcommand*\EURO@@main{\EURO@set0{}{}{}}
\newcommand*\EURO@@in{\EURO@set0{}{}{}}
\newcommand*\EURO@@out{\EURO@set0{}{}{}}
\newcommand*\EURO@@all{\EURO@set0{}{}{}}
\EUROFORMAT{main}{\in\ (\out)}
\EUROFORMAT{in}{\val~\sym}
\EUROFORMAT{out}{\val~\sym}
\EUROFORMAT{ITL}{\round0}
\DeclareOption{eco}%
  {\EUROFORMAT{in}{\iso~\val}%
   \EUROFORMAT{out}{\iso~\val}}
\newcommand*\EURO@emdash{\EURO@setzero
  {0}{---}{\EURO@point---}}
\newcommand*\EURO@endash{\EURO@setzero
  {0}{--\kern.1em}{\EURO@point\kern.1em--}}
\newcommand*\EURO@zeros{\EURO@setzero
  {0\EURO@align{\EURO@point00}}{0}{\EURO@point00}}
\DeclareOption{emdash}{\let\EURO@table\EURO@emdash}
\DeclareOption{endash}{\let\EURO@table\EURO@endash}
\DeclareOption{zeros}{\let\EURO@table\EURO@zeros}
\DeclareOption{table}{\EURO@table}
\DeclareOption{dots}{\let\EURO@lsep.\let\EURO@rsep.}
\ExecuteOptions{emdash}
\InputIfFileExists{euro.cfg}%
  {\PackageInfo{euro}{Local config file euro.cfg used}}{}
\ProcessOptions
\endinput
%</package>
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \vspace{2explus1fill}
%\begin{verbatim}
%$Id: euro.dtx,v 1.14 2005/03/07 14:22:19 m Exp $
%\end{verbatim}
% \Finale
%
%
%
%                                                       ^^A.E.I.O.U.^^
% ^^A vim:ts=4:sw=4:et:cindent