Debian Codegraph @

texmf-dist/doc/latex/fncylab/fncylab.tex

raw
1 \documentclass[a4paper]{article}
2 \usepackage[a4paper]{geometry}
3
4 %\usepackage{miscdoc} % no idea where that package is (maybe just on Robin's home machine)
5 %
6 % so go manual ...
7
8 \newcommand\Package[1]{\texttt{#1}}
9 \newcommand\cs[1]{\texttt{\textbackslash#1}}
10 \newcommand\meta[1]{$\langle$\textnormal{\itshape#1}$\rangle$}
11 \newcommand\marg[1]{\texttt{\{\meta{#1}\}}}
12
13 \usepackage[T1]{fontenc} % needed for \textbackslash
14
15 %\usepackage[scaled=0.85]{luximono}
16
17 \def\labelformat{} \usepackage{fncylab} % testing
18
19 \begin{document}
20 \title{The \Package{fncylab} package}
21 \author{Robin Fairbairns\thanks{Email:
22 \emph{[email protected]} --- no longer active}}
23 \date{2019-08-23, version 1.1}
24 \maketitle
25
26 As of 2019 the \LaTeX{} kernel already contains these extra commands
27 and the modification to \cs{refstepcounter}. So on nevery kernels
28 this package is no longer necessary and will silently exit.
29
30 \section{Introduction}
31
32 The package provides support for arbitrary structuring of the way
33 label references look. The command \cs{labelformat}\marg{ctr}\marg{defn}
34 specifies the structure of a label:
35 \begin{description}
36 \item[\emph{\texttt{ctr}}] the counter that will define the label
37 (e.g., \texttt{section}, \texttt{figure}, \texttt{enumi} for outer
38 level list label references, etc.)
39 \item[\emph{\texttt{defn}}] the definition of how the counter will be
40 formatted in a reference. In this argument, \texttt{\#1}
41 (\emph{not} \texttt{\#\#1} as one might expect) substitutes the
42 `raw' value of the thing which is the source of the label.
43 \end{description}
44
45 The package makes use of a built-in LaTeX facility (which actually
46 needs a bit of patching before it's usable); this allows the precise
47 layout of the references to labels generated from any LaTeX counter
48 to be altered. Note that the way in which the counter itself is
49 represented in references depends on \cs{the\meta{counter}}\,---\,it's
50 the same as the way the counter gets printed.
51
52 \section{An example}
53
54 The \LaTeX{} code:
55 \begin{quote}
56 \begin{verbatim}
57 \labelformat{section}{section #1}
58 ...
59 \section{The Blah Field}\label{blah}
60 ...
61 ... As we saw above in~\ref{blah} ...
62 \end{verbatim}
63 \end{quote}
64 will typeset its last line as
65 \begin{quote}
66 \dots\@ As we saw above in section 3 \dots
67 \end{quote}
68
69 For references at the start of a sentence, the package defines a
70 command \cs{Ref}, which is used as one might expect:
71 \begin{quote}
72 \begin{verbatim}
73 ... \Ref{blah} shows us that ...
74 \end{verbatim}
75 \end{quote}
76 which will typeset as
77 \begin{quote}
78 \dots\@ Section 3 shows us that \dots
79 \end{quote}
80
81 A demonstration of \cs{labelformat}, using the \Package{enumerate}
82 package, may be found in the file \texttt{fncylab-example.tex}, which
83 is part of the distribution.
84 \end{document}