summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fancynum/examples.tex
blob: 3909c04c2cdea47b32d20952c4912c0fec8ad326 (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
% Examples for the fancynum package
% J.J.Green 1999
% $Id: examples.tex,v 1.7 2000/08/08 22:29:25 jjg Exp $

\documentclass[a4paper]{article}
\usepackage[english,tight]{fancynum}
\usepackage{xspace}
\title{Example \texttt{fancynum} output}
\date{17th March 2000}
\author{J. J. Green}

\begin{document}
\maketitle

This file contains some of examples of the use of the package.
Table~\ref{dbltable} shows some examples of the setting
of a number ($\pi$) for different \emph{printf} format strings.
The table was generated entirely automatically by the C program
\texttt{tables.c} include in the distribution. The group symbol used is
the thinspace.
\setfnumgsym{\,}
\input{dbltable}

The figures in Table~\ref{factorial} are also set by the package.
This table shows some values of the factorial squared, and is 
included to give an example of a real table with integers of 
widely varying magnitude. The group symbol used here is the comma.
\begin{table}[tbh]
\begin{center}
\setfnumgsym{{,}}
\begin{tabular}{|c|r|}
\hline
$n$ & $(n!)^2$ \\ 
\hline
$1$ & $\fnum{1}$ \\
$2$ & $\fnum{4}$ \\
$3$ & $\fnum{36}$ \\
$4$ & $\fnum{576}$ \\
$5$ & $\fnum{14400}$ \\
$6$ & $\fnum{518400}$ \\
$7$ & $\fnum{25401600}$ \\
$8$ & $\fnum{1625702400}$ \\
$9$ & $\fnum{131681894400}$ \\
\hline
\end{tabular}
\end{center}
\caption{Some values of $(n!)^2$\label{factorial}}
\end{table}

\newcommand{\fntest}[1]{\texttt{#1} ($\fnum{#1}$)\xspace}
An earlier version of the package had a bug which
mis-set the examples \fntest{3.14e1}, \fntest{3.14e-1}
and \fntest{3.14e000001}, but these problems are now
fixed.

\end{document}