A Package to Subnumber L^{A}TEX Counters

Patrick W. Daly

This paper describes package sublabel version 4.5 from 1999/02/23 It is part of the preprint collection of packages

Summary

The stripped version of this file contains the following brief description:

% To change a counter foo so that it has sublabels (4a 4b 4c ...)
% give the command \sublabon{foo}... \sublaboff{foo}
%
% The style of the sublabel is given by command \substyle, which takes one
% argument, a counter. It may be redefined in the document to be whatever
% style is wanted.
<209> % Default is {\it\alph{#1}}, ie italic lowercase numbers.
<*!209>
% Default is {\itshape\alph{#1}}, ie italic lowercase numbers.
%
% Options for LaTeX2e:
%   roman   the style of sublabels is small roman letter
%   italic  the style is small italic letter (default)
</!209>

1 Introduction

The macros in this package allow all counters to be subnumbered, as for example 4a, 4b, 4c, simply by bracketting the objects to be so numbered with appropriate on/off commands. These commands specify which counters are to be subnumbered, and they are of global effect. This means that they will work with any user-defined counters too, and that their effect goes beyond any current environment.

2 Invoking the Package

The macros in this package are included in the main document with the \usepackage command of L^{A}TEX 2ε,

    \documentclass[..]{...}
    \usepackage[options]{sublabel}

where the possible options are:

italic to have subnumbers as italic lowercase letters (default);

roman to have the subnumbers as Roman lowercase letters, as 4a.

Alternatively, the name of the package is added as an option to the \documentstyle command in L^{A}TEX 2.09 compatibility mode, as

     \documentstyle[..sublabel..]{...}

In this case, no options are possible.

3 Usage

\sublabon In order to number equations, figures, plates, and tables automatically with sub- \sublaboff numbers (e.g. 4a, 4b, 4c) use the commands \sublabon and \sublaboff. These

commands take as argument the name of the counter that is to be subnumbered, i.e. equation, figure, or table. The on and off versions bracket the objects that are to be labelled with the same number but different letters. For example,

      \sublabon{figure}
      \begin{figure}
        \caption{Text of Fig. 4a}
      \end{figure}
      \begin{figure}
        \caption{Text of Fig. 4b}
      \end{figure}
      \sublaboff{figure}

These commands also work for the equation environment in the same way. For the eqnarray environment, some care must be taken. The \sublabon command is to be given in the first equation to be bracketted, before the \label and \\ commands, while the \sublaboff command is given after the \\ of the last equation in the group. If necessary, it must come after \end{eqnarray}.

      \begin{eqnarray}
        x & = & a \label{eq:x}\\%--> 1
        \sublabon{equation}
        y & = & b \label{eq:y}\\%--> 2a
        z & = & c \label{eq:z}\\%--> 2b
        \sublaboff{equation}
        w & = & d \label{eq:w}  %--> 3
      \end{eqnarray}

If two groups appear adjacently, it is only necessary to give \sublabon between them.

\substyle The style in which the sublabels are written is determined by a command \substyle. Its default definition is as italic lowercase letters.^{1} If one wishes, this may be changed in the document itself. It must take an argument that is a counter. For example, to change the style of sublabels to be as 5–A, 5–B, 5–C, give

1In L^{A}TEX 2ε, if the option roman is added to the \usepackage command, then the default is upright lowercase letters.

     \renewcommand{\substyle}[1]{--\Alph{#1}}

4 Interference with Other Options

If both sublabel and figcaps packages are to be used together, then sublabel must be input first. This is because figcaps makes modifications so that the sublabelling also works on the page of figure captions.

Other packages (like amsmath) also modify some of the commands redefined here. As of version 4.4, the redefinitions are delayed until after all packages are loaded, so that this conflict is avoided. For earlier versions, things went wrong if amsmath were loaded after filename.