texlive[56821] Master/texmf-dist: bytefield (31oct20)
commits+karl at tug.org
commits+karl at tug.org
Sat Oct 31 22:05:36 CET 2020
Revision: 56821
http://tug.org/svn/texlive?view=revision&revision=56821
Author: karl
Date: 2020-10-31 22:05:36 +0100 (Sat, 31 Oct 2020)
Log Message:
-----------
bytefield (31oct20)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/bytefield/bytefield.pdf
trunk/Master/texmf-dist/source/latex/bytefield/bytefield.dtx
trunk/Master/texmf-dist/tex/latex/bytefield/bytefield.sty
Modified: trunk/Master/texmf-dist/doc/latex/bytefield/bytefield.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/bytefield/bytefield.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bytefield/bytefield.dtx 2020-10-31 21:05:09 UTC (rev 56820)
+++ trunk/Master/texmf-dist/source/latex/bytefield/bytefield.dtx 2020-10-31 21:05:36 UTC (rev 56821)
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{bytefield}
%<*package>
- [2020/10/22 v2.5 Network protocol diagrams]
+ [2020/10/31 v2.6 Network protocol diagrams]
%</package>
%
%<*driver>
@@ -68,7 +68,7 @@
%</driver>
% \fi
%
-% \CheckSum{1161}
+% \CheckSum{1194}
%
% \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
@@ -108,6 +108,11 @@
% \changes{v2.5}{2020/10/22}{Accept a new \protect\optname{perword}
% option to execute a macro for each word in a word box. This addresses
% a feature request by Victor Toni}
+% \changes{v2.6}{2020/10/29}{Accept new \protect\optname{curlystyle},
+% \protect\optname{leftcurlystyle}, and
+% \protect\optname{rightcurlystyle} options to control the styling
+% (e.g.,~color) of curly braces. This addresses a feature request by
+% Victor Toni}
%
% \GetFileInfo{bytefield.dtx}
%
@@ -607,12 +612,12 @@
%
% \begin{decl}
% \SpecialEnvIndex{rightwordgroup}
-% |\begin{rightwordgroup}| \marg{text} \\
+% |\begin{rightwordgroup}| \oarg{options} \marg{text} \\
% \meta{rows of bit boxes and word boxes} \\
% |\end{rightwordgroup}| \\
% \\
% \SpecialEnvIndex{leftwordgroup}
-% |\begin{leftwordgroup}| \marg{text} \\
+% |\begin{leftwordgroup}| \oarg{options} \marg{text} \\
% \meta{rows of bit boxes and word boxes} \\
% |\end{leftwordgroup}|
% \end{decl}
@@ -627,6 +632,12 @@
% |\end{|\meta{side}|wordgroup}| must lie right \emph{before} the end of
% the row (i.e.,~right before a ``|\\|'').
%
+% The optional argument is a comma-separated list of
+% \meta{key}=\meta{value} pairs from the set described in
+% Section~\ref{sec:options}. In practice, only \optname{curlystyle},
+% \optname{leftcurlystyle}, and \optname{rightcurlystyle}, make sense
+% within the context of a |\begin{|\meta{side}|wordgroup}|.
+%
% Unlike other \LaTeX\ environments, |rightwordgroup| and
% |leftwordgroup| do not have to nest properly with each other.
% However, they cannot overlap themselves. In other words,
@@ -751,7 +762,7 @@
% A document author can customize many of the \pkgname{bytefield}
% package's figure-formatting parameters, either globally or on a
% per-figure basis. The parameters described below can be specified in
-% five locations:
+% six locations:
%
% \begin{itemize}
% \item as package options (i.e.,~in the
@@ -769,6 +780,10 @@
% that particular header. (Only a few parameters are meaningful in
% this context.)
%
+% \item as the optional argument to a |\begin{leftwordgroup}| or
+% |\begin{rightwordgroup}|, which affects only that particular word
+% group. (Only a few parameters are meaningful in this context.)
+%
% \item as the second optional argument to a \cs{bitbox}, \cs{wordbox},
% or \cs{bitboxes}, which affects only that particular box. (Only a
% few parameters are meaningful in this context.)
@@ -799,7 +814,7 @@
%
% As a special case, if \optname{bitwidth} is set to the word
% ``|auto|'', it will be set to the width of ``|99i|'' in the current
-% bit-number formatting (cf.~\optname{bitformatting} below). This
+% bit-number formatting (see \optname{bitformatting} below). This
% feature provides a convenient way to adjust the bit width after a
% formatting change.
%
@@ -1081,6 +1096,55 @@
% different heights.
%
% \begin{decl}
+% \optname{leftcurlystyle} = \meta{command} \\
+% \optname{rightcurlystyle} = \meta{command} \\
+% \optname{curlystyle} = \meta{command}
+% \end{decl}
+%
+% Provide a macro that will be invoked before the code that draws left,
+% right, or both curly braces. The macro must accept either zero or one
+% argument. It can be used, for example, to color the curly brace:
+%
+% \begin{verbatim}
+% \begin{bytefield}[curlystyle=\color{blue}]{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{verbatim}
+%
+% \begin{bffigure}
+% \begin{bytefield}[curlystyle=\color{blue}]{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{bffigure}
+%
+% \noindent
+% or
+%
+% \begin{verbatim}
+% \begin{bytefield}{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}[curlystyle=\color{blue}]{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{verbatim}
+%
+% \begin{bffigure}
+% \begin{bytefield}{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}[curlystyle=\color{blue}]{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{bffigure}
+%
+% \begin{decl}
% \optname{lsb} = \meta{integer}
% \end{decl}
%
@@ -2052,7 +2116,7 @@
% \changes{v2.3}{2015/10/28}{Rewrote the macro based on discussions with
% David Carlisle to avoid producing ``\texttt{No room for a new
% \string\string\string\dimen}'' errors in newer versions of $\varepsilon$-\TeX\
-% (cf.~\url{http://tex.stackexchange.com/q/275042})}
+% (see \url{http://tex.stackexchange.com/q/275042})}
% \begin{macrocode}
\AtBeginDocument{%
\expandafter\ifx\csname e at alloc\endcsname\relax
@@ -2160,6 +2224,7 @@
% \begin{macrocode}
\vbox\bgroup\ialign\bgroup##\amp##\amp##\cr\amp
}{%
+ \unskip
\amp\show at wordlabelr\cr\egroup\egroup
\end{lrbox}%
\usebox{\entire at bytefield@picture}%
@@ -2581,7 +2646,7 @@
% \begin{macrocode}
\def\bf at bitboxes@star at i#1#2{%
\def\bf at call@box at arg@iv{#1}%
- \def\bf at bitboxes@arg at ii{#2}%
+ \def\bf at bitboxes@arg at ii{#2}%
\ifx\bf at bitboxes@arg at ii\bf at relax
\bf at bitbox
\let\next=\relax
@@ -2978,6 +3043,17 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\bf at leftcurlystyle}
+% \begin{macro}{\bf at rightcurlystyle}
+% Define the default formatting for left and right curly braces as ``do
+% nothing special''.
+% \begin{macrocode}
+\let\bf at leftcurlystyle=\relax
+\let\bf at rightcurlystyle=\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\curly at box}
% Define a box in which to temporarily store formatted curly braces.
% \changes{v1.2}{2004/06/14}{Bug fix: Defined \cs{curly at box} globally
@@ -3009,11 +3085,13 @@
\setlength{\curly at shift}{\half at curly@height + 0.5\curly at shift}%
\global\sbox{#1}{\raisebox{\curly at shift}{%
$\xdef\old at axis{\the\fontdimen22\textfont2}$%
- $\fontdimen22\textfont2=0pt%
- \left.
- \vrule height\half at curly@height
- width 0pt
- depth\half at curly@height\right\bf at rightcurly$%
+ \bf at rightcurlystyle{%
+ $\fontdimen22\textfont2=0pt%
+ \left.
+ \vrule height\half at curly@height
+ width 0pt
+ depth\half at curly@height\right\bf at rightcurly$%
+ }%
$\fontdimen22\textfont2=\old at axis$}}%
\endgroup
}
@@ -3042,11 +3120,13 @@
\setlength{\curly at shift}{\half at curly@height + 0.5\curly at shift}%
\global\sbox{#1}{\raisebox{\curly at shift}{%
$\xdef\old at axis{\the\fontdimen22\textfont2}$%
- $\fontdimen22\textfont2=0pt%
- \left\bf at leftcurly
- \vrule height\half at curly@height
- width 0pt
- depth\half at curly@height\right.$%
+ \bf at leftcurlystyle{%
+ $\fontdimen22\textfont2=0pt%
+ \left\bf at leftcurly
+ \vrule height\half at curly@height
+ width 0pt
+ depth\half at curly@height\right.$%
+ }%
$\fontdimen22\textfont2=\old at axis$}}%
\endgroup
}
@@ -3081,12 +3161,17 @@
%
% \begin{environment}{rightwordgroup}
% \usermacro
-% Label the words defined between |\begin{rightwordgroup}| and |\end{rightwordgroup}|
-% on the right side of the bit field.
-% The argument is the text of the label. The label is typeset to the
-% right of a large curly brace, which groups the words together.
+% Label the words defined between |\begin{rightwordgroup}| and
+% |\end{rightwordgroup}| on the right side of the bit field. The first,
+% optional, argument is a list of parameters, as defined in
+% Section~\ref{sec:options}. The second, mandatory, argument is the
+% text of the label. The label is typeset to the right of a large curly
+% brace, which groups the words together.
+% \changes{v2.6}{2020/10/29}{Suppress spaces following the
+% \protect\cs{end}\protect\texttt{\{rightwordgroup\}}}
+% \changes{v2.6}{2020/10/31}{Accept key/value options}
% \begin{macrocode}
-\newenvironment{rightwordgroup}[1]{%
+\newenvironment{rightwordgroup}[2][]{%
% \end{macrocode}
% We begin by ending the group that |\begin{rightwordgroup}| created. This
% lets the |rightwordgroup| environment span rows (because we're technically
@@ -3095,21 +3180,25 @@
\endgroup
% \end{macrocode}
% \begin{macro}{\wordlabelr at start}
+% \begin{macro}{\wordlabelr at params}
% \begin{macro}{\wordlabelr at text}
-% |\begin{rightwordgroup}| merely stores the starting height in |\wordlabelr at start|
-% and the user-supplied text in |\wordlabelr at text|. |\end{rightwordgroup}|
-% does most of the work.
+% |\begin{rightwordgroup}| merely stores the starting height in
+% |\wordlabelr at start| and the user-supplied text in |\wordlabelr at text|.
+% |\end{rightwordgroup}| does most of the work.
% \begin{macrocode}
\global\wordlabelr at start=\bytefield at height
- \gdef\wordlabelr at text{#1}%
+ \gdef\wordlabelr at params{#1}%
+ \gdef\wordlabelr at text{#2}%
\ignorespaces
}{%
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
% \begin{macro}{\wordlabelr at end}
-% Because we already ended the group that |\begin{rightwordgroup}| created
-% we now have to begin a group for |\end{rightwordgroup}| to end.
+% Because we already ended the group that |\begin{rightwordgroup}|
+% created we now have to begin a group for |\end{rightwordgroup}| to
+% end.
% \begin{macrocode}
\begingroup
\global\wordlabelr at end=\bytefield at height
@@ -3125,9 +3214,15 @@
% \begin{macrocode}
\gdef\show at wordlabelr{%
\sbox{\word at label@box}{%
- \begin{tabular}[b]{@{}l@{}}\wordlabelr at text\end{tabular}}%
+ \begin{tabular}[b]{@{}l@{}}\wordlabelr at text\end{tabular}%
+ }%
\settowidth{\label at box@width}{\usebox{\word at label@box}}%
\setlength{\label at box@height}{\wordlabelr at end-\wordlabelr at start}%
+% \end{macrocode}
+% Evaluate any parameters passed to |\begin{rightwordgroup}| right
+% before we render the curly brace.
+% \begin{macrocode}
+ \expandafter\bf at bytefieldsetup\expandafter{\wordlabelr at params}%
\store at rcurly{\curly at box}{\label at box@height}%
\bf at newdimen\total at box@width
\setlength{\total at box@width}{%
@@ -3134,7 +3229,8 @@
\bf at rightcurlyspace +
\widthof{\usebox{\curly at box}} +
\bf at rightlabelspace +
- \label at box@width}%
+ \label at box@width
+ }%
\begin{picture}(\strip at pt\total at box@width,0)
\put(0,0){%
\hspace*{\bf at rightcurlyspace}%
@@ -3141,7 +3237,9 @@
\usebox{\curly at box}%
\hspace*{\bf at rightlabelspace}%
\makebox(\strip at pt\label at box@width,\strip at pt\label at box@height){%
- \usebox{\word at label@box}}}
+ \usebox{\word at label@box}%
+ }%
+ }%
\end{picture}%
% \end{macrocode}
% The last thing |\show at wordlabelr| does is redefine itself back to a no-op.
@@ -3156,7 +3254,7 @@
% |\begin|.
% \begin{macrocode}
\def\@currenvir{rightwordgroup}%
- \ignorespaces
+ \ignorespacesafterend
}
% \end{macrocode}
% \end{macro}
@@ -3220,25 +3318,28 @@
% there will eventually be enough space to accomodate the label, we know
% that the label won't overlap the bit field or extend beyond the bit-field
% boundaries.
+% \changes{v2.6}{2020/10/29}{Suppress spaces following the
+% \protect\cs{end}\protect\texttt{\{leftwordgroup\}}}
+% \changes{v2.6}{2020/10/31}{Accept key/value options}
% \begin{macrocode}
-\newenvironment{leftwordgroup}[1]{%
+\newenvironment{leftwordgroup}[2][]{%
% \end{macrocode}
-% We begin by ending the group that |\begin{rightwordgroup}| created. This
-% lets the |leftwordgroup| environment span rows (because we're technically
-% no longer within the environment).
-% \begin{macrocode}
- \endgroup
-% \end{macrocode}
% \begin{macro}{\wordlabell at start}
+% \begin{macro}{\wordlabell at params}
% \begin{macro}{\wordlabell at text}
-% We store the starting height and label text, which are needed by the
-% |\end{leftwordgroup}|.
+% We store the starting height, optional parameters (see
+% Section~\ref{sec:options}), and label text, all of which are needed by
+% the |\end{leftwordgroup}|. We immediately parse the parameters
+% because they may affect the \cs{store at lcurly} invocation below.
% \begin{macrocode}
\global\wordlabell at start=\bytefield at height
- \gdef\wordlabell at text{#1}%
+ \gdef\wordlabell at params{#1}%
+ \gdef\wordlabell at text{#2}%
+ \bf at bytefieldsetup{#1}%
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
% Next, we typeset a draft version of the label into |\word at label@box|,
% which we measure (into |\total at lbox@width|) and then discard.
% We can't typeset the final version of the label until we reach the
@@ -3269,7 +3370,14 @@
% \begin{macrocode}
\gdef\make at lspace{%
\hspace*{\total at lbox@width}%
- \gdef\make at lspace{}}%
+ \gdef\make at lspace{}%
+ }%
+% \end{macrocode}
+% We now end the group that |\begin{rightwordgroup}| created. This lets
+% the |leftwordgroup| environment span rows (because we're technically
+% no longer within the environment).
+% \begin{macrocode}
+ \endgroup
\ignorespaces
}{%
% \end{macrocode}
@@ -3288,6 +3396,10 @@
% that we typeset the entire label in the second column, but in a $0
% \times 0$ |picture| environment and with a negative horizontal offset
% (|\starting at point|), thereby making it overlap the first column.
+% Before typesetting the curly brace we re-parse the optional parameters
+% because we're in a new group from the one in which we parsed them
+% before, and the parameters can affect the second \cs{store at lcurly}
+% invocation just they could have affected the first.
% \begin{macrocode}
\global\wordlabell at end=\bytefield at height
\bf at newdimen\starting at point
@@ -3297,6 +3409,7 @@
\begin{tabular}[b]{@{}l@{}}\wordlabell at text\end{tabular}}%
\settowidth{\label at box@width}{\usebox{\word at label@box}}%
\setlength{\label at box@height}{\wordlabell at end-\wordlabell at start}%
+ \expandafter\bf at bytefieldsetup\expandafter{\wordlabell at params}%
\store at lcurly{\curly at box}{\label at box@height}%
\begin{picture}(0,0)
\put(\strip at pt\starting at point,0){%
@@ -3314,7 +3427,7 @@
% |\begin|.
% \begin{macrocode}
\def\@currenvir{leftwordgroup}%
- \ignorespaces
+ \ignorespacesafterend
}
% \end{macrocode}
% \end{macro}
@@ -3530,6 +3643,8 @@
%
% \begin{macro}{\KV at bytefield@leftcurly}
% \begin{macro}{\KV at bytefield@rightcurly}
+% \begin{macro}{\bf at leftcurly}
+% \begin{macro}{\bf at rightcurly}
% Specify the symbol to use for bracketing a left or right word group.
% This must be an extensible math delimiter (i.e.,~something that can
% immediately follow |\left| or |\right| in math mode).
@@ -3539,10 +3654,14 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV at bytefield@leftcurlyspace}
% \begin{macro}{\KV at bytefield@rightcurlyspace}
% \begin{macro}{\KV at bytefield@curlyspace}
+% \begin{macro}{\bf at leftcurlyspace}
+% \begin{macro}{\bf at rightcurlyspace}
% Specify the amount of space between the bit fields in a word group and
% the adjacent left or right curly brace. The \optname{curlyspace}
% option is a shortcut that puts the same space before both left and
@@ -3558,10 +3677,14 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV at bytefield@leftlabelspace}
% \begin{macro}{\KV at bytefield@rightlabelspace}
% \begin{macro}{\KV at bytefield@labelspace}
+% \begin{macro}{\bf at leftlabelspace}
+% \begin{macro}{\bf at rightlabelspace}
% Specify the amount of space between a left or right word group's curly
% brace and the associated label text. The |labelspace| option is a
% shortcut that puts the same space after both left and right curly
@@ -3577,10 +3700,14 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV at bytefield@leftcurlyshrinkage}
% \begin{macro}{\KV at bytefield@rightcurlyshrinkage}
% \begin{macro}{\KV at bytefield@curlyshrinkage}
+% \begin{macro}{\bf at leftcurlyshrinkage}
+% \begin{macro}{\bf at rightcurlyshrinkage}
% Specify the number of points by which to reduce the height of a curly
% brace (left, right, or both) so its ends don't overlap whatever's
% above or below it.
@@ -3595,7 +3722,31 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
+% \begin{macro}{\KV at bytefield@leftcurlystyle}
+% \begin{macro}{\KV at bytefield@rightcurlystyle}
+% \begin{macro}{\KV at bytefieldcurlystyle}
+% \begin{macro}{\bf at leftcurlystyle}
+% \begin{macro}{\bf at rightcurlystyle}
+% Specify a macro that takes either zero or one argument and that
+% precedes the text that draws a left curly brace, right curly brace, or
+% either curly brace.
+% \begin{macrocode}
+\define at key{bytefield}{leftcurlystyle}{\def\bf at leftcurlystyle{#1}}
+\define at key{bytefield}{rightcurlystyle}{\def\bf at rightcurlystyle{#1}}
+\define at key{bytefield}{curlystyle}{%
+ \def\bf at leftcurlystyle{#1}%
+ \def\bf at rightcurlystyle{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\KV at bytefield@endianness}
% \begin{macro}{\bf at parse@endianness}
% Set the default endianness to either little endian or big endian.
Modified: trunk/Master/texmf-dist/tex/latex/bytefield/bytefield.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bytefield/bytefield.sty 2020-10-31 21:05:09 UTC (rev 56820)
+++ trunk/Master/texmf-dist/tex/latex/bytefield/bytefield.sty 2020-10-31 21:05:36 UTC (rev 56821)
@@ -22,7 +22,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{bytefield}
- [2020/10/22 v2.5 Network protocol diagrams]
+ [2020/10/31 v2.6 Network protocol diagrams]
\RequirePackage{calc}[1998/07/07]
\RequirePackage{keyval}
\def\bf at newdimen#1{\advance\count11 by 1
@@ -69,6 +69,7 @@
\ignorespaces\global\counting at wordstrue\make at lspace\amp}%
\vbox\bgroup\ialign\bgroup##\amp##\amp##\cr\amp
}{%
+ \unskip
\amp\show at wordlabelr\cr\egroup\egroup
\end{lrbox}%
\usebox{\entire at bytefield@picture}%
@@ -394,6 +395,8 @@
\def\bf at rightlabelspace{0.5ex}
\let\bf at leftcurly=\{
\let\bf at rightcurly=\}
+\let\bf at leftcurlystyle=\relax
+\let\bf at rightcurlystyle=\relax
\newbox{\curly at box}
\def\store at rcurly#1#2{%
\begingroup
@@ -406,11 +409,13 @@
\setlength{\curly at shift}{\half at curly@height + 0.5\curly at shift}%
\global\sbox{#1}{\raisebox{\curly at shift}{%
$\xdef\old at axis{\the\fontdimen22\textfont2}$%
- $\fontdimen22\textfont2=0pt%
- \left.
- \vrule height\half at curly@height
- width 0pt
- depth\half at curly@height\right\bf at rightcurly$%
+ \bf at rightcurlystyle{%
+ $\fontdimen22\textfont2=0pt%
+ \left.
+ \vrule height\half at curly@height
+ width 0pt
+ depth\half at curly@height\right\bf at rightcurly$%
+ }%
$\fontdimen22\textfont2=\old at axis$}}%
\endgroup
}
@@ -425,11 +430,13 @@
\setlength{\curly at shift}{\half at curly@height + 0.5\curly at shift}%
\global\sbox{#1}{\raisebox{\curly at shift}{%
$\xdef\old at axis{\the\fontdimen22\textfont2}$%
- $\fontdimen22\textfont2=0pt%
- \left\bf at leftcurly
- \vrule height\half at curly@height
- width 0pt
- depth\half at curly@height\right.$%
+ \bf at leftcurlystyle{%
+ $\fontdimen22\textfont2=0pt%
+ \left\bf at leftcurly
+ \vrule height\half at curly@height
+ width 0pt
+ depth\half at curly@height\right.$%
+ }%
$\fontdimen22\textfont2=\old at axis$}}%
\endgroup
}
@@ -436,10 +443,11 @@
\def\show at wordlabelr{}
\newlength{\wordlabelr at start}
\newlength{\wordlabelr at end}
-\newenvironment{rightwordgroup}[1]{%
+\newenvironment{rightwordgroup}[2][]{%
\endgroup
\global\wordlabelr at start=\bytefield at height
- \gdef\wordlabelr at text{#1}%
+ \gdef\wordlabelr at params{#1}%
+ \gdef\wordlabelr at text{#2}%
\ignorespaces
}{%
\begingroup
@@ -446,9 +454,11 @@
\global\wordlabelr at end=\bytefield at height
\gdef\show at wordlabelr{%
\sbox{\word at label@box}{%
- \begin{tabular}[b]{@{}l@{}}\wordlabelr at text\end{tabular}}%
+ \begin{tabular}[b]{@{}l@{}}\wordlabelr at text\end{tabular}%
+ }%
\settowidth{\label at box@width}{\usebox{\word at label@box}}%
\setlength{\label at box@height}{\wordlabelr at end-\wordlabelr at start}%
+ \expandafter\bf at bytefieldsetup\expandafter{\wordlabelr at params}%
\store at rcurly{\curly at box}{\label at box@height}%
\bf at newdimen\total at box@width
\setlength{\total at box@width}{%
@@ -455,7 +465,8 @@
\bf at rightcurlyspace +
\widthof{\usebox{\curly at box}} +
\bf at rightlabelspace +
- \label at box@width}%
+ \label at box@width
+ }%
\begin{picture}(\strip at pt\total at box@width,0)
\put(0,0){%
\hspace*{\bf at rightcurlyspace}%
@@ -462,20 +473,23 @@
\usebox{\curly at box}%
\hspace*{\bf at rightlabelspace}%
\makebox(\strip at pt\label at box@width,\strip at pt\label at box@height){%
- \usebox{\word at label@box}}}
+ \usebox{\word at label@box}%
+ }%
+ }%
\end{picture}%
\gdef\show at wordlabelr{}}%
\def\@currenvir{rightwordgroup}%
- \ignorespaces
+ \ignorespacesafterend
}
\newlength{\wordlabell at start}
\newlength{\wordlabell at end}
\newlength{\total at lbox@width}
\gdef\make at lspace{}
-\newenvironment{leftwordgroup}[1]{%
- \endgroup
+\newenvironment{leftwordgroup}[2][]{%
\global\wordlabell at start=\bytefield at height
- \gdef\wordlabell at text{#1}%
+ \gdef\wordlabell at params{#1}%
+ \gdef\wordlabell at text{#2}%
+ \bf at bytefieldsetup{#1}%
\sbox{\word at label@box}{%
\begin{tabular}[b]{@{}l@{}}\wordlabell at text\end{tabular}}%
\settowidth{\label at box@width}{\usebox{\word at label@box}}%
@@ -488,7 +502,9 @@
\global\total at lbox@width=\total at lbox@width
\gdef\make at lspace{%
\hspace*{\total at lbox@width}%
- \gdef\make at lspace{}}%
+ \gdef\make at lspace{}%
+ }%
+ \endgroup
\ignorespaces
}{%
\begingroup
@@ -500,6 +516,7 @@
\begin{tabular}[b]{@{}l@{}}\wordlabell at text\end{tabular}}%
\settowidth{\label at box@width}{\usebox{\word at label@box}}%
\setlength{\label at box@height}{\wordlabell at end-\wordlabell at start}%
+ \expandafter\bf at bytefieldsetup\expandafter{\wordlabell at params}%
\store at lcurly{\curly at box}{\label at box@height}%
\begin{picture}(0,0)
\put(\strip at pt\starting at point,0){%
@@ -510,7 +527,7 @@
\hspace*{\bf at leftcurlyspace}}
\end{picture}%
\def\@currenvir{leftwordgroup}%
- \ignorespaces
+ \ignorespacesafterend
}
\newlength{\label at box@width}
\newlength{\label at box@height}
@@ -606,6 +623,12 @@
\def\bf at leftcurlyshrinkage{#1}%
\def\bf at rightcurlyshrinkage{#1}%
}
+\define at key{bytefield}{leftcurlystyle}{\def\bf at leftcurlystyle{#1}}
+\define at key{bytefield}{rightcurlystyle}{\def\bf at rightcurlystyle{#1}}
+\define at key{bytefield}{curlystyle}{%
+ \def\bf at leftcurlystyle{#1}%
+ \def\bf at rightcurlystyle{#1}%
+}
\define at key{bytefield}{endianness}{\bf at parse@endianness{#1}}
\newcommand{\bf at parse@endianness}[1]{%
\def\bf at little{little}%
More information about the tex-live-commits
mailing list.