From dbad3960fac04316f576aa1bae89e5742f108e32 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 4 Feb 2009 14:26:56 +0000 Subject: new latex package modref (3feb09) git-svn-id: svn://tug.org/texlive/trunk@12072 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/modref/modref.drv | 173 +++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 Master/texmf-dist/source/latex/modref/modref.drv (limited to 'Master/texmf-dist/source/latex/modref/modref.drv') diff --git a/Master/texmf-dist/source/latex/modref/modref.drv b/Master/texmf-dist/source/latex/modref/modref.drv new file mode 100644 index 00000000000..8be728f3fa6 --- /dev/null +++ b/Master/texmf-dist/source/latex/modref/modref.drv @@ -0,0 +1,173 @@ +%% +%% This is file `modref.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% modref.dtx (with options: `driver') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from modref.drv. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file modref.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% ============================================================================================= +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +%% Package `modref' to use with LaTeX 2e +%% Copyright (C) 2007 J. Niel de Beaudrap, all rights reserved. +\documentclass[draft]{ltxdoc} +\usepackage[left=4.5cm,right=3cm,top=3cm,bottom=3cm]{geometry} +\usepackage{amsmath,amsthm} +\usepackage{modref} +\setlength\hfuzz{15pt} % dont make so many +\hbadness=7000 % over and under full box warnings + +\refstyle{itemNo}{[Item~\##1]} +\refstyle{numero}{\texttt{\itshape numero~#1}} +\refstyle{def}{Definition~#1} +\refstyle{lemma}{Lemma~#1} +\refstyle{thm}{Theorem~#1} +\refstyle{fig}{Figure~#1} +\refstyle{eqn}{Eqn.~#1} +\eqrefstyle{\textbf{(#1)}} +\displaytagstyle{{\Large$\bigcirc\mspace{-12mu}$}#1} +\stepcounter{equation} + +\makeatletter +\newenvironment{headerlist}{% +\setlength\topsep{\baselineskip}% +\setlength\parsep{1.3em}% +\setlength\parskip{1.3em}% +\setlength\listparindent{0ex}% +\def\next@item[##1]{% +\def\item{\egroup\next@item} +\@inmatherr\item +\bgroup +\addtolength\leftskip{2.5em}% + \par\noindent\hspace{-2.5em}\mbox{\headerliststyle{##1}}~\\[1ex]% +\setlength\parindent{0ex}% +\setlength\parskip{1ex}% +\ignorespaces} +\let\item\next@item +}{% +\par\egroup\leavevmode\noindent\ignorespaces +} +\newcommand\headerliststyle[1]{\texttt{\mdseries\upshape #1}} +\makeatother + +\newcommand\ie{\textit{i.e.}} +\newcommand\eg{\textit{e.g.}} +\newcommand\etc{\textit{etc.}} + +\begin{document} +\DocInput{modref.dtx} +\end{document} +%% Main text: +\newcommand\modref@error{\PackageError{modref}} +\edef\reserved@a{Ref}% +\@ifundefined\reserved@a{% + \let\Ref\ref +}{% + \modref@error{% + Command \string\Ref\ defined already; refer to the help message.% + }{% + The "modref" package defines the command \string\Ref\ to allow you (and + the package) to use the original functionality of \string\ref. However, in + this instance, \string\Ref\ already had a meaning when "modref" started + running. Please determine what is defining \string\Ref, and whether you need + it.}} +\def\@ifempty#1{\@xifempty#1@@..\@nil} +\long\def\@xifempty#1#2@#3#4#5\@nil{ % + \ifx#3#4\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} +\DeclareStringOption[:]{delimiter} +\ProcessKeyvalOptions* +\newcommand\setrefdelimiter[1]{% + \def\ref##1{\modref@ref##1#1\egroup\modref@basestyle}% + \def\varref##1{\modref@ref##1#1\egroup\modref@varbasestyle}% + \def\modref@ref##1#1##2\egroup##3{% + \@ifempty{##2}{% + \expandafter\@setref\csname r@##1\endcsname{##3\expandafter\@iden}{##1}% + }{% + \modref@@ref##1#1##2\egroup##3}}% + \def\modref@@ref##1#1##2#1\egroup##3{% + \@ifundefined{@modref@##1}{% + \expandafter\@setref\csname r@##1#1##2\endcsname{% + ##3\expandafter\@iden}{##1#1##2}% + }{% + \expandafter\def\expandafter\@tempa\expandafter{% + \csname @modref@##1\endcsname}% + \expandafter\@setref\csname r@##1#1##2\endcsname{% + ##3\expandafter\@tempa}{##1#1##2}% + }}% +}% +\ifx\modref@delimiter\@empty + \modref@error{Option "delimiter" must be set to a non-empty value}{% + The option "delimiter" was used, but seems to have been set to the + empty string. I require a character, or a multi-character string, to + delimit reference style names within cross-reference labels. If in + doubt, just remove the "delimiter" option, and this should fix things.}% +\else + \expandafter\setrefdelimiter\expandafter{\modref@delimiter}% +\fi +\newcommand\GlobalRefStyle[1]{\def\modref@@basestyle##1##2{#1}} +\newcommand\GlobalVarRefStyle[1]{\def\modref@@varbasestyle##1##2{#1}} +\@onlypreamble\GlobalRefStyle +\@onlypreamble\GlobalVarRefStyle +\def\modref@basestyle#1#2#3{\modref@@basestyle{#1{#2}}{#3}}% +\def\modref@varbasestyle#1#2#3{\modref@@varbasestyle{#1{#2}}{#3}}% +\GlobalRefStyle{#1}% +\GlobalVarRefStyle{#1}% +\edef\reserved@a{refstyle}% +\@ifundefined\reserved@a{% + \newcommand\refstyle[2]{% + \expandafter\def\csname @modref@#1\endcsname##1{#2}}% +}{% + \modref@error{% + Command \string\refstyle\ defined already; refer to the help message. + }{% + The "modref" package defines the command \string\refstyle; however, + in this instance, \string\refstyle\ already had a meaning when "modref" + started running. Please determine what is defining \string\refstyle, and + whether you need it.}} +\newcommand\eqrefstyle[1]{% + \def\eqref##1{% + \maketag@@@{% + \expandafter\@setref\csname r@##1\endcsname{% + \modref@trivbasestyle\expandafter\modref@eqref}{##1}}}% + \def\modref@eqref##1{#1}}% +\def\modref@trivbasestyle#1#2#3{#1{#2}} +\newcommand\displaytagstyle[1]{% + \def\modref@tagstyle##1{#1}% + \def\tagform@##1{\maketag@@@{\modref@tagstyle{##1}}}% + \@ifundefined{modref@eqref}{% + \eqrefstyle{\textup{(\ignorespaces#1\unskip\@@italiccorr)}}% + }\relax +}% +\makeatother +\endinput +%% +%% End of file `modref.drv'. -- cgit v1.2.3