texlive[48433] Master/texmf-dist: register (18aug18)

commits+karl at tug.org commits+karl at tug.org
Sat Aug 18 23:19:02 CEST 2018


Revision: 48433
          http://tug.org/svn/texlive?view=revision&revision=48433
Author:   karl
Date:     2018-08-18 23:19:02 +0200 (Sat, 18 Aug 2018)
Log Message:
-----------
register (18aug18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/register/register.pdf
    trunk/Master/texmf-dist/source/latex/register/register.dtx
    trunk/Master/texmf-dist/tex/latex/register/register.sty

Modified: trunk/Master/texmf-dist/doc/latex/register/register.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/register/register.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/register/register.dtx	2018-08-18 21:18:32 UTC (rev 48432)
+++ trunk/Master/texmf-dist/source/latex/register/register.dtx	2018-08-18 21:19:02 UTC (rev 48433)
@@ -20,29 +20,10 @@
 \ProvidesFile{register.dtx}
 %</dtx>
 % \fi
-% \CheckSum{593}
+% \CheckSum{739}
 %
-% \changes{v0.1}{1999/03/29}{First release}
-% \changes{v0.2}{2000/01/29}{Added regdesc environment, for use under LyX}
-% \changes{v0.21}{2000/03/12}{Fixed minute problem shown in regs with lots of 1-bit fields}
-% \changes{v0.3}{2000/06/19}{Added reglabelb macro, for setting label without a drop}
-% \changes{v0.31}{2000/07/11}{Modified names of lengths used within macros}
-% \changes{v0.32}{2000/08/02}{Modified regdesc env to use regdescsep for vertical separation}
-% \changes{v0.4}{2001/08/11}{Added macros for marginal Tape Release flags}
-% \changes{v0.5}{2001/08/12}{Added package options for handling LyX, hyperref, and TR flags}
-% \changes{v0.6}{2001/08/19}{Moved chapter redefinition into package; improved TR flags}
-% \changes{v1.0}{2001/09/06}{Created .dtx documentation; first public release}
-% \changes{v1.01}{2003/01/17}{Removed automatic label in register diagrams}
-% \changes{v1.1}{2003/02/15}{Changed length manipulation to work with parskip package}
-% \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}
-% \changes{v1.6}{2011/01/11}{Mainmatter correction suggested by Kjetil Oftedal}
-% \changes{v1.6.1}{2018/05/19}{Published with updated email address; no functional changes}
-%
-% \def\fileversion{v1.6.1}
-% \def\filedate{2018/05/19}
+% \def\fileversion{v1.7}
+% \def\filedate{2018/08/18}
 % \title{Register diagrams with field descriptions}
 % \author{Matthew Lovell\\
 %  \texttt{lovells at gmail.com}
@@ -68,17 +49,15 @@
 %<*driver>
 \documentclass{ltxdoc}
 \RequirePackage{textcomp}
-\RequirePackage[TRflags,TRboxed]{register}
+\RequirePackage[TRflags,TRboxed,color]{register}
 \RequirePackage{amsmath}
 \RequirePackage{amssymb}
 \setlength{\regWidth}{0.98\textwidth}
 \setlength{\TRwidth}{40pt}
-% Uncomment the next two lines for a change history. 
-% \AtBeginDocument{\RecordChanges}
-% \AtEndDocument{\PrintChanges}
+\RecordChanges
 \begin{document}
-\DocInput{register.dtx}
-%% \RecordChanges
+  \DocInput{register.dtx}
+%  \PrintChanges
 \end{document}
 %</driver>
 % \fi
@@ -85,6 +64,7 @@
 %
 % \listofregisters
 %
+%
 % \section{Introduction} \label{sec:background}
 %
 % My group at work designed the memory and I/O controllers for servers
@@ -377,7 +357,7 @@
 % \end{verbatim}
 %
 %
-% \begin{register}{htbp}{Configuration}{0x2848}^^A  NAME=ROPE_CONFIG
+% \begin{register}{htbp}{Configuration}{0x2848}^^A  NAME=CONFIG
 % \label{Configuration}^^A
 % \regfield{soft reset perf}{1}{63}{0}^^A  STATUS
 % \regfield{reserved}{30}{33}{0}^^A 
@@ -465,6 +445,45 @@
 % \LaTeX{} run.
 % \end{macro}
 %
+% \subsection{Background Colors} \label{sec:colors}
+%
+% With Version 1.7, this package also supports an optional |color| package option.  If that option
+% is present, then |xcolor| is loaded and the |\regfield| and |\regfieldb| macros support an 
+% optional first argument that is used as fill color for the boxes drawn by |\framebox|.  Internally,
+% |\colorbox| is used to provide this functionality.
+%
+% Repeating our example from earlier, but with some fill colors specified:
+% \begin{verbatim}
+% \begin{register}{H}{Color Example}{0x250}% name=example
+%   \label{colexample}%
+%   \regfield{FIFO depth}{6}{58}{{random}}%
+%   \regfield[green!30]{Something}{4}{54}{1100}%
+%   \regfield[gray!20]{Status}{21}{33}{{uninitialized}}%
+%   \regfield{Enable}{1}{32}{1}%
+%   \reglabel{Reset}\regnewline%
+%   \regfield{Counter}{10}{22}{{0x244}}% READ_ONLY
+%   \regfield[red!20]{Howdy}{5}{17}{1_1010}%
+%   \regfield{Control}{1}{16}{-}%
+%   \regfield[yellow!50]{Hardfail}{1}{15}{1}%
+%   \regfield[gray!20]{Data}{15}{0}{{uninitialized}}%
+%   \reglabel{Reset}%\regnewline%
+%  \end{register}
+% \end{verbatim}
+% now yields the following:
+% \begin{register}{H}{Color Example}{0x250}^^A name=example
+%   \label{colexample}^^A
+%   \regfield{FIFO depth}{6}{58}{{random}}^^A
+%   \regfield[green!30]{Something}{4}{54}{1100}^^A
+%   \regfield[gray!20]{Status}{21}{33}{{uninitialized}}^^A
+%   \regfield{Enable}{1}{32}{1}^^A
+%   \reglabel{Reset}\regnewline^^A
+%   \regfield{Counter}{10}{22}{{0x244}}^^A READ_ONLY
+%   \regfield[red!20]{Howdy}{5}{17}{1_1010}^^A
+%   \regfield{Control}{1}{16}{-}^^A
+%   \regfield[yellow!50]{Hardfail}{1}{15}{1}^^A
+%   \regfield[gray!20]{Data}{15}{0}{{uninitialized}}^^A
+%   \reglabel{Reset}%\regnewline^^A
+%  \end{register}
 % 
 % \section{Helper Scripts} \label{sec:scripts}
 %
@@ -483,7 +502,31 @@
 % information for each register.  The later data can be used in
 % simulation to ensure that registers behave as documented.
 %
+% \section{Version History} \label{sec:history}
 %
+% \begin{itemize}
+% \item [\textbf{v0.1}] (1999/03/29) First release
+% \item [\textbf{v0.2}] (2000/01/29) Added regdesc environment, for use under LyX
+% \item [\textbf{v0.21}] (2000/03/12) Fixed minute problem shown in regs with lots of 1-bit fields
+% \item [\textbf{v0.3}] (2000/06/19) Added reglabelb macro, for setting label without a drop
+% \item [\textbf{v0.31}] (2000/07/11) Modified names of lengths used within macros
+% \item [\textbf{v0.32}] (2000/08/02) Modified regdesc env to use regdescsep for vertical separation
+% \item [\textbf{v0.4}] (2001/08/11) Added macros for marginal Tape Release flags
+% \item [\textbf{v0.5}] (2001/08/12) Added package options for handling LyX, hyperref, and TR flags
+% \item [\textbf{v0.6}] (2001/08/19) Moved chapter redefinition into package; improved TR flags
+% \item [\textbf{v1.0}] (2001/09/06) Created .dtx documentation; first public release
+% \item [\textbf{v1.01}] (2003/01/17) Removed automatic label in register diagrams
+% \item [\textbf{v1.1}] (2003/02/15) Changed length manipulation to work with parskip package
+% \item [\textbf{v1.2}] (2003/03/31) Removed requirement to specify register offset
+% \item [\textbf{v1.3}] (2003/11/24) Changed how center is handled within register environment
+% \item [\textbf{v1.4}] (2004/08/16) Now provide a boolean set only in register context
+% \item [\textbf{v1.5}] (2007/03/08) Corrected use of conditionals used in spreading register reset value
+% \item [\textbf{v1.6}] (2011/01/11) Mainmatter correction suggested by Kjetil Oftedal
+% \item [\textbf{v1.6.1}] (2018/05/19) Published with updated email address; no functional changes
+% \item [\textbf{v1.7}] (2018/08/18) Added color option to package, suggested by Marco Stolba
+% \end{itemize}
+%
+%
 % ^^A  -------------------------------------------------------------------------
 % \newpage
 %
@@ -498,9 +541,9 @@
 %<*package>\NeedsTeXFormat{LaTeX2e}
 %    \end{macrocode}
 %
-%    Announce the name and load required packages:
+%    Announce the name and unconditionally load most of the required packages:
 %    \begin{macrocode}
-\ProvidesPackage{register} [2018/05/19 v1.6.1 Register macros with
+\ProvidesPackage{register} [2018/08/18 v1.7 Register macros with
 hyperref/LyX support]
 
 \RequirePackage{ifthen}[1997/11/02]
@@ -517,6 +560,7 @@
 \DeclareOption{hyperref}{\setboolean{RegisterHyperref}{true}}
 \DeclareOption{TRflags}{\setboolean{RegisterTRFlags}{true}}
 \DeclareOption{TRboxed}{\setboolean{RegisterTRBoxed}{true}}
+\DeclareOption{color}{\setboolean{RegisterColors}{true}}
 
 \DeclareOption*{%  Emit a warning for other options
   \PackageWarning{register}{Unknown option '\CurrentOption'}%
@@ -526,16 +570,24 @@
 \newboolean{RegisterHyperref}
 \newboolean{RegisterTRFlags}
 \newboolean{RegisterTRBoxed}
+\newboolean{RegisterColors}
 
 \setboolean{RegisterLyX}{false}
 \setboolean{RegisterHyperref}{false}
 \setboolean{RegisterTRFlags}{false}
 \setboolean{RegisterTRBoxed}{false}
+\setboolean{RegisterColors}{false}
 
 \ProcessOptions\relax  % Process package options
 %    \end{macrocode}
 %
-% Also, provide a flag indicating when one is inside a register
+% If the |color| package option has been specified, go ahead and
+% load the |xcolor| package as well.
+%    \begin{macrocode}
+\ifthenelse{\boolean{RegisterColors}}{\RequirePackage{xcolor}[2007/01/21]}{}
+%    \end{macrocode}
+%
+% Next, provide a flag indicating when one is inside a register
 % context.  Some users may wish to define macros, for example,
 % which make use of |\marginpar|.  Those cannot be used inside
 % of a floating register.  So, this flag is provided to
@@ -602,6 +654,9 @@
 \newlength{\regResetDepth}
 \newlength{\regResetDrop}
 \newlength{\regDescSkip} 
+\newlength{\regRsvdHeight}
+\newlength{\regRsvdDrop}
+\newlength{\regFboxSep}
 \setlength{\regWidth}{0.95\textwidth}
 \newcommand{\regBitWidth}{32}
 \newcommand{\regResetName}{Reset}
@@ -792,6 +847,10 @@
   % the end is effectively the separation between the bit position
   % box and the reset value box.
   \setlength{\regResetDrop}{\regResetHeight + 2\fboxsep - 2\fboxrule + 3pt}%
+  % New lengths to support colorbox use, when fboxsep gets set to 0
+  \setlength{\regRsvdDrop}{\regResetDrop + \fboxsep}%
+  \setlength{\regRsvdHeight}{\regResetHeight + 2\fboxsep}%
+  \setlength{\regFboxSep}{\fboxsep}%
 }
 %    \end{macrocode}
 %    These macros assembly, rotate, and typset the register field name.
@@ -836,14 +895,15 @@
 %
 %
 %
-% \begin{macro}{\regfield}
+% \begin{macro}{\regfieldNoColor}
 % The macros below are the user interface to the register drawing
-% routines.  The first of these, |\regfield| takes four arguments:
+% routines.  The first of these, |\regfieldNoColor| takes four arguments:
 % the field name, field length (in bits), the starting bit number,
-% and the field's reset value.
+% and the field's reset value.  This is the version of the macro that
+% does not make any use of |\colorbox|.
 % \end{macro}
 %    \begin{macrocode}
-\newcommand{\regfield}[4]{%
+\newcommand{\regfieldNoColor}[4]{%
   % Compute overall field length
   \setRegLengths%
   \setlength{\regFieldLen}{#2\regFieldLen + \fboxrule}%
@@ -864,13 +924,13 @@
 %
 %
 %
-% \begin{macro}{\regfieldb}
-%   The |\regfieldb| macro can be used to construct a register diagram
+% \begin{macro}{\regfieldbNoColor}
+%   The |\regfieldbNoColor| macro can be used to construct a register diagram
 %   without reset values.  It's parameters are thus the same
-%   as for |\regfield| with the omission of reset value.
+%   as for |\regfieldNoColor| with the omission of reset value.
 % \end{macro}
 %    \begin{macrocode}
-\newcommand{\regfieldb}[3]{%
+\newcommand{\regfieldbNoColor}[3]{%
   % Compute overall field length
   \setRegLengths%
   \setlength{\regFieldLen}{#2\regFieldLen + \fboxrule}%
@@ -889,8 +949,110 @@
 }
 %    \end{macrocode}
 %
+% \begin{macro}{\typesetRegColorBits}
+% \begin{macro}{\typesetRegColorReset}
+% \begin{macro}{\regfieldColor}
+% \begin{macro}{\regfieldbColor}
+%   Now, we define versions of the same macros that make use of |\colorbox|, taking
+%   an additional argument that specifies the fill color to use.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%    \begin{macrocode}
+\ifthenelse{\boolean{RegisterColors}}{%
+\newcommand{\typesetRegColorBits}[2]{%
+  \ifthenelse{#2 > 1}%
+    {\setlength\fboxsep{0pt}%
+      \colorbox{#1}{%
+        \framebox[\regFieldLen][c]%
+        {\regBitSize \rule[-1\regResetDepth - \regFboxSep]{0pt}%
+          {\regResetHeight + 2\regFboxSep}%
+           \regBitFamily\hspace{\regFboxSep}%
+\arabic{upperbit} \hfill \arabic{lowerbit}%
+\hspace{\regFboxSep}}}}%
+    {\setlength\fboxsep{0pt}%
+      \colorbox{#1}{%
+        \framebox[\regFieldLen][c]%
+        {\regBitSize \rule[-1\regResetDepth - \regFboxSep]{0pt}%
+           {\regResetHeight + 2\regFboxSep}%
+           \regBitFamily\arabic{lowerbit}}}}%
+  \setlength\fboxsep{\regFboxSep}%
+}
+\newcommand{\typesetRegColorReset}[2]{%
+ % Typeset reset value in a framebox
+  \makebox[0pt][l]{\raisebox{-1\regRsvdDrop}{%
+      \setlength\fboxsep{0pt}%
+        \colorbox{#1}{\framebox[\regFieldLen][c]%
+        % Place an invisible rule to control the box surrounding the reset field
+        {\regResetSize \rule[-1\regResetDepth]{0pt}{\regRsvdHeight}%
+        \raisebox{\regFboxSep}{\makebox[\regFieldLen]%
+         {\hspace{\regFboxSep}\regSpread{#2}\hspace{\regFboxSep}}}}}%
+}}}
+\newcommand{\regfieldColor}[5]{%
+  % Compute overall field length
+  \setRegLengths%
+  \setlength{\regFieldLen}{#3\regFieldLen + \fboxrule}%
+  % Figure out bit positions
+  \setcounter{lowerbit}{#4}%
+  \setcounter{upperbit}{#4 + #3 - 1}%
+  \regMakeFieldName{#2}%
+  % Figure out how far over to place label, accounting for height
+  \setlength{\regLabelAdjust}{0.5\regFieldLen - 0.707107\ht\Label}%
+  % Now, rotate and type the label
+  \regRotateFieldName%
+  \typesetRegColorReset{#1}{#5}%
+  % Typeset bit positions in a framebox
+  \typesetRegColorBits{#1}{#3}%
+  \hspace{-1\fboxrule}%
+}
+\newcommand{\regfieldbColor}[4]{%
+  % Compute overall field length
+  \setRegLengths%
+  \setlength{\regFieldLen}{#3\regFieldLen + \fboxrule}%
+  % Figure out bit positions
+  \setcounter{lowerbit}{#4}%
+  \setcounter{upperbit}{#4 + #3 - 1}%
+  % Create box to hold label
+  \regMakeFieldName{#2}%
+  % Figure out how far over to place label, accounting for height
+  \setlength{\regLabelAdjust}{0.5\regFieldLen - 0.707107\ht\Label}%
+  % Now, rotate and typeset the label
+  \regRotateFieldName%
+  % Typeset bit positions
+  \typesetRegColorBits{#1}{#3}%
+  \hspace{-1\fboxrule}%
+}
+}{}
+%    \end{macrocode}
 %
 %
+% \begin{macro}{\regfield}
+% \begin{macro}{\regfieldb}
+%   Next, provide definitions for the |\regfield| and |\regfieldb| macros that are 
+%   intended for direct use within the register diagrams.  These commands just check
+%   for the presence of a non-empty optional argument and, based upon that, decide
+%   whether to invoke the Color or NoColor variants of the typesetting macros.
+% \end{macro}
+% \end{macro}
+%    \begin{macrocode}
+\ifthenelse{\boolean{RegisterColors}}{
+  \newcommand{\regfield}[5][]{%
+    \ifthenelse{\equal{#1}{}}{%
+      \regfieldNoColor{#2}{#3}{#4}{#5}}%
+    {\regfieldColor{#1}{#2}{#3}{#4}{#5}}}
+  \newcommand{\regfieldb}[4][]{%
+    \ifthenelse{\equal{#1}{}}{%
+      \regfieldbNoColor{#2}{#3}{#4}}%
+    {\regfieldbColor{#1}{#2}{#3}{#4}}}  
+}{
+  \newcommand{\regfield}[5][]{%
+    \regfieldNoColor{#2}{#3}{#4}{#5}}%
+  \newcommand{\regfieldb}[4][]{%
+    \regfieldbNoColor{#2}{#3}{#4}}%
+}
+%    \end{macrocode}
+%
 % \begin{macro}{\regbits}
 %    The |\regbits| macro typesets a register field without
 %    showing bit positions.  As such, it only takes three
@@ -1127,6 +1289,7 @@
 % \par
 % Enjoy!  Happy documenting.
 %
+%
 % \Finale
 %
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/register/register.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/register/register.sty	2018-08-18 21:18:32 UTC (rev 48432)
+++ trunk/Master/texmf-dist/tex/latex/register/register.sty	2018-08-18 21:19:02 UTC (rev 48433)
@@ -22,7 +22,7 @@
 
 
 
-\ProvidesPackage{register} [2018/05/19 v1.6.1 Register macros with
+\ProvidesPackage{register} [2018/08/18 v1.7 Register macros with
 hyperref/LyX support]
 
 \RequirePackage{ifthen}[1997/11/02]
@@ -33,6 +33,7 @@
 \DeclareOption{hyperref}{\setboolean{RegisterHyperref}{true}}
 \DeclareOption{TRflags}{\setboolean{RegisterTRFlags}{true}}
 \DeclareOption{TRboxed}{\setboolean{RegisterTRBoxed}{true}}
+\DeclareOption{color}{\setboolean{RegisterColors}{true}}
 
 \DeclareOption*{%  Emit a warning for other options
   \PackageWarning{register}{Unknown option '\CurrentOption'}%
@@ -42,13 +43,16 @@
 \newboolean{RegisterHyperref}
 \newboolean{RegisterTRFlags}
 \newboolean{RegisterTRBoxed}
+\newboolean{RegisterColors}
 
 \setboolean{RegisterLyX}{false}
 \setboolean{RegisterHyperref}{false}
 \setboolean{RegisterTRFlags}{false}
 \setboolean{RegisterTRBoxed}{false}
+\setboolean{RegisterColors}{false}
 
 \ProcessOptions\relax  % Process package options
+\ifthenelse{\boolean{RegisterColors}}{\RequirePackage{xcolor}[2007/01/21]}{}
 \newboolean{RegisterContext}
 \setboolean{RegisterContext}{false}
 \floatstyle{plaintop} \@ifundefined{chapter}
@@ -62,6 +66,9 @@
 \newlength{\regResetDepth}
 \newlength{\regResetDrop}
 \newlength{\regDescSkip}
+\newlength{\regRsvdHeight}
+\newlength{\regRsvdDrop}
+\newlength{\regFboxSep}
 \setlength{\regWidth}{0.95\textwidth}
 \newcommand{\regBitWidth}{32}
 \newcommand{\regResetName}{Reset}
@@ -171,6 +178,10 @@
   % the end is effectively the separation between the bit position
   % box and the reset value box.
   \setlength{\regResetDrop}{\regResetHeight + 2\fboxsep - 2\fboxrule + 3pt}%
+  % New lengths to support colorbox use, when fboxsep gets set to 0
+  \setlength{\regRsvdDrop}{\regResetDrop + \fboxsep}%
+  \setlength{\regRsvdHeight}{\regResetHeight + 2\fboxsep}%
+  \setlength{\regFboxSep}{\fboxsep}%
 }
 \newcommand{\regMakeFieldName}[1]{%
   % Create box to hold label
@@ -197,7 +208,7 @@
         % surrounding the reset field
         {\regResetSize \rule[-1\regResetDepth]{0pt}{\regResetHeight}\regSpread{#1}}}}%
 }
-\newcommand{\regfield}[4]{%
+\newcommand{\regfieldNoColor}[4]{%
   % Compute overall field length
   \setRegLengths%
   \setlength{\regFieldLen}{#2\regFieldLen + \fboxrule}%
@@ -214,7 +225,7 @@
   \typesetRegBits{#2}%
   \hspace{-1\fboxrule}%
 }
-\newcommand{\regfieldb}[3]{%
+\newcommand{\regfieldbNoColor}[3]{%
   % Compute overall field length
   \setRegLengths%
   \setlength{\regFieldLen}{#2\regFieldLen + \fboxrule}%
@@ -231,6 +242,85 @@
   \typesetRegBits{#2}%
   \hspace{-1\fboxrule}%
 }
+\ifthenelse{\boolean{RegisterColors}}{%
+\newcommand{\typesetRegColorBits}[2]{%
+  \ifthenelse{#2 > 1}%
+    {\setlength\fboxsep{0pt}%
+      \colorbox{#1}{%
+        \framebox[\regFieldLen][c]%
+        {\regBitSize \rule[-1\regResetDepth - \regFboxSep]{0pt}%
+          {\regResetHeight + 2\regFboxSep}%
+           \regBitFamily\hspace{\regFboxSep}%
+\arabic{upperbit} \hfill \arabic{lowerbit}%
+\hspace{\regFboxSep}}}}%
+    {\setlength\fboxsep{0pt}%
+      \colorbox{#1}{%
+        \framebox[\regFieldLen][c]%
+        {\regBitSize \rule[-1\regResetDepth - \regFboxSep]{0pt}%
+           {\regResetHeight + 2\regFboxSep}%
+           \regBitFamily\arabic{lowerbit}}}}%
+  \setlength\fboxsep{\regFboxSep}%
+}
+\newcommand{\typesetRegColorReset}[2]{%
+ % Typeset reset value in a framebox
+  \makebox[0pt][l]{\raisebox{-1\regRsvdDrop}{%
+      \setlength\fboxsep{0pt}%
+        \colorbox{#1}{\framebox[\regFieldLen][c]%
+        % Place an invisible rule to control the box surrounding the reset field
+        {\regResetSize \rule[-1\regResetDepth]{0pt}{\regRsvdHeight}%
+        \raisebox{\regFboxSep}{\makebox[\regFieldLen]%
+         {\hspace{\regFboxSep}\regSpread{#2}\hspace{\regFboxSep}}}}}%
+}}}
+\newcommand{\regfieldColor}[5]{%
+  % Compute overall field length
+  \setRegLengths%
+  \setlength{\regFieldLen}{#3\regFieldLen + \fboxrule}%
+  % Figure out bit positions
+  \setcounter{lowerbit}{#4}%
+  \setcounter{upperbit}{#4 + #3 - 1}%
+  \regMakeFieldName{#2}%
+  % Figure out how far over to place label, accounting for height
+  \setlength{\regLabelAdjust}{0.5\regFieldLen - 0.707107\ht\Label}%
+  % Now, rotate and type the label
+  \regRotateFieldName%
+  \typesetRegColorReset{#1}{#5}%
+  % Typeset bit positions in a framebox
+  \typesetRegColorBits{#1}{#3}%
+  \hspace{-1\fboxrule}%
+}
+\newcommand{\regfieldbColor}[4]{%
+  % Compute overall field length
+  \setRegLengths%
+  \setlength{\regFieldLen}{#3\regFieldLen + \fboxrule}%
+  % Figure out bit positions
+  \setcounter{lowerbit}{#4}%
+  \setcounter{upperbit}{#4 + #3 - 1}%
+  % Create box to hold label
+  \regMakeFieldName{#2}%
+  % Figure out how far over to place label, accounting for height
+  \setlength{\regLabelAdjust}{0.5\regFieldLen - 0.707107\ht\Label}%
+  % Now, rotate and typeset the label
+  \regRotateFieldName%
+  % Typeset bit positions
+  \typesetRegColorBits{#1}{#3}%
+  \hspace{-1\fboxrule}%
+}
+}{}
+\ifthenelse{\boolean{RegisterColors}}{
+  \newcommand{\regfield}[5][]{%
+    \ifthenelse{\equal{#1}{}}{%
+      \regfieldNoColor{#2}{#3}{#4}{#5}}%
+    {\regfieldColor{#1}{#2}{#3}{#4}{#5}}}
+  \newcommand{\regfieldb}[4][]{%
+    \ifthenelse{\equal{#1}{}}{%
+      \regfieldbNoColor{#2}{#3}{#4}}%
+    {\regfieldbColor{#1}{#2}{#3}{#4}}}
+}{
+  \newcommand{\regfield}[5][]{%
+    \regfieldNoColor{#2}{#3}{#4}{#5}}%
+  \newcommand{\regfieldb}[4][]{%
+    \regfieldbNoColor{#2}{#3}{#4}}%
+}
 \newcommand{\regbits}[3]{%
   % Compute overall field length
   \setRegLengths%



More information about the tex-live-commits mailing list