summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/register
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-03-18 23:49:25 +0000
committerKarl Berry <karl@freefriends.org>2007-03-18 23:49:25 +0000
commit8550a5a737c909d12e87b3f1bad87c7975856072 (patch)
treef0bfd1c818ff86fd07252d4888ccac7977c933f7 /Master/texmf-dist/source/latex/register
parent95bb6802908cac4ec42d2c5a37cb42598b2980a4 (diff)
register update (9mar07)
git-svn-id: svn://tug.org/texlive/trunk@4059 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/register')
-rw-r--r--Master/texmf-dist/source/latex/register/register.dtx53
1 files changed, 40 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/latex/register/register.dtx b/Master/texmf-dist/source/latex/register/register.dtx
index 0c9c210f685..2d8f3131b03 100644
--- a/Master/texmf-dist/source/latex/register/register.dtx
+++ b/Master/texmf-dist/source/latex/register/register.dtx
@@ -20,7 +20,7 @@
\ProvidesFile{register.dtx}
%</dtx>
% \fi
-% \CheckSum{575}
+% \CheckSum{589}
%
% \changes{v0.1}{1999/03/29}{First release}
% \changes{v0.2}{2000/01/29}{Added regdesc environment, for use under LyX}
@@ -37,9 +37,10 @@
% \changes{v1.2}{2003/03/31}{Removed requirement to specify register offset}
% \changes{v1.3}{2003/11/24}{Changed how center is handled within register environment}
% \changes{v1.4}{2004/08/16}{Now provide a boolean set only in register context}
+% \changes{v1.5}{2007/03/08}{Corrected use of conditionals used in spreading register reset value}
%
-% \def\fileversion{v1.4}
-% \def\filedate{2004/08/16}
+% \def\fileversion{v1.5}
+% \def\filedate{2007/03/08}
% \title{Register diagrams with field descriptions}
% \author{Matthew Lovell\\
% \texttt{lovell@indra.com}
@@ -497,7 +498,7 @@
%
% Announce the name and load required packages:
% \begin{macrocode}
-\ProvidesPackage{register} [2004/08/16 v1.4 Register macros with
+\ProvidesPackage{register} [2007/03/08 v1.5 Register macros with
hyperref/LyX support]
\RequirePackage{ifthen}[1997/11/02]
@@ -728,17 +729,43 @@ hyperref/LyX support]
% \end{macrocode}
%
%
+% \begin{macro}{\regUnderScore}
+% \begin{macro}{\regFiller}
+% \begin{macro}{\regSpread}
% The next definitions provide a method of spreading out
% an argument, i.e., placing |\hfill|'s between each character.
% They can be used to space the reset value of a register field
-% appropriately.
+% appropriately. Previous versions of these macros used \TeX{}'s
+% conditionals incorrectly.
+%
+% If you are using the |underscore| package, you should
+% \emph{repeat} the definition of |\regUnderScore|, after loading
+% |underscore| in order to observe the changes made by that package.
+% The spreading macros below strive to strip out underscores.
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macrocode}
-\def\spread#1{{\count0=0 \spreadaux#1\end}}
-\def\spreadaux#1{%
- \ifx#1\end \let\next=\relax%
- \else\ifx#1_\let\next=\spreadaux%
- \else\advance\count0 by 1 \ifnum\count0>1{}\hfill\fi #1 %
- \let\next=\spreadaux\fi\fi\next}
+\def\regUnderScore{_}%
+\def\regFiller#1{\def\regInner{#1}%
+\ifx\regInner\regUnderScore%
+\else%
+\ifnum\count0>0%
+\hfill#1%
+\else#1\fi%
+\fi%
+\advance\count0 by 1%
+}
+\def\regSpread#1{\count0=0{}\regSpreadaux#1\empty}
+\def\regSpreadaux#1#2\empty{\def\aux{#1}%\show#1%
+\ifx\aux\empty%
+\else%
+\def\aux{#2}%
+\regFiller{#1}%
+\ifx\aux\empty%
+\else%
+\regSpreadaux#2\empty%
+\fi\fi}
% \end{macrocode}
%
%
@@ -801,7 +828,7 @@ hyperref/LyX support]
\makebox[0pt][l]{\raisebox{-1\regResetDrop}{\framebox[\regFieldLen][c]%
% Place an invisible rule to control the box
% surrounding the reset field
- {\regResetSize \rule[-1\regResetDepth]{0pt}{\regResetHeight} \spread{#1}}}}%
+ {\regResetSize \rule[-1\regResetDepth]{0pt}{\regResetHeight}\regSpread{#1}}}}%
}
% \end{macrocode}
%
@@ -883,7 +910,7 @@ hyperref/LyX support]
\regRotateFieldName%
% Typeset field value
\framebox[\regFieldLen][c]%
- {\tiny \spread{#3}}%
+ {\tiny\regSpread{#3}}%
\hspace{-1\fboxrule}%
}
% \end{macrocode}