summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/fmtcount/manual.html
blob: 9fa76258784edf5e6369bf851fa6d803a9b1fdb8 (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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with jLaTeX2HTML 2002-2-1 (1.70) JA patch-2.0
patched version by:  Kenshi Muto, Debian Project.
* modified by:  Shige TAKENO
LaTeX2HTML 2002-2-1 (1.70),
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>fmtcount.sty v1.03: Displaying the Values of LaTeX Counters</TITLE>
<META NAME="description" CONTENT="fmtcount.sty v1.03: Displaying the Values of LaTeX Counters">
<META NAME="keywords" CONTENT="manual">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="jLaTeX2HTML v2002-2-1 JA patch-2.0">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">


</HEAD>

<BODY >
<A NAME="tex2html1"
  HREF="http://theoval.cmp.uea.ac.uk/~nlct/">Dr Nicola Talbot</A>
|
<A NAME="tex2html2"
  HREF="http://www.cmp.uea.ac.uk/">School of Computing Sciences</A>
|
<A NAME="tex2html3"
  HREF="http://www.uea.ac.uk/">University of East Anglia</A>

<P>

 <H1 ALIGN="CENTER">fmtcount.sty v1.03: Displaying the Values of 
LaTeX Counters</H1>
<DIV>

<P ALIGN="CENTER"><STRONG>N.L.C. Talbot</STRONG></P>
<P ALIGN="CENTER"><STRONG>1 July 2005</STRONG></P>
</DIV>
 <BR>

<H2><A NAME="SECTION00010000000000000000">
Contents</A>
</H2>
<!--Table of Contents-->

<UL>
<LI><A NAME="tex2html16"
  HREF="manual.html#SECTION00020000000000000000">Introduction</A>
<LI><A NAME="tex2html17"
  HREF="manual.html#SECTION00030000000000000000">Installation</A>
<LI><A NAME="tex2html18"
  HREF="manual.html#SECTION00040000000000000000">Available Commands</A>
<LI><A NAME="tex2html19"
  HREF="manual.html#SECTION00050000000000000000">Package Options</A>
<LI><A NAME="tex2html20"
  HREF="manual.html#SECTION00060000000000000000">Multilingual Support</A>
<LI><A NAME="tex2html21"
  HREF="manual.html#SECTION00070000000000000000">Configuration File fmtcount.cfg</A>
<LI><A NAME="tex2html22"
  HREF="manual.html#SECTION00080000000000000000">LaTeX2HTML style</A>
<LI><A NAME="tex2html23"
  HREF="manual.html#SECTION00090000000000000000">Acknowledgements</A>
<LI><A NAME="tex2html24"
  HREF="manual.html#SECTION000100000000000000000">Contact Details</A>
</UL>
<!--End of Table of Contents--> 
<H1><A NAME="SECTION00020000000000000000">
Introduction</A>
</H1>
The <TT>fmtcount</TT> package provides commands to display
the values of LaTeX counters in a variety of formats. It also
provides equivalent commands for actual numbers rather than 
counter names. Limited multilingual support is available.

<P>

<H1><A NAME="SECTION00030000000000000000">
Installation</A>
</H1>

<P>
This package is distributed with the files <TT>fmtcount.dtx</TT>
and <TT>fmtcount.ins</TT>.  To extract the code do:
<PRE>
latex fmtcount.ins
</PRE>
This will create the files <TT>fmtcount.sty</TT> and 
<TT>fmtcount.perl</TT>, along with several <TT>.def</TT> files.
Place <TT>fmtcount.sty</TT> and the <TT>.def</TT> files somewhere
where LaTeX will find them (e.g. <TT>texmf/tex/latex/fmtcount/</TT>) and place <TT>fmtcount.perl</TT> somewhere where LaTeX2HTML
will find it (e.g. latex2html/styles). Remember to refresh
the TeX database (using <TT>texhash</TT> under Linux, for
other operating systems check the manual.)

<P>

<H1><A NAME="SECTION00040000000000000000">
Available Commands</A>
</H1>

<P>
The commands can be divided into two categories: those that
take the name of a counter as the argument, and those
that take a number as the argument.

<P>
The macro <code>\ordinal{</code><I>counter</I><code>}</code> will
 print the value of a LaTeX counter <I>counter</I> as an ordinal,
 
 where the macro <code>\fmtord{</code><I>text</I><code>}</code> is used to format the st,nd,rd,th bit.
 By default the ordinal is formatted as a superscript, if the package option <TT>level</TT>
 is used, it is level with the text.
 For example, if the current section is 3, then <code>\ordinal{section}</code> will produce
 the output: 3<SUP>rd</SUP>.

<P>
The macro <code>\ordinalnum</code> is like <code>\ordinal</code>
but takes an actual number rather than a counter as the
argument. For example: <code>\ordinalnum{3}</code> will
produce: 3<SUP>rd</SUP>.

<P>
The macro <code>\numberstring{</code><I>counter</I><code>}</code> will print the value
 of <I>counter</I> as text.  E.g. <code>\numberstring{section}</code> will produce:
 three.
 
 The macro <code>\Numberstring{</code><I>counter</I><code>}</code> does the same as
 <code>\numberstring</code>, but with initial letters in uppercase.  For
 example, <code>\Numberstring{section}</code> will produce: Three.

<P>
The macros <code>\numberstringnum</code> and 
<code>\Numberstringnum</code> work like 
<code>\numberstring</code> and 
<code>\Numberstring</code>, respectively, but take an actual number
rather than a counter as the argument. For example:
<code>\Numberstringnum{105}</code> will produce: One Hundred and Five.

<P>
The macro <code>\ordinalstring{</code><I>counter</I><code>}</code> will print the
 value of <I>counter</I> as a textual ordinal.  E.g.  <code>\ordinalstring{section}</code> will produce: third.
 
 The macro <code>\Ordinalstring{</code><I>counter</I><code>}</code> does the same as 
 <code>\ordinalstring</code>, but with initial letters in uppercase.  For example,
 <code>\Ordinalstring{section}</code> will produce: Third.

<P>
The macros <code>\ordinalstringnum</code> and 
<code>\Ordinalstringnum</code> work like 
<code>\Ordinalstring</code> and 
<code>\Ordinalstring</code>, respectively, but take an actual number
rather than a counter as the argument. For example,
<code>\ordinalstringnum{3}</code> will produce: third.

<P>
The macro <code>\binary{</code><I>counter</I><code>}</code> will print the 
value of <I>counter</I> as a binary number.  
E.g. <code>\binary{section}</code> will produce: 11.  The declaration 
<code>\padzeroes[</code><I>n</I><code>]</code> 
will ensure numbers are written to <I>n</I> digits, padding with 
zeroes if necessary.  E.g. <code>\padzeroes[8]\binary{section}</code> 
will produce: 00000011.
 The default value for <I>n</I> is 17.

<P>
The macro <code>\binarynum</code> is like <code>\binary</code>
but takes an actual number rather than a counter as the
argument. For example: <code>\binarynum{5}</code> will
produce: 101.

<P>
The macro <code>\octal{</code><I>counter</I><code>}</code> will print the 
value of <I>counter</I> as an octal number.  For example, if you 
have a counter called, say <TT>mycounter</TT>, and you set the 
value to 125, then <code>\octal{mycounter}</code> will produce: 177.  
 Again, the number will be padded with zeroes if necessary, 
depending on whether <code>\padzeroes</code> has been used.

<P>
The macro <code>\octalnum</code> is like <code>\octal</code>
but takes an actual number rather than a counter as the
argument. For example: <code>\octalnum{125}</code> will
produce: 177.

<P>
The macro <code>\hexadecimal{</code><I>counter</I><code>}</code> will print 
the value of <I>counter</I> as a hexadecimal number.  Going back 
to the previous example, <code>\hexadecimal{mycounter}</code> will
 produce: 7d. Again, the number will be padded with zeroes if 
necessary, depending on whether <code>\padzeroes</code> has been used.
 
 <code>\Hexadecimal{</code><I>counter</I><code>}</code> does the same thing, 
but uses uppercase characters, e.g. 
 <code>\Hexadecimal{mycounter}</code> will produce: 7D.

<P>
The macros <code>\hexadecimalnum</code> and
<code>\Hexadecimalnum</code> are like 
<code>\hexadecimal</code> and <code>\Hexadecimal</code>
but take an actual number rather than a counter as the
argument. For example: <code>\hexadecimalnum{125}</code> will
produce: 7d, and <code>\Hexadecimalnum{125}</code> will 
produce: 7D.

<P>
The macro <code>\decimal{</code><I>counter</I><code>}</code> is similar to 
<code>\arabic</code> but the number can be padded with zeroes
 depending on whether <code>\padzeroes</code> has been used.  
For example: <code>\padzeroes[8]\decimal{section}</code> will
 produce: 00000005.

<P>
The macro <code>\decimalnum</code> is like <code>\decimal</code>
but takes an actual number rather than a counter as the
argument. For example: <code>\padzeroes[8]\decimalnum{5}</code> will
produce: 00000005.

<P>
The macro <code>\aaalph{</code><I>counter</I><code>}</code> will print the 
value of <I>counter</I> as: a b ... z aa bb ... zz etc.
 For example, <code>\aaalpha{mycounter}</code> will produce: uuuuu if 
<TT>mycounter</TT> is set to 125.
 
 <code>\AAAlph{</code><I>counter</I><code>}</code> does the same thing, but 
uses uppercase characters, e.g. 
 <code>\AAAlph{mycounter}</code> will produce: UUUUU.

<P>
The macros <code>\aaalphnum</code> and
<code>\AAAlphnum</code> are like 
<code>\aaalph</code> and <code>\AAAlph</code>
but take an actual number rather than a counter as the
argument. For example: <code>\aaalphnum{125}</code> will
produce: uuuuu, and <code>\AAAlphnum{125}</code> will 
produce: UUUUU.

<P>
The macro <code>\abalph{</code><I>counter</I><code>}</code> will print the 
value of <I>counter</I> as: a b ... z aa ab ... az etc.
 For example, <code>\abalpha{mycounter}</code> will produce: du if 
<TT>mycounter</TT> is set to 125.
 
 <code>\ABAlph{</code><I>counter</I><code>}</code> does the same thing, but 
uses uppercase characters, e.g. 
 <code>\ABAlph{mycounter}</code> will produce: DU.

<P>
The macros <code>\abalphnum</code> and
<code>\ABAlphnum</code> are like 
<code>\abalph</code> and <code>\ABAlph</code>
but take an actual number rather than a counter as the
argument. For example: <code>\abalphnum{125}</code> will
produce: du, and <code>\ABAlphnum{125}</code> will 
produce: DU.

<P>

<H1><A NAME="SECTION00050000000000000000">
Package Options</A>
</H1>

<P>
The following options can be passed to this package:

<P>
<TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT">raise</TD>
<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear as superscript</TD>
</TR>
<TR><TD ALIGN="LEFT">level</TD>
<TD ALIGN="LEFT">make ordinal st,nd,rd,th appear level with rest of 
text</TD>
</TR>
</TABLE>

<P>
These can also be set using the command:

<P>

<code>\fmtcountsetoptions{fmtord=</code><I>type</I><code>}</code>

<P>
where <I>type</I> is either <TT>level</TT> or 
<TT>raise</TT>.

<P>

<H1><A NAME="SECTION00060000000000000000">
Multilingual Support</A>
</H1>

<P>
Version 1.02 of the <TT>fmtcount</TT> package now has
limited multilingual support.  The following languages are
implemented: English, Spanish, Portuguese, French, French (Swiss)
and French (Belgian).  The package checks to see if the
command <code>\date</code><I>language</I> is defined<A NAME="tex2html4"
  HREF="#foot179"><SUP>1</SUP></A>, and will
load the code for those languages.  The commands <code>\ordinal</code>,
<code>\ordinalstring</code> and <code>\numberstring</code> (and their 
variants) will then be formatted in the currently
selected language.

<P>
If the French language is selected, the French (France) version
will be used by default (e.g. soxiante-dix for 70).  To
select the Swiss or Belgian variants (e.g. septente for 70) use:
<code>\fmtcountsetoptions{french=</code><I>dialect</I><code>}</code>
where <I>dialect</I> is either <TT>swiss</TT> or <TT>belgian</TT>.
You can also use this command to change the action of 
<code>\ordinal</code>.
<code>\fmtcountsetoptions{abbrv=true}</code> to produce ordinals
of the form 2<SUP>e</SUP> or
<code>\fmtcountsetoptions{abbrv=false}</code> to produce ordinals
of the form 2<SUP>eme</SUP> (default).

<P>
The <TT>french</TT> and <TT>abbrv</TT> settings only have an
effect if the French language has been defined.

<P>
The male gender for all languages is used by default, however
the feminine form can be obtained by passing <TT>f</TT> as
an optional argument to <code>\ordinal</code>, <code>\ordinalnum</code> etc.  
For example: <code>\numberstring{section}[f]</code>. Note that the
optional argument comes <I>after</I> the compulsory argument.  

<P>
Let me know if you find any spelling mistakes (has been known
to happen in English, let alone other languages I'm not so
familiar with.)

<P>

<H1><A NAME="SECTION00070000000000000000">
Configuration File <TT>fmtcount.cfg</TT></A>
</H1>

<P>
You can save your preferred default settings to a file called
<TT>fmtcount.cfg</TT>, and place it on the TeX path.  These
settings will then be loaded by the <TT>fmtcount</TT>
package.

<P>
Note that if you are using the <TT>datetime</TT> package,
the <TT>datetime.cfg</TT> configuration file will override
the <TT>fmtcount.cfg</TT> configuration file.
For example, if <TT>datetime.cfg</TT> has the line:
<PRE>
\renewcommand{\fmtord}[1]{\textsuperscript{\underline{#1}}}
</PRE>
and if <TT>fmtcount.cfg</TT> has the line:
<PRE>
\fmtcountsetoptions{fmtord=level}
</PRE>
then the former definition of <code>\fmtord</code> will take
precedence.

<P>

<H1><A NAME="SECTION00080000000000000000">
LaTeX2HTML style</A>
</H1>

<P>
The LaTeX2HTML style file <TT>fmtcount.perl</TT> is provided.
The following limitations apply:

<P>

<UL>
<LI><code>\padzeroes</code> only has an effect in the preamble.

<P>
</LI>
<LI>The configuration file 
<TT>fmtcount.cfg</TT> is currently ignored. (This is because
I can't work out the correct code to do this.  If you
know how to do this, please let me know.)  You can however
do:
<PRE>
\usepackage{fmtcount}
\html{\input{fmtcount.cfg}}
</PRE>
This, I agree, is an unpleasant cludge.

<P>
</LI>
</UL>

<P>

<H1><A NAME="SECTION00090000000000000000">
Acknowledgements</A>
</H1>

<P>
I would like to thank my mother for the French and Portuguese
support and my Spanish dictionary for the Spanish support.

<P>

<H1><A NAME="SECTION000100000000000000000">
Contact Details</A>
</H1>
 Dr Nicola Talbot
<BR>
School of Computing Sciences
<BR>
University of East Anglia
<BR>
Norwich.  NR4 7TJ.
<BR>
United Kingdom.
<BR> <TT><A NAME="tex2html5"
  HREF="http://theoval.cmp.uea.ac.uk/~nlct/">http://theoval.cmp.uea.ac.uk/~nlct/</A></TT>
<BR><HR><H4>Footnotes</H4>
<DL>
<DT><A NAME="foot179">... defined</A><A
 HREF="manual.html#tex2html4"><SUP>1</SUP></A></DT>
<DD>this
will be true if you have loaded <TT>babel</TT>

</DD>
</DL>
<BR><HR>
<ADDRESS>
Dr Nicola L C Talbot
2005-07-04
</ADDRESS>
</BODY>
</HTML>