公式编号,序号___LaTeX Counters

来源:百度文库 编辑:神马文学网 时间:2024/04/24 19:21:57

Hypertext Help with LaTeX

Counters

Everything LaTeX numbers for you has a counter associatedwith it. The name of the counter is the same as the name ofthe environment or command that produces the number, exceptwith no \. Below is a list of some of the countersused in LaTeX's standard document styles to controlnumbering.

 part            paragraph       figure          enumichapter         subparagraph    table           enumiisection         page            footnote        enumiiisubsection      equation        mpfootnote      enumivsubsubsection

Manipulating the way counters are printed

Counters are printed in LaTeX by using a command generated as"\the" suffixed with the name of the counter. Thus,equation numbers are printed by the \theequationcommand, and section numbers by the \thesectioncommand. If you want to change the way such numbers areprinted, for example, change from arabic to Roman numerals, youneed to redefine the appropriate command, using the\renewcommand command.

As an example, to number equations in an appendix as A-1,A-2, ... , use

  \renewcommand{\theequation}{A-\arabic{equation}}

The second argument implies that the text produced by the renewed\theequation command will be "A-" followed by the output fromthe \arabic{equation} command, which is the value of theequation counter, printed as an arabic number.

In List Environments the format for theitem labels is given by commands like \labelitemi and\labelitemii (for the first two levels of theItemize Environment), and like\labelenumi (for the EnumerateEnvironment), and these may also be redefined.

There is an example ofmanipulating such counters in the discussion of the ListEnvironment. See also the discussions in theItemize Environment and in theEnumerate Environment.

You can force a change in the number produced by any of thecounters. For example, if you wanted to produce a single pagenumbered 13, you could use

  \setcounter{page}{13}

A variety of commands for manipulating counters this way aregiven below.

Related topics

  • Commands that manupulate counters
    • \addtocounter
    • \newcounter
    • \setcounter
    • \usecounter
    • \value
    • \renewcommand
  • Commands that print the value of a counter in various formats
    • \arabic
    • \alph \Alph
    • \roman \Roman
    • \fnsymbol
  • For some examples of usage in list environments, see
    • List Enviroment
    • Itemize Environment
    • Enumerate Environment

See also Sectioning
Return to LaTeX Table of Contents