From fa5f154fe81b5cfda43334d7f4caa424b5e0a302 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 8 Mar 2010 17:14:01 +0000 Subject: fncylab update (7mar10) git-svn-id: svn://tug.org/texlive/trunk@17382 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/fncylab/fncylab-example.tex | 78 +++++++++++++++++++++ Master/texmf-dist/doc/latex/fncylab/fncylab.pdf | Bin 0 -> 210727 bytes Master/texmf-dist/doc/latex/fncylab/fncylab.tex | 64 +++++++++++++++++ Master/texmf-dist/tex/latex/fncylab/fncylab.sty | 61 ++++++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + Master/tlpkg/tlpsrc/fncylab.tlpsrc | 0 7 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/fncylab/fncylab-example.tex create mode 100644 Master/texmf-dist/doc/latex/fncylab/fncylab.pdf create mode 100644 Master/texmf-dist/doc/latex/fncylab/fncylab.tex create mode 100644 Master/texmf-dist/tex/latex/fncylab/fncylab.sty create mode 100644 Master/tlpkg/tlpsrc/fncylab.tlpsrc diff --git a/Master/texmf-dist/doc/latex/fncylab/fncylab-example.tex b/Master/texmf-dist/doc/latex/fncylab/fncylab-example.tex new file mode 100644 index 00000000000..97f9d4173c8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/fncylab/fncylab-example.tex @@ -0,0 +1,78 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% small sample file +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass{article} +% +% a brief demonstration of the use of fncylab +% +\usepackage{fncylab,enumerate} +\begin{document} +% +% outer level lists (such as enumerate) use counter enumi for their +% list tags. +\begin{enumerate}[(i)] +\item first item, defining a non-fancy label \label{first} +% +% that label was defined to look otherwise than it was printed for the +% item: +\item second item (see also item~\ref{first}) +% +% redefine label formats for this list's labels: +\labelformat{enumi}{(#1)} +% +% and label the another item in a different way: +\item third item, defining a fancy label \label{third} +% +% redefine label formats for this list's labels again: +\labelformat{enumi}{item~(#1)} +% +% we now see that the label has for item three has been defined +% differently, and that for item four differently again. note the +% reference starting a new sentence. +\item fourth item, defining a fancy label in a different format (see + also item~\ref{third}). \Ref{fourth} shows how a sentence may start + with reference to a fancy label; note that it's the \emph{label} + that's fancy, so the second change to the label format only affects + the labels defined after it. \label{fourth} +\end{enumerate} +\end{document} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% small sample file +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\documentclass{article} +% +% a brief demonstration of the use of fncylab +% +\usepackage{fncylab,enumerate} +\begin{document} +% +% outer level lists (such as enumerate) use counter enumi for their +% list tags. +\begin{enumerate}[(i)] +\item first item, defining a non-fancy label \label{first} +% +% that label was defined to look otherwise than it was printed for the +% item: +\item second item (see also item~\ref{first}) +% +% redefine label formats for this list's labels: +\labelformat{enumi}{(#1)} +% +% and label the another item in a different way: +\item third item, defining a fancy label \label{third} +% +% redefine label formats for this list's labels again: +\labelformat{enumi}{item~(#1)} +% +% we now see that the label has for item three has been defined +% differently, and that for item four differently again. note the +% reference starting a new sentence. +\item fourth item, defining a fancy label in a different format (see + also item~\ref{third}). \Ref{fourth} shows how a sentence may start + with reference to a fancy label; note that it's the \emph{label} + that's fancy, so the second change to the label format only affects + the labels defined after it. \label{fourth} +\end{enumerate} +\end{document} diff --git a/Master/texmf-dist/doc/latex/fncylab/fncylab.pdf b/Master/texmf-dist/doc/latex/fncylab/fncylab.pdf new file mode 100644 index 00000000000..93d495f05f1 Binary files /dev/null and b/Master/texmf-dist/doc/latex/fncylab/fncylab.pdf differ diff --git a/Master/texmf-dist/doc/latex/fncylab/fncylab.tex b/Master/texmf-dist/doc/latex/fncylab/fncylab.tex new file mode 100644 index 00000000000..1faab4c28fa --- /dev/null +++ b/Master/texmf-dist/doc/latex/fncylab/fncylab.tex @@ -0,0 +1,64 @@ +\documentclass[a4paper]{article} +\usepackage[a4paper]{geometry} +\usepackage{miscdoc} +\usepackage[scaled=0.85]{luximono} +\begin{document} +\title{The \Package{fncylab} package} +\author{Robin Fairbairns\thanks{Email: + \emph{robin.fairbairns@cl.cam.ac.uk}}} +\date{2003-08-13, version 1.0} +\maketitle + +The package provides support for arbitrary structuring of the way +label references look. The command \cmdinvoke*{labelformat}{ctr}{defn} +specifies the structure of a label: +\begin{description} +\item[\emph{\texttt{ctr}}] the counter that will define the label + (e.g., \texttt{section}, \texttt{figure}, \texttt{enumi} for outer + level list label references, etc.) +\item[\emph{\texttt{defn}}] the definition of how the counter will be + formatted in a reference. In this argument, \texttt{\#1} + (\emph{not} \texttt{\#\#1} as one might expect) substitutes the + `raw' value of the thing which is the source of the label. +\end{description} + +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 \cs{the\meta{counter}}\,---\,it's +the same as the way the counter gets printed. + +\section{An example} + +The \LaTeX{} code: +\begin{quote} +\begin{verbatim} +\labelformat{section}{section #1} +... +\section{The Blah Field}\label{blah} +... +... As we saw above in~\ref{blah} ... +\end{verbatim} +\end{quote} +will typeset its last line as +\begin{quote} + \dots\@ As we saw above in section 3 \dots +\end{quote} + +For references at the start of a sentence, the package defines a +command \cs{Ref}, which is used as one might expect: +\begin{quote} +\begin{verbatim} +... \Ref{blah} shows us that ... +\end{verbatim} +\end{quote} +which will typeset as +\begin{quote} + \dots\@ Section 3 shows us that \dots +\end{quote} + +A demonstration of \cs{labelformat}, using the \Package{enumerate} +package, may be found in the file \texttt{fncylab-example.tex}, which +is part of the distribution. +\end{document} diff --git a/Master/texmf-dist/tex/latex/fncylab/fncylab.sty b/Master/texmf-dist/tex/latex/fncylab/fncylab.sty new file mode 100644 index 00000000000..b28439bcec3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/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 -- 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 diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index c53e60899d2..64ddacbad72 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -124,7 +124,7 @@ my @TLP_working = qw( flabels flacards flagderiv flashmovie flippdf float floatrow flowfram fltpage fltpoint fmtcount - fn2end fnbreak fncychap fnpara + fn2end fnbreak fncychap fncylab fnpara foekfont font-change fontch fontinst fontools fontspec fonttable fontwrap footbib footmisc footnpag forarray forloop formular diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index ec153784bb1..2df5def1ed9 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -227,6 +227,7 @@ depend fmtcount depend fn2end depend fnbreak depend fncychap +depend fncylab depend fnpara depend foilhtml depend fonttable diff --git a/Master/tlpkg/tlpsrc/fncylab.tlpsrc b/Master/tlpkg/tlpsrc/fncylab.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3