• No results found

refenums - ReferenceableEnumElements Define named items and provide back-references with that name

N/A
N/A
Protected

Academic year: 2021

Share "refenums - ReferenceableEnumElements Define named items and provide back-references with that name"

Copied!
3
0
0

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

Hele tekst

(1)

refenums - ReferenceableEnumElements

Define named items and provide back-references with that name

This package provides commands to define enumerable items with a number and a long name, which can be referenced referenced later with the name or just the short form. For instance, “Milestone M1: Specification created” can be defined and later on be referenced with M1 or M1 ("Specification created"). The text in the references is derived from the definition and also rendered as hyperlink to the definition. Thus, a change of the definition also leads to a change of all references to the text. This ensures consistency in the text.

Usage

\usepackage{refenums}

Load the package after all packages (hyperref, cleveref, . . . ). For best results, use the nameinlink option at cleveref. The option capitalise is also useful if you use cleveref’s \cref command, therefore we recommend loading cleveref before refenumswith follwing line: \usepackage[capitalise,nameinlink]{cleveref}

Define the “Referenceable Enum Environment”

Decide for <EnumId>. E.g., req.

Initialize

\setupRefEnums{<EnumId>}{<PrintName>}

In case <PrintName> is set to ONLYSHORT, only the short name is used. Optional parameter: Separator between <EnumId> and number.

(Optional) Define shorthand macro to define the macros for referenc-ing

\newcommand{\def<EnumId>}[2]{\defRefEnum{<EnumId>}{#1}{#2}}

Usage in the text

Define a single enum

• \defRefEnum{<EnumId>}{<FullName>}{<LabelId>} (always supported) • \def<EnumId>{<FullName>}{<LabelId>} (when the shorthand command

is defined)

(2)

Define a single enum using the inline format

\defineReferenceableEnumElementInline{<EnumId>}{<FullName>}{<LabelId>}. Using this, a enumeration similar to the ones of the inparaenum environment is possible. inparaenum is offered by the [paralist package].

Referencing

• \refEnumFull{<EnumId>}{<LabelId>} = <EnumId>-<Counter> ("<FullName>"), e.g. R-1 ("Quality")

• \refEnumFullP{<EnumId>}{<LabelId>} is the long form for ‘\refEnum-Full’.

• \refEnumFullT{<EnumId>}{<LabelId>} = <EnumId>-<Counter>: "<FullName>", e.g. R-1: "Quality"

• \refEnum{<EnumId>}{<LabelId>} = <EnumId>-<Counter>, e.g. R-1 • References to the label

• \nameref{enum:<EnumId>:<LabelId>} = <FullName> • \ref{enum:<EnumId>:<LabelId>} = <Counter>, e.g. 1

Example

Initialize: \setupRefEnums{R}{Requirement}

Define a single enum: \defRefEnum{R}{Quality}{qual}. When you want to put the element in a section, use the optional parameter: \defRefEnum[section]{R}{Quality}{qual}

Referencing:

• Reference only Name + Number: \refEnum{R}{qual}

• Full reference with the print name in brackets: \refEnumFull{R}{qual} • Full reference with the print name appended after “:”: \refEnumFullT{R}{qual}

See alsodemo.tex.

Tuning

When defining a referenceable element, this element is enclosed using \refenumenclosing for normal enums and \refenumenclosinginline for inline enums. These commands can be redefined after package usage.

TODO

• The decision to put the enum in a section should be taken at \setupRefEnumsnot at \defRefEnum.

(3)

• Enable automatically generating \def<EnumId> at \setupRefEnums via a package parameter.

Source code

The latest source code is available at https://github.com/koppor/refenums

Files

• refenums.sty: the package • demo.tex: small demonstration

Referenties

GERELATEERDE DOCUMENTEN

This formula shows how the days necessary to perform the activities of the country manager are dependent of the current number of stores and the new stores that should be opened..

\listctr The item number inside numbered lists (ie. enumerate); user defined items are not counted: this is the value of the counter \@listctr. \type The type of the list

This package provides commands for vectors, matrices, and tensors with different styles (arrows as the L A TEX default, underlined, and

Numbers written in italic refer to the page where the corresponding entry is de- scribed; numbers underlined refer to the code line of the definition; plain numbers refer to the

A third level subheading is on the left margin, in bold, italics, and capitalized headline style.. A heading should never be the last text on

April 11th 1995 SPQR (added section formatting hook); April 14th 1995 SPQR (compatibility with hyperref); June 22 1995 SPQR (removed typeout from Sectionformat); September 22 1997

4 Sanah is het oudste kind van Sundeep Tucker en zijn vrouw. Noteer het nummer van elke uitspraak, gevolgd door “wel”

Informanten hebben aangegeven dat de identiteit in CMO’s is verzwakt door onder meer religieuze ontwikkelingen, maar uit de analyse van Dekker wordt duidelijk dat CMO’s niet