texlive[54485] Master/texmf-dist: register (22mar20)

commits+karl at tug.org commits+karl at tug.org
Sun Mar 22 21:50:14 CET 2020


Revision: 54485
          http://tug.org/svn/texlive?view=revision&revision=54485
Author:   karl
Date:     2020-03-22 21:50:14 +0100 (Sun, 22 Mar 2020)
Log Message:
-----------
register (22mar20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/register/README
    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/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/register/README	2020-03-22 20:49:54 UTC (rev 54484)
+++ trunk/Master/texmf-dist/doc/latex/register/README	2020-03-22 20:50:14 UTC (rev 54485)
@@ -10,10 +10,11 @@
 digital hardware, i.e., registers.  Such registers typically have many
 fields and can be quite wide; they are thus a challenge to typeset in
 a consistent manner.  Register is similar in some aspects to the
-bytefield package.  Anyone doing hardware documentation using LaTeX
-should examine both packages.  Register requires version 2001/07/25 or
-newer of the float package.
+bytefield and bitpattern packages.  Anyone doing hardware
+documentation using LaTeX should examine those packages.
 
+Register requires version 2001/07/25 or newer of the float package.
+
 An example Perl module and script are provided, to convert the
 register specifications into structures suitable for, say, a
 pre-silicon test environment.
@@ -38,7 +39,7 @@
 Copyright and license
 ---------------------
 
-Copyright (C) 2001-2018 Matthew Lovell, lovells at gmail.com
+Copyright (C) 2001-2020 Matthew Lovell, lovells at gmail.com
 
 This package may be distributed and/or modified under the conditions
 of the LaTeX Project Public License, either version 1.3 of this

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	2020-03-22 20:49:54 UTC (rev 54484)
+++ trunk/Master/texmf-dist/source/latex/register/register.dtx	2020-03-22 20:50:14 UTC (rev 54485)
@@ -4,7 +4,7 @@
 % Register diagrams with field descriptions
 %
 % Author: Matthew Lovell (lovells at gmail.com)
-% Copyright 2001-2019 by Matthew B. Lovell 
+% Copyright 2001-2020 by Matthew B. Lovell 
 %
 % Run LaTeX on the file `register.ins' to get a .sty-file and 
 % then on `register.dtx' to obtain instructions.
@@ -20,10 +20,10 @@
 \ProvidesFile{register.dtx}
 %</dtx>
 % \fi
-% \CheckSum{785}
+% \CheckSum{804}
 %
-% \def\fileversion{v1.9}
-% \def\filedate{2019/01/01}
+% \def\fileversion{v2.0}
+% \def\filedate{2020/03/22}
 % \title{Register diagrams with field descriptions}
 % \author{Matthew Lovell\\
 %  \texttt{lovells at gmail.com}
@@ -40,7 +40,8 @@
 % they are thus a challenge to typeset in a consistent manner.
 % This package attempts to address such issues.  It is similar
 % in some aspects to the |bitfield| package by Reuben Thomas and the
-% |bytefield| package by Scott Pakin.
+% |bytefield| package by Scott Pakin.  Authors may also wish to 
+% inspect the |bitpattern| package by Jean-Marc Bourguet.
 % \end{abstract}
 %
 % \StopEventually
@@ -543,6 +544,8 @@
 % \item [\textbf{v1.7}] (2018/08/18) Added color option to package, suggested by Marco Stolba
 % \item [\textbf{v1.8}] (2018/11/10) Added unnumbered |register*| environment, suggested and written by Stephan Bauroth
 % \item [\textbf{v1.9}] (2019/01/01) Switched to a re-definable macro to provide default float name and LoR name, suggested by Benyuan Liu.
+% \item [\textbf{v2.0}] (2020/03/22) Added package options for captions and replaced |\bf| usage, suggested by Andrea Bettati.	%
+%                                    Also attempt to work better with |memoir| class.
 % \end{itemize}
 %
 %
@@ -562,7 +565,7 @@
 %
 %    Announce the name and unconditionally load most of the required packages:
 %    \begin{macrocode}
-\ProvidesPackage{register} [2019/01/01 v1.9 Register macros with
+\ProvidesPackage{register} [2020/03/22 v2.0 Register macros with
 hyperref/LyX support]
 
 \RequirePackage{ifthen}[1997/11/02]
@@ -573,23 +576,34 @@
 %
 %    Declare the package options and some booleans.  There are options indicating
 %    whether |register| is being used with \LyX{} or |hyperref|.  The marginal
-%    TR flags can also be turned on or off with an option.
+%    TR flags can also be turned on or off with an option.  A new package
+%    option, |botcaption| serves to change the default caption location to
+%    below the register diagram, rather than above.  Finally, |nocaption| turns
+%    off the |\caption| invocation internal to the |register| environment
+%    entirely, for users who would rather craft their own caption.  Note than
+%    one can specify \emph{both} |botcaption| and |nocaption| -- explicit
+%    author-specified captions would then appear at the bottom of each diagram.
 %    \begin{macrocode}
+%
 \DeclareOption{LyX}{\setboolean{RegisterLyX}{true}}
 \DeclareOption{hyperref}{\setboolean{RegisterHyperref}{true}}
 \DeclareOption{TRflags}{\setboolean{RegisterTRFlags}{true}}
 \DeclareOption{TRboxed}{\setboolean{RegisterTRBoxed}{true}}
 \DeclareOption{color}{\setboolean{RegisterColors}{true}}
+\DeclareOption{botcaption}{\setboolean{RegisterBottom}{true}}
+\DeclareOption{nocaption}{\setboolean{RegisterNoCaption}{true}}
 
 \DeclareOption*{%  Emit a warning for other options
   \PackageWarning{register}{Unknown option '\CurrentOption'}%
 }
 
-\newboolean{RegisterLyX}
-\newboolean{RegisterHyperref}
-\newboolean{RegisterTRFlags}
-\newboolean{RegisterTRBoxed}
-\newboolean{RegisterColors}
+\newboolean{RegisterLyX}%        Work with LyX
+\newboolean{RegisterHyperref}%   Work with hyperref package
+\newboolean{RegisterTRFlags}%    TR release flags
+\newboolean{RegisterTRBoxed}%    Place frame around TR flags
+\newboolean{RegisterColors}%     Permit color-filling register fields
+\newboolean{RegisterBottom}%     Move caption location to beneath register
+\newboolean{RegisterNoCaption}%  Disable environment's built-in caption
 
 \setboolean{RegisterLyX}{false}
 \setboolean{RegisterHyperref}{false}
@@ -596,6 +610,8 @@
 \setboolean{RegisterTRFlags}{false}
 \setboolean{RegisterTRBoxed}{false}
 \setboolean{RegisterColors}{false}
+\setboolean{RegisterBottom}{false}
+\setboolean{RegisterNoCaption}{false}
 
 \ProcessOptions\relax  % Process package options
 %    \end{macrocode}
@@ -636,16 +652,26 @@
 %    \end{macrocode}
 
 
-% \subsection{Float Declaration \& Lengths} \label{sec:float}
+% \subsection{New Float Declaration} \label{sec:float}
 %
 %    Declare the new register float type and the lengths which the
 %    macros will use.  The register diagrams tend to look best with
-%    the caption at the top of the float.  If |\chapter| is defined in
+%    the caption at the top of the float.  Note, however, that caption 
+%    placement \emph{can} be changed in the document itself.  For example, 
+%    one can  use the macro |\floatstyle{plain}|, followed by 
+%    |\restylefloat{Regfloat}|, to alter how all subsequent register 
+%    captions are typeset.
+%
+%    \begin{macrocode}
+\ifthenelse{\boolean{RegisterBottom}}{\floatstyle{plain}}{\floatstyle{plaintop}}
+%    \end{macrocode}
+%
+%    If |\chapter| is defined in
 %    the current document class, then the register diagrams will count
 %    by chapter, otherwise they will count by section.  
 %
 %    \begin{macrocode}
-\floatstyle{plaintop} \@ifundefined{chapter}
+\@ifundefined{chapter}
 {\newfloat{Regfloat}{tbp}{rdf}[section]}
 {\newfloat{Regfloat}{tbp}{rdf}[chapter]}
 \floatname{Regfloat}{\regFloatName}
@@ -699,7 +725,7 @@
 \newcommand{\regResetSize}{\scriptsize}
 \newcommand{\regLabelSize}{\footnotesize}
 \newcommand{\regLabelFamily}{\rmfamily}
-\newcommand{\regDescFamily}{\bf}
+\newcommand{\regDescFamily}{\bfseries}
 %    \end{macrocode}
 %    The lengths below control the vertical spacing between a 
 %    register diagrams and the register field descriptions.  This
@@ -806,9 +832,11 @@
   \setlength{\partopsep}{0pt}%
   \setlength{\topsep}{0pt}%
   \setboolean{RegisterContext}{true}%
-  \ifthenelse{\equal{#3}{}}%
-  {\caption[#2]{\textsc{#2}}}% else
-  {\caption[#2]{\textsc{#2} ({#3})}}%
+  \ifthenelse{\boolean{RegisterNoCaption}}{}%
+   {\ifthenelse{\equal{#3}{}}%
+    {\caption[#2]{\textsc{#2}}}% else
+    {\caption[#2]{\textsc{#2} ({#3})}}%
+   }%
   \centering}
 {% restore lengths
   \leftskip\z@%
@@ -1213,13 +1241,24 @@
 %    \end{macrocode}
 %
 %
-%
 % The |\chapter| command, if present, is also redefined in order
 % to get identical chapter-related spacing in the list of registers
 % as appears in the LoF and LoT.  Kjetil Oftedal provided a fix
 % wherein we test that @mainmatter is defined prior to using it.
+%
+% This change to |\chapter| is not particularly friendly if one is
+% using the |memoir| package, however!  So, we first check what
+% document class is being used.  If |memoir| is being used, we invoke
+% its |\memchapinfo| hook rather than attempt any redefinition of
+% |\chapter|.
+% 
+%
 %    \begin{macrocode}
 \@ifundefined{@mainmatter}{\newif\if at mainmatter \@mainmattertrue}{}
+\@ifclassloaded{memoir}{%
+\renewcommand{\memchapinfo}[4]{%
+  \addtocontents{rdf}{\protect\addvspace{10pt}}}
+}{%
 \@ifundefined{chapter}{}
 {% Adjust chapter definition slightly for Regfloats
 \def\@chapter[#1]#2{\ifnum \c at secnumdepth >\m at ne
@@ -1244,7 +1283,7 @@
     \@makechapterhead{#2}%
     \@afterheading
   \fi}
-}
+}}
 %    \end{macrocode}
 %
 %

Modified: trunk/Master/texmf-dist/tex/latex/register/register.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/register/register.sty	2020-03-22 20:49:54 UTC (rev 54484)
+++ trunk/Master/texmf-dist/tex/latex/register/register.sty	2020-03-22 20:50:14 UTC (rev 54485)
@@ -22,7 +22,7 @@
 
 
 
-\ProvidesPackage{register} [2019/01/01 v1.9 Register macros with
+\ProvidesPackage{register} [2020/03/22 v2.0 Register macros with
 hyperref/LyX support]
 
 \RequirePackage{ifthen}[1997/11/02]
@@ -34,16 +34,20 @@
 \DeclareOption{TRflags}{\setboolean{RegisterTRFlags}{true}}
 \DeclareOption{TRboxed}{\setboolean{RegisterTRBoxed}{true}}
 \DeclareOption{color}{\setboolean{RegisterColors}{true}}
+\DeclareOption{botcaption}{\setboolean{RegisterBottom}{true}}
+\DeclareOption{nocaption}{\setboolean{RegisterNoCaption}{true}}
 
 \DeclareOption*{%  Emit a warning for other options
   \PackageWarning{register}{Unknown option '\CurrentOption'}%
 }
 
-\newboolean{RegisterLyX}
-\newboolean{RegisterHyperref}
-\newboolean{RegisterTRFlags}
-\newboolean{RegisterTRBoxed}
-\newboolean{RegisterColors}
+\newboolean{RegisterLyX}%        Work with LyX
+\newboolean{RegisterHyperref}%   Work with hyperref package
+\newboolean{RegisterTRFlags}%    TR release flags
+\newboolean{RegisterTRBoxed}%    Place frame around TR flags
+\newboolean{RegisterColors}%     Permit color-filling register fields
+\newboolean{RegisterBottom}%     Move caption location to beneath register
+\newboolean{RegisterNoCaption}%  Disable environment's built-in caption
 
 \setboolean{RegisterLyX}{false}
 \setboolean{RegisterHyperref}{false}
@@ -50,6 +54,8 @@
 \setboolean{RegisterTRFlags}{false}
 \setboolean{RegisterTRBoxed}{false}
 \setboolean{RegisterColors}{false}
+\setboolean{RegisterBottom}{false}
+\setboolean{RegisterNoCaption}{false}
 
 \ProcessOptions\relax  % Process package options
 \ifthenelse{\boolean{RegisterColors}}{\RequirePackage{xcolor}[2007/01/21]}{}
@@ -59,7 +65,8 @@
 \newcommand{\regListName}{List of Registers}
 \newcommand{\regResetName}{Reset}
 
-\floatstyle{plaintop} \@ifundefined{chapter}
+\ifthenelse{\boolean{RegisterBottom}}{\floatstyle{plain}}{\floatstyle{plaintop}}
+\@ifundefined{chapter}
 {\newfloat{Regfloat}{tbp}{rdf}[section]}
 {\newfloat{Regfloat}{tbp}{rdf}[chapter]}
 \floatname{Regfloat}{\regFloatName}
@@ -80,7 +87,7 @@
 \newcommand{\regResetSize}{\scriptsize}
 \newcommand{\regLabelSize}{\footnotesize}
 \newcommand{\regLabelFamily}{\rmfamily}
-\newcommand{\regDescFamily}{\bf}
+\newcommand{\regDescFamily}{\bfseries}
 \newlength{\regdescsep}
 \newlength{\oldregdescsep}
 \setlength{\regdescsep}{-\medskipamount}
@@ -136,9 +143,11 @@
   \setlength{\partopsep}{0pt}%
   \setlength{\topsep}{0pt}%
   \setboolean{RegisterContext}{true}%
-  \ifthenelse{\equal{#3}{}}%
-  {\caption[#2]{\textsc{#2}}}% else
-  {\caption[#2]{\textsc{#2} ({#3})}}%
+  \ifthenelse{\boolean{RegisterNoCaption}}{}%
+   {\ifthenelse{\equal{#3}{}}%
+    {\caption[#2]{\textsc{#2}}}% else
+    {\caption[#2]{\textsc{#2} ({#3})}}%
+   }%
   \centering}
 {% restore lengths
   \leftskip\z@%
@@ -398,6 +407,10 @@
     \@starttoc{\@nameuse{ext at Regfloat}}}}
 \newcommand\l at Regfloat{\@dottedtocline{1}{1.5em}{2.3em}}
 \@ifundefined{@mainmatter}{\newif\if at mainmatter \@mainmattertrue}{}
+\@ifclassloaded{memoir}{%
+\renewcommand{\memchapinfo}[4]{%
+  \addtocontents{rdf}{\protect\addvspace{10pt}}}
+}{%
 \@ifundefined{chapter}{}
 {% Adjust chapter definition slightly for Regfloats
 \def\@chapter[#1]#2{\ifnum \c at secnumdepth >\m at ne
@@ -422,7 +435,7 @@
     \@makechapterhead{#2}%
     \@afterheading
   \fi}
-}
+}}
 \newcommand\@GetTRSecondParam{}
 \long\def\@GetTRSecondParam#1#2#3\@nil{#2}
 \newcommand*{\GetTRPageRef}[1]{%



More information about the tex-live-commits mailing list.