summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fncylab/fncylab.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fncylab/fncylab.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/fncylab/fncylab.sty')
-rw-r--r--macros/latex/contrib/fncylab/fncylab.sty61
1 files changed, 61 insertions, 0 deletions
diff --git a/macros/latex/contrib/fncylab/fncylab.sty b/macros/latex/contrib/fncylab/fncylab.sty
new file mode 100644
index 0000000000..b28439bcec
--- /dev/null
+++ b/macros/latex/contrib/fncylab/fncylab.sty
@@ -0,0 +1,61 @@
+% FNCYLAB.STY v1.0
+% Copyright 2000,2003 Robin Fairbairns (robin.fairbairns@cl.cam.ac.uk)
+%
+% This program can redistributed and/or modified under the terms
+% of the LaTeX Project Public License; either version 1.2 of the
+% license, or (at your option) any later version.
+%
+% See http://www.latex-project.org/lppl.txt for the latest version
+% of the license.
+%
+% This package provides support for arbitrary structuring of the way
+% label references look. The \labelformat command takes two
+% arguments:
+% #1 the counter that will define the label (e.g., section, figure,
+% enumi, etc.)
+% #2 the definition of how the label will be formatted: in this
+% argument, #1 (*not* ##1) substitutes the `raw' value of the
+% thing which is the source of the label.
+%
+% The package makes use of a built-in LaTeX facility (which actually
+% needs a bit of patching before it's usable); this allows the precise
+% layout of the references to labels generated from any LaTeX counter
+% to be altered. Note that the way in which the counter itself is
+% represented in references depends on \the<counter> -- it's the same
+% as the way the counter gets printed.
+%
+% example
+% \labelformat{section}{section #1}
+% ...
+% \section{The Blah Field}\label{blah}
+% ...
+% ... As we saw above in~\ref{blah} ...
+%
+% will typeset as
+% ... As we saw above in section 3 ...
+%
+% For references at the start of a sentence, the package defines a
+% command \Ref, which is used as follows:
+% ... \Ref{blah} shows us that ...
+%
+% which will typeset as
+% ... Section 3 shows us that ...
+
+% this check and redefinition is suggested in the latex source
+% (ltxref.dtx)
+\CheckCommand*\refstepcounter[1]{\stepcounter{#1}%
+ \protected@edef\@currentlabel
+ {\csname p@#1\endcsname\csname the#1\endcsname}%
+}
+\renewcommand*\refstepcounter[1]{\stepcounter{#1}%
+ \protected@edef\@currentlabel
+ {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}%
+}
+
+\def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1}
+
+\DeclareRobustCommand\Ref[1]{\protected@edef\@tempa{\ref{#1}}%
+ \expandafter\MakeUppercase\@tempa
+}
+
+\endinput