summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/fancynum/fancynum.sty
blob: 7d2e8494809c84604b99375dd46ddbee1c5b9f63 (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
%%
%% This is file `fancynum.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fancynum.dtx  (with options: `package')
%% 
%% fancynum.dtx Copyright (C) J.J.Green 1999, 2000.
%% $Id: fancynum.dtx,v 1.8 2000/08/08 22:28:38 jjg Exp $
%%
%% This file is part of the fancynum package.
%%
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{fancynum}
          [2000/08/08 0.92 Fancynum package]
\def\setfnumdsym#1{\gdef\fn@decimalsym{#1}}
\def\setfnumgsym#1{\gdef\fn@groupsym{#1}}
\def\setfnummsym#1{\gdef\fn@multsym{#1}}
\DeclareOption{english}{\setfnumdsym{{\cdot}}\setfnumgsym{{,}}}
\DeclareOption{french}{\setfnumdsym{{,}}\setfnumgsym{{.}}}
\DeclareOption{tight}{\setfnummsym{{\times}}}
\DeclareOption{loose}{\setfnummsym{\times}}
\DeclareOption{commas}{\setfnumgsym{{,}}}
\DeclareOption{thinspaces}{\setfnumgsym{\,}}
\DeclareOption{plain}{\setfnumgsym{\relax}}
\ExecuteOptions{english,loose}
\ProcessOptions\relax
\newcount\fn@strlen
\def\fn@length#1{\fn@strlen=0 \fn@getlength#1\end}
\def\fn@getlength#1{\ifx #1\end \let\next=\relax \else
  \advance\fn@strlen by1
  \ifnum\fn@strlen=3 \fn@strlen=0 \fi
  \let\next=\fn@getlength\fi \next}
\def\fn@fracpunct#1{\fn@fpa#1@ }
\def\fn@fpa#1#2#3 {#1\if #2@ \else \fn@fpb#2#3 \fi}
\def\fn@fpb#1#2#3 {#1\if #2@ \else \fn@fpc#2#3 \fi}
\def\fn@fpc#1#2#3 {#1\if #2@ \else \fn@groupsym\fn@fpa#2#3 \fi}
\def\fn@intpunct#1{\fn@ipa#1 }
\def\fn@ipa#1#2 {%
  \if +#1 +\fn@ipb#2 \else
  \if -#1 -\fn@ipb#2 \else
  \fn@ipb#1#2 \fi \fi}
\def\fn@ipb#1 {\fn@length{#1}
  \ifcase\fn@strlen
  \fn@ipc#1 \or
  \fn@ipd#1 \or
  \fn@ipe#1 \fi}
\def\fn@ipc#1#2#3#4 {#1#2#3\fn@ipf#4@ }
\def\fn@ipd#1#2     {#1\fn@ipf#2@ }
\def\fn@ipe#1#2#3   {#1#2\fn@ipf#3@ }
\def\fn@ipf#1#2     {\if #1@ \else \fn@groupsym\fn@fpa#1#2 \fi}
\def\fn@propdecimal#1#2{\fn@intpunct{#1}\fn@decimalsym\fn@fracpunct{#2}}
\def\fn@impropdecimal#1#2{\fn@intpunct{#1}}
\def\fn@decimalsplit#1.#2.#3#4#5{#4{#1}{#2}}
\def\fn@decimal#1{\fn@decimalsplit#1..\fn@propdecimal\fn@impropdecimal\empty}
\def\fn@signedint#1#2 {%
  \if +#1
    \fn@unsignedint#2\relax
  \else
    \if -#1
      -\fn@unsignedint#2\relax
    \else
       \fn@unsignedint#1#2\relax
    \fi
  \fi}
\def\fn@unsignedint#1#2{%
  \ifx #2\relax \let\next=#1
  \else
    \ifx 0#1 \let\next=\fn@unsignedint
    \else
    \let\next=#1
    \fi
  \fi
  \next #2}
\def\fn@exp#1#2{\fn@decimal{#1}\fn@multsym10^{\fn@signedint#2 }}
\def\fn@noexp#1#2{\fn@decimal{#1}}
\def\fn@realsplit#1e#2e#3#4#5{#4{#1}{#2}}
\def\fnum#1{\fn@realsplit#1ee\fn@exp\fn@noexp\empty}

\endinput
%%
%% End of file `fancynum.sty'.