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