• No results found

This package offers commands for typesetting total values of counters.

N/A
N/A
Protected

Academic year: 2021

Share "This package offers commands for typesetting total values of counters."

Copied!
3
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The totalcount package

Axel Sommerfeldt

https://gitlab.com/axelsommerfeldt/totalcount 2013/05/12

Abstract

This package offers commands for typesetting total values of counters.

Contents

1 Loading the package 1

2 \DeclareTotalCounter 2

3 Spacing 2

4 Thanks 2

1 Loading the package

Load this package using

\usepackage[hoptionsi]{totalcount} , where hoptionsi is a list of names of L A TEX counters, e.g.:

\usepackage[figure,table]{totalcount} .

This way the commands \totalfigures and \totaltables will be defined which are typesetting the total number of figures resp. tables, e.g.:

This document contains \totalfigures\ figures.

Furthermore the commands \iftotalfigures and \iftotaltables are offered for typesetting text only if the document contains figures resp. tables at all, e.g.:

\iftotalfigures

\listoffigures

\fi

This package has version number v1.0.

1

(2)

This should work with other counters as well (for example equation, or lstlisting offered by the listings package [1]), but please note that using the page counter here is not supported.

2 \DeclareTotalCounter

\DeclareTotalCounter{hcounteri}

actually defines the commands \totalhcounteris and \iftotalhcounteris.

So in fact

\usepackage[figure,table]{totalcount}

is identical to

\usepackage{totalcount}

\DeclareTotalCounter{figure}

\DeclareTotalCounter{table}

3 Spacing

The space after all L A TEX commands without (optional or mandatory) arguments like

\totalfigures will not be typeset, so these commands needs to be finished with an additional backslash or an empty pair of curly braces right before the space character, or to be finished with a tilde (swung dash), so TEX will be prevented from omitting the following space character.

This could be avoided by defining new commands with the help of the xspace package [2].

When using the totalcount package with the package option xspace this will be actually done, so after

\usepackage[figure,table,xspace]{totalcount}

code like

This document contains \totalfigures figures.

will give correct results without a missing space between the total number of figures and the word “figures”.

4 Thanks

I would like to thank Herbert Voß since the implementation of this package is based on an idea from him which could be found at http://texnik.dante.de/cgi-bin/

mainFAQ.cgi?file=counter/counter#number.

2

(3)

References

[1] Carsten Heinz & Brooks Moses:

The Listings Package, 2007/02/22

[2] David Carlisle and Morten Høgholm:

The xspace package, 2009/10/20

3

Referenties

GERELATEERDE DOCUMENTEN

For example, you could want to have line numbers on the right when your are in parallel pages (or in normal typesetting), but when you are in parallel columns, to have them on the

are defined: The current level, the number of children the current node has, the maximum level specified, also, the current branchmult, and whether the current node should be

We look whether the token list contains the bizarre list followed by \protect and the same name (with two spaces) which happens if #2 is a control sequence defined

This example document has an eccentric section numbering system where the section number is prefixed by the chapter number in square brackets.. [1]1 First

sample entry that occurs at the start of the chapter title appears in lower case in the PDF bookmarks, since the case-changing command can’t be used

With the optional parameter h-offset one can adapt the (horizontal ) distance between hand and compass (default 0pt). The 4 mandatory parameters define the cards for the

Goossens, Mittelbach, and Samarin (see 1994, pp. 59–63) show that this is just filler text..

The manual for Version 1.01 (attached to this distribution and published as a reference book [3]) and the manual for Version 2.00 (attached to this distribution) have described