summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bytefield/bytefield.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/bytefield/bytefield.dtx')
-rw-r--r--macros/latex/contrib/bytefield/bytefield.dtx57
1 files changed, 27 insertions, 30 deletions
diff --git a/macros/latex/contrib/bytefield/bytefield.dtx b/macros/latex/contrib/bytefield/bytefield.dtx
index 8af3e52bbf..24ee535fda 100644
--- a/macros/latex/contrib/bytefield/bytefield.dtx
+++ b/macros/latex/contrib/bytefield/bytefield.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2000-2020 by Scott Pakin <scott+bf@pakin.org>
+% Copyright (C) 2000-2021 by Scott Pakin <scott+bf@pakin.org>
% -----------------------------------------------------------
%
% This file may be distributed and/or modified under the
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{bytefield}
%<*package>
- [2020/10/31 v2.6 Network protocol diagrams]
+ [2021/08/17 v2.7 Network protocol diagrams]
%</package>
%
%<*driver>
@@ -46,7 +46,7 @@
pdfauthor={Scott Pakin},
pdfsubject={Protocol diagrams for LaTeX},
pdfkeywords={bits, bytes, bit fields, communication, network protocol diagrams, LaTeX2e, memory maps},
- pdfcopyright={Copyright (C) 2000-2020, Scott Pakin},
+ pdfcopyright={Copyright (C) 2000-2021, Scott Pakin},
pdflicenseurl={http://www.latex-project.org/lppl/},
pdfcaptionwriter={Scott Pakin},
pdfcontactemail={scott+bf@pakin.org},
@@ -68,7 +68,7 @@
%</driver>
% \fi
%
-% \CheckSum{1194}
+% \CheckSum{1182}
%
% \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
@@ -423,10 +423,7 @@
%
% The first, optional, argument, \meta{sides}, is a list of letters
% specifying which sides of the field box to draw---[|l|]eft, [|r|]ight,
-% [|t|]op, and/or [|b|]ottom.\footnote{Uppercase |L|, |R|, |T|, and |B|
-% undo a prior |l|, |r|, |t|, or |b| and may be useful for writing
-% wrapper commands around \texttt{\string\bitbox} and
-% \texttt{\string\wordbox}.} The default is ``|lrtb|'' (i.e.,~all
+% [|t|]op, and/or [|b|]ottom. The default is ``|lrtb|'' (i.e.,~all
% sides are drawn). The second, required, argument is the width in bits
% of a bit box or the height in words of a word box. The third argument
% is an optional, comma-separated list of \meta{key}=\meta{value} pairs,
@@ -2342,9 +2339,7 @@
% Put some text~(|#4|) in a box that's a given number of bits~(|#2|)
% wide and one byte tall. An optional argument~(|#1|) specifies which
% lines to draw---|[l]|eft, |[r]|ight, |[t]|op, and/or |[b]|ottom
-% (default: |lrtb|). Uppercase letters provide the opposite effect:
-% They suppress drawing the |[L]|eft, |[R]|ight, |[T]|op, and/or
-% |[B]|ottom sides. Additional drawing parameters can be provided via
+% (default: |lrtb|). Additional drawing parameters can be provided via
% another optional argument~(|#3|).
% \begin{macrocode}
\DeclareRobustCommand{\bitbox}{\bf@call@box@cmd{\bf@bitbox}}
@@ -2389,9 +2384,7 @@
% Put some text~(|#4|) in a box that's a given number of bytes~(|#2|)
% tall and one word (|\bits@wide| bits) wide. An optional
% argument~(|#1|) specifies which lines to draw---|[l]|eft, |[r]|ight,
-% |[t]|op, and/or |[b]|ottom (default: |lrtb|). Uppercase letters
-% provide the opposite effect: They suppress drawing the |[L]|eft,
-% |[R]|ight, |[T]|op, and/or |[B]|ottom sides. Additional drawing
+% |[t]|op, and/or |[b]|ottom (default: |lrtb|). Additional drawing
% parameters can be provided via another optional argument~(|#3|).
% \begin{macrocode}
\DeclareRobustCommand{\wordbox}{\bf@call@box@cmd{\bf@wordbox}}
@@ -2565,9 +2558,8 @@
% Put each token in |#3| into a box that's a given number of bits (|#2|)
% wide and one byte tall. An optional argument (|#1|) specifies which
% lines to draw---|[l]|eft, |[r]|ight, |[t]|op, and/or |[b]|ottom
-% (default: |lrtb|). Uppercase letters suppress drawing the |[L]|eft,
-% |[R]|ight, |[T]|op, and/or |[B]|ottom sides. The |*|-form of the
-% command omits interior left and right lines.
+% (default: |lrtb|). The |*|-form of the command omits interior left
+% and right lines.
% \begin{macrocode}
\DeclareRobustCommand{\bitboxes}{%
\@ifstar
@@ -2700,11 +2692,14 @@
% \subsubsection{Parsing arguments}
%
% The macros in this section are used to parse the optional argument to
-% |\bitbox| or |\wordbox|, which is some subset of $\{ |l|, |r|, |t|,
-% |b|, |L|, |R|, |T|, |B| \}$. Lowercase letters display the left,
-% right, top, or bottom side of a box; uppercase letters inhibit the
-% display. The default is not to display any sides, but an uppercase
-% letter can negate the effect of a prior lowercase letter.
+% \cs{bitbox}, \cs{wordbox}, and \cs{bitboxes}, which is some subset of
+% $\{ |l|, |r|, |t|, |b|, |L|, |R|, |T|, |B| \}$ and defaults to
+% ``|lrtb|'' for all three user macros. If the argument is empty, no
+% lines are drawn. Lowercase letters in the argument display,
+% respectively, the left, right, top, or bottom side of a box.
+% Uppercase letters undo the effect of the corresponding, prior,
+% lowercase letter and are used internally by \cs{bitboxes} to suppress
+% internal left and right lines.
%
% \begin{macro}{\ifbitbox@top}
% \begin{macro}{\ifbitbox@bottom}
@@ -3064,6 +3059,8 @@
% \end{macro}
%
% \begin{macro}{\store@rcurly}
+% \changes{v2.7}{2021/08/17}{Properly align right curly braces under
+% Lua\string\LaTeX\ (bug reported by Georgi Nikiforov)}
% \begin{macro}{\curly@height}
% \begin{macro}{\half@curly@height}
% \begin{macro}{\curly@shift}
@@ -3083,16 +3080,15 @@
\bf@newdimen\curly@shift
\setlength{\curly@shift}{\bf@rightcurlyshrinkage}%
\setlength{\curly@shift}{\half@curly@height + 0.5\curly@shift}%
+ \addtolength{\curly@shift}{-\fontdimen22\textfont2}%
\global\sbox{#1}{\raisebox{\curly@shift}{%
- $\xdef\old@axis{\the\fontdimen22\textfont2}$%
\bf@rightcurlystyle{%
- $\fontdimen22\textfont2=0pt%
- \left.
+ $\left.
\vrule height\half@curly@height
width 0pt
depth\half@curly@height\right\bf@rightcurly$%
}%
- $\fontdimen22\textfont2=\old@axis$}}%
+ }}%
\endgroup
}
% \end{macrocode}
@@ -3103,6 +3099,8 @@
% \end{macro}
%
% \begin{macro}{\store@lcurly}
+% \changes{v2.7}{2021/08/17}{Properly align left curly braces under
+% Lua\string\LaTeX\ (bug reported by Georgi Nikiforov)}
% \begin{macro}{\curly@height}
% \begin{macro}{\half@curly@height}
% \begin{macro}{\curly@shift}
@@ -3118,16 +3116,15 @@
\bf@newdimen\curly@shift
\setlength{\curly@shift}{\bf@leftcurlyshrinkage}%
\setlength{\curly@shift}{\half@curly@height + 0.5\curly@shift}%
+ \addtolength{\curly@shift}{-\fontdimen22\textfont2}%
\global\sbox{#1}{\raisebox{\curly@shift}{%
- $\xdef\old@axis{\the\fontdimen22\textfont2}$%
\bf@leftcurlystyle{%
- $\fontdimen22\textfont2=0pt%
- \left\bf@leftcurly
+ $\left\bf@leftcurly
\vrule height\half@curly@height
width 0pt
depth\half@curly@height\right.$%
}%
- $\fontdimen22\textfont2=\old@axis$}}%
+ }}%
\endgroup
}
% \end{macrocode}