| 1 |
\documentclass[DIV=7, pagesize=auto]{scrartcl} |
| 2 |
|
| 3 |
\usepackage{fixltx2e} |
| 4 |
\usepackage{etex} |
| 5 |
\usepackage{lmodern} |
| 6 |
\usepackage[T1]{fontenc} |
| 7 |
\usepackage{textcomp} |
| 8 |
\usepackage{microtype} |
| 9 |
\usepackage[unicode=true]{hyperref} |
| 10 |
|
| 11 |
\newcommand*{\pkg}[1]{\textsf{#1}} |
| 12 |
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} |
| 13 |
\makeatletter |
| 14 |
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} |
| 15 |
\makeatother |
| 16 |
\newcommand*{\meta}[1]{\textlangle\textsl{#1}\textrangle} |
| 17 |
\newcommand*{\marg}[1]{\texttt{\{}\meta{#1}\texttt{\}}} |
| 18 |
\newcommand*{\oarg}[1]{\texttt{[}\meta{#1}\texttt{]}} |
| 19 |
\newcommand*{\ml}[1]{\leavevmode\marginline{\small#1}\ignorespaces} |
| 20 |
|
| 21 |
\reversemarginpar |
| 22 |
|
| 23 |
\addtokomafont{title}{\rmfamily} |
| 24 |
|
| 25 |
\title{The \pkg{chngcntr} package\thanks{This manual corresponds to \pkg{chngcntr}~v1.0a, dated~2009/09/02.}} |
| 26 |
\author{Author: Peter Wilson\and Maintainer: Will Robertson} |
| 27 |
\date{2018/04/09} |
| 28 |
|
| 29 |
|
| 30 |
\begin{document} |
| 31 |
|
| 32 |
\maketitle |
| 33 |
|
| 34 |
\section{Usage} |
| 35 |
|
| 36 |
In \LaTeX, a new counter called, say `\meta{ctr}', is created by the command |
| 37 |
\cmd{\newcounter}\marg{ctr}\oarg{within}. If the optional \meta{within} argument is given |
| 38 |
the the counter `\meta{ctr}' is reset to zero each time the counter `\meta{within}' |
| 39 |
changes. The command \cmd{\the\meta{ctr}} typesets the value of the counter \meta{ctr}. |
| 40 |
This is automatically defined by \cmd{\newcounter} and is initialised |
| 41 |
to typeset arabic numerals. |
| 42 |
|
| 43 |
\ml{\cmd{\counterwithin}\\\cmd{\counterwithin*}} |
| 44 |
It is sometimes desireable to change a counter that has been defined |
| 45 |
by \cmd{\newcounter}\marg{ctr} to act as though it had been defined as |
| 46 |
\cmd{\newcounter}\marg{ctr}\oarg{within}. The package provides the command |
| 47 |
\cmd{\counterwithin}\marg{ctr}\marg{within} that accomplishes this. By default, |
| 48 |
it also redefines the \cmd{\the\meta{ctr}} command so that it typesets values |
| 49 |
in the style \texttt{\cmd{\the\meta{within}}.\cmd{\arabic}\marg{ctr}}. The starred version of the |
| 50 |
command suppresses the redefinition of \cmd{\the\meta{ctr}} |
| 51 |
(e.\,g., \cmd{\counter\-within*}\verb+{ctr}{within}+). |
| 52 |
|
| 53 |
\ml{\cmd{\counterwithout}\\\cmd{\counterwithout*}} |
| 54 |
Likewise, the command \cmd{\counterwithout}\marg{ctr}\marg{within} changes a |
| 55 |
counter that has been created by \cmd{\newcounter}\marg{ctr}\oarg{within} to act |
| 56 |
as though it had been created by \cmd{\newcounter}\marg{ctr}. By default it |
| 57 |
also redefines the \cmd{\the\meta{ctr}} command so that it just typesets an arabic |
| 58 |
numeral. The starred version of the command suppresses the redefinition |
| 59 |
of \cmd{\the\meta{ctr}}. |
| 60 |
|
| 61 |
Any number of \cmd{\counterwithin}\marg{ctr}\marg{\ldots} and \cmd{\counterwith\-out}\marg{ctr}\marg{\ldots} |
| 62 |
commands can be issued for a given counter, \meta{ctr}, if you wish to toggle |
| 63 |
between the two styles. The current value of \meta{ctr} is unaffected by |
| 64 |
\cmd{\counterwithin} and \cmd{\counterwithout}. If you want to change the value |
| 65 |
after one of these commands, use \cmd{\set\-counter}\marg{ctr}\marg{\ldots}, and to change |
| 66 |
the typeseting style use \cmd{\renew\-command}\texttt{\{}\cmd{\the\meta{ctr}}\texttt{\}}\marg{\ldots}. |
| 67 |
|
| 68 |
|
| 69 |
\section{Change History:} |
| 70 |
|
| 71 |
\begin{tabular}{@{}l@{ -- }l@{}} |
| 72 |
v1.0a & New maintainer (Will Robertson)\\ |
| 73 |
v1.1a & The package commands are now defined in the format |
| 74 |
\end{tabular} |
| 75 |
|
| 76 |
\end{document} |
| 77 |
|