From 2171135497f6825a5e7e421fc01bd0ac1aa2ca0e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 10 Nov 2018 22:18:17 +0000 Subject: register (10nov18) git-svn-id: svn://tug.org/texlive/trunk@49121 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/register/register.dtx | 66 ++++++++++++++++++---- 1 file changed, 55 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/source/latex/register') diff --git a/Master/texmf-dist/source/latex/register/register.dtx b/Master/texmf-dist/source/latex/register/register.dtx index e8b6dd7031f..6f629cae934 100644 --- a/Master/texmf-dist/source/latex/register/register.dtx +++ b/Master/texmf-dist/source/latex/register/register.dtx @@ -20,10 +20,10 @@ \ProvidesFile{register.dtx} % % \fi -% \CheckSum{739} +% \CheckSum{776} % -% \def\fileversion{v1.7} -% \def\filedate{2018/08/18} +% \def\fileversion{v1.8} +% \def\filedate{2018/11/10} % \title{Register diagrams with field descriptions} % \author{Matthew Lovell\\ % \texttt{lovells@gmail.com} @@ -208,7 +208,11 @@ % % A final example is shown in Figure~\ref{fig:regbus_cycle}. This % example shows that the register drawing macros don't have to be used -% solely within a |register| float. +% solely within a |register| float or environment. With Version~1.8, +% an unnumbered register environment is also available, using +% |register*|. Diagrams produced using the starred environment +% typeset just the register name, omitting the ``Register'' and number +% prefix. % % \begin{figure}[H] % \begin{center}^^A @@ -293,7 +297,16 @@ % improve readability. % \end{macro} % \hspace*{\MacroIndent}|\regfield{|\meta{name}|}{|\meta{length}|}{|^^A -% \meta{start bit}|}{|\meta{reset value}|}| +% \meta{start bit}|}{|\meta{reset value}|}|\\[2pt] +% +% Note that the comments that are shown in the code are for the +% benefit of the helper scripts that accompany the |register| +% package. Those scripts are quite old and have \emph{not} been +% updated to be tolerant of the optional color argument that is now +% supported. However, the general notion of using embedded comments +% to augment register or field information is still applicable, if +% one is using this package with the intent of generating HDL code +% from documentation. % % \begin{macro}{\regBitWidth} % \begin{macro}{\regnewline} @@ -314,7 +327,7 @@ % \hspace*{\MacroIndent}|\reglabel{|\meta{reset label}|}|\\[2pt] % % -% As a final example, consider Register~\ref{Configuration}, which has +% As another example, consider Register~\ref{Configuration} below, which has % field descriptions as part of the float. This diagram was created % with the following code: % \begin{verbatim} @@ -414,7 +427,7 @@ % the register description body should be. The default value is 90\% % of |\textwidth|. For |reglist|, the optional argument is the % longest field name, which allows the list to be spaced appropriately -% (like examples given in \textit{The \LaTeX{} Companion}). +% (like examples given in \emph{The \LaTeX{} Companion}). % % \begin{macro}{\regfieldb} % Finally, if a register with no reset values is desired, one can use @@ -427,12 +440,12 @@ % \subsection{TR Flags} % % \begin{macro}{\TR} -% The last example also shows the TR flags. These marginal notes can +% The previous example also shows the TR flags. These marginal notes can % be used to denote features that are specific to a particular release % of a chip. These macros were created since \LaTeX{}'s |\marginpar| % is itself a float; as such it cannot be nested inside other floats. % The |\TR| macros thus implement something very similar to the -% solution for Problem~14.28 in \textit{The \TeX{}book}. +% solution for Problem~14.28 in \emph{The \TeX{}book}. % TR flags are turned on via the |TRflags| package option. If the % option is not specified, then the |\TR| macro still exists but is @@ -487,7 +500,7 @@ % % \section{Helper Scripts} \label{sec:scripts} % -% A Perl module and a perl script are included as part of the +% A (now old) Perl module and a Perl script are included as part of the % |register| package. The module augments the package by % providing the ability to parse the register macro information into % Perl. This information consists of the parameters used within @@ -502,6 +515,10 @@ % information for each register. The later data can be used in % simulation to ensure that registers behave as documented. % +% Users are cautioned that the Perl script, since it is no longer in +% active use by the author, has not been modified to support the +% optional color argument for the |regfield| macro. +% % \section{Version History} \label{sec:history} % % \begin{itemize} @@ -524,6 +541,7 @@ % \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 +% \item [\textbf{v1.8}] (2018/11/10) Added unnumbered |register*| environment, suggested and written by Stephan Bauroth % \end{itemize} % % @@ -543,7 +561,7 @@ % % Announce the name and unconditionally load most of the required packages: % \begin{macrocode} -\ProvidesPackage{register} [2018/08/18 v1.7 Register macros with +\ProvidesPackage{register} [2018/11/10 v1.8 Register macros with hyperref/LyX support] \RequirePackage{ifthen}[1997/11/02] @@ -785,6 +803,32 @@ hyperref/LyX support] \end{Regfloat}} % \end{macrocode} % +% \begin{macro}{\register*} +% This register* environment provides for an unnumbered or ``captionless'' register; +% registers in such an environment are not added to the list of registers. +% \end{macro} +% \begin{macrocode} +\newenvironment{register*}[3] +{\begin{Regfloat}[#1]% + \setlength{\leftskip}{0pt}% + \setlength{\oldregdescsep}{\regdescsep}% + \setlength{\regdescsep}{0.5\baselineskip}% + \setlength{\partopsep}{0pt}% + \setlength{\topsep}{0pt}% + \setboolean{RegisterContext}{true}% + \ifthenelse{\equal{#3}{}}% + {\centering\textsc{#2}\\}% else + {\centering\textsc{#2} ({#3})\\}% + \centering} +{% restore lengths + \leftskip\z@% + \rightskip\z@% + \parfillskip=\z@ plus 1fil% + \setlength{\regdescsep}{\oldregdescsep}% + \setboolean{RegisterContext}{false}% + \end{Regfloat}} +% \end{macrocode} +% % % \begin{macro}{\regUnderScore} % \begin{macro}{\regFiller} -- cgit v1.2.3