texlive[74421] branches/branch2024.final/Master/texmf-dist: bytefield

commits+karl at tug.org commits+karl at tug.org
Mon Mar 3 22:22:14 CET 2025


Revision: 74421
          https://tug.org/svn/texlive?view=revision&revision=74421
Author:   karl
Date:     2025-03-03 22:22:14 +0100 (Mon, 03 Mar 2025)
Log Message:
-----------
bytefield (branch) (3mar25)

Modified Paths:
--------------
    branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/README
    branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/bf-example.pdf
    branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/bytefield.pdf
    branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.dtx
    branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.ins
    branches/branch2024.final/Master/texmf-dist/tex/latex/bytefield/bytefield.sty

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/README
===================================================================
--- branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/README	2025-03-03 21:22:04 UTC (rev 74420)
+++ branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/README	2025-03-03 21:22:14 UTC (rev 74421)
@@ -24,16 +24,14 @@
                             bytefield.dvi
 
 Note that bytefield comes with pre-built documentation.  Also, there
-is an example.tex file that shows how one might include hyperlinks in
-a protocol diagram.  example.tex needs the hyperref package and should
-be run through pdfLaTeX, VTeX, dvipdfm, or any other backend that
-supports hyperref hyperlinks.
+is a bf-example.tex file that shows how one might include hyperlinks in
+a protocol diagram.
 
 
 Copyright and license
 ---------------------
 
-Copyright (C) 2000-2023 Scott Pakin, scott+bf at pakin.org
+Copyright (C) 2000-2025 Scott Pakin, scott+bf at pakin.org
 
 This package may be distributed and/or modified under the conditions
 of the LaTeX Project Public License, either version 1.3a of this

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/bf-example.pdf
===================================================================
(Binary files differ)

Modified: branches/branch2024.final/Master/texmf-dist/doc/latex/bytefield/bytefield.pdf
===================================================================
(Binary files differ)

Modified: branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.dtx
===================================================================
--- branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.dtx	2025-03-03 21:22:04 UTC (rev 74420)
+++ branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.dtx	2025-03-03 21:22:14 UTC (rev 74421)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2000-2023 by Scott Pakin <scott+bf at pakin.org>
+% Copyright (C) 2000-2025 by Scott Pakin <scott+bf at 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>
-    [2023/09/24 v2.8 Network protocol diagrams]
+    [2025/01/25 v2.9 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-2023, Scott Pakin},
+  pdfcopyright={Copyright (C) 2000-2025, Scott Pakin},
   pdflicenseurl={http://www.latex-project.org/lppl/},
   pdfcaptionwriter={Scott Pakin},
   pdfcontactemail={scott+bf at pakin.org},
@@ -68,7 +68,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{1182}
+% \CheckSum{1205}
 %
 % \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
@@ -2067,16 +2067,14 @@
 % The following macros in this section are used by the box-drawing macros
 % and the ``skipped words''-drawing macros.
 %
-% \begin{macro}{\bf at newdimen}
-% \begin{macro}{\allocationnumber}
-% \changes{v1.1}{2002/09/15}{Bug fix: Added \cs{bf at newdimen} to greatly
-%   reduce the likelihood of ``\texttt{No room for a new \cs{dimen}}''
-%   errors (reported by Vitaly A. Repin)}
-% |\newdimen| defines new \meta{dimen}s globally.  |\bf at newdimen|
-% defines them locally.  It simply merges \LaTeXe's |\newdimen| and
-% |\alloc@| macros while omitting |\alloc@|'s ``|\global|'' declaration.
+% \begin{macro}{\bf at newdimen@old}
+% \LaTeX's |\newdimen| defines new \meta{dimen}s globally.
+% |\bf at newdimen@old| defines them locally.  It simply merges
+% \LaTeXe's |\newdimen| and |\alloc@| macros while omitting |\alloc@|'s
+% ``|\global|'' declaration.  The ``|old|'' in the name implies that
+% |\bf at newdimen@old| is intended for use with older versions of \LaTeX.
 %    \begin{macrocode}
-\def\bf at newdimen#1{\advance\count11 by 1
+\def\bf at newdimen@old#1{\advance\count11 by 1
   \ch at ck1\insc at unt\dimen
   \allocationnumber=\count11
   \dimendef#1=\allocationnumber
@@ -2084,31 +2082,81 @@
 }
 %    \end{macrocode}
 % \end{macro}
+%
+% \begin{macro}{\bf at e@alloc}
+% Since 2014, \LaTeX\ has provided an internal |\e at alloc| macro that is
+% used to define |\newcount|, |\newdimen|, |\newskip|, etc.  |\bf at e@alloc|
+% is a version of |\e at alloc| modified to allocate only within the current
+% scope.  (It elides all uses of |\global|.)  We use |\bf at e@alloc| to
+% define |\bf at newdimen|, which allocates a locally scoped \meta{dimen}.
+%    \begin{macrocode}
+\def\bf at e@alloc#1#2#3#4#5#6{%
+  \advance#3\@ne
+  \e at ch@ck{#3}{#4}{#5}#1%
+  \allocationnumber#3\relax
+  #2#6\allocationnumber
+  \wlog{\string#6=\string#1\the\allocationnumber\space (locally)}%
+}
+%    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\bf at newdimen}
-% $\varepsilon$-\TeX\ provides many more \meta{dimen}s than the original
-% \TeX's 255.  When running newer versions of $\varepsilon$-\TeX\ we
-% rebind |\bf at newdimen| to |\newdimen|.  If the \pkgname{etex} package
-% is loaded, however, we instead rebind |\bf at newdimen| to |\locdimen| to
-% keep the allocation local.  Finally, if we're not running
-% $\varepsilon$-\TeX\ we leave |\bf at newdimen| defined as above to help
-% reduce register pressure when only 255 \meta{dimen}s are available.
+% \changes{v1.1}{2002/09/15}{Bug fix: Added \cs{bf at newdimen} to greatly
+%   reduce the likelihood of ``\texttt{No room for a new \string\cs{dimen}}''
+%   errors (reported by Vitaly A. Repin)}
 % \changes{v1.3}{2010/10/31}{Added support for $\varepsilon$-\TeX's larger
 %   local \meta{dimen} pool (code provided by Heiko Oberdiek)}
 % \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\
+%   \cs{dimen}}'' errors in newer versions of $\varepsilon$-\TeX\
 %   (see \url{http://tex.stackexchange.com/q/275042})}
+% \changes{v2.9}{2025/01/25}{Rewrite \cs{bf at newdimen} yet again so as to
+%   allocate \meta{dimen}s locally in newer versions of \LaTeX.  Thanks to
+%   Qian Jin for the bug report}
+% \pkgname{bytefield} allocates a number of \meta{dimen}s, largely for
+% positioning curly braces.  Because \TeX\ supports only 255
+% \meta{dimen}s, these normally would run out quickly for documents
+% containing many bit fields.  $\varepsilon$-\TeX\ provides many more
+% \meta{dimen}s that the original \TeX, but it still would be preferable
+% not to consume them unnecessarily.
+%
+% This is where |\bf at newdimen| comes in.  If the \pkgname{elocalloc}
+% package is loaded, |\bf at newdimen| is bound to \pkgname{elocalloc}'s
+% |\locdimen| macro.  Otherwise, if |\e at alloc| is defined---this is the
+% common case---then |\bf at newdimen| is defined in terms of |\bf at e@alloc|
+% just like |\newdimen| is defined in terms of |\e at alloc|.  As a last
+% resort, |\bf at newdimen| is bound to |\bf at newdimen@old| for use with old
+% versions of \LaTeX.
 %    \begin{macrocode}
 \AtBeginDocument{%
-  \expandafter\ifx\csname e at alloc\endcsname\relax
-    \expandafter\ifx\csname locdimen\endcsname\relax
+%    \end{macrocode}
+% Is \pkgname{elocalloc} loaded?
+%    \begin{macrocode}
+  \expandafter\ifx\csname locdimen\endcsname\relax
+%    \end{macrocode}
+% No.  Are we running a reasonably recent \LaTeX?
+%    \begin{macrocode}
+    \expandafter\ifx\csname e at alloc\endcsname\relax
+%    \end{macrocode}
+% No.  Use |\bf at newdimen@old|, which was designed in terms of primitives
+% found in older versions of \LaTeX.
+%    \begin{macrocode}
+      \global\let\bf at newdimen=\bf at newdimen@old
     \else
-      \let\bf at newdimen=\locdimen
+%    \end{macrocode}
+% We are running a reasonably recent \LaTeX\@.  Define |\bf at newdimen|
+% in terms of |\bf at e@alloc|, which allocates \meta{dimen}s locally.
+%    \begin{macrocode}
+      \gdef\bf at newdimen{%
+        \bf at e@alloc\dimen \dimendef {\count11}\insc at unt\float at count
+      }%
     \fi
   \else
-    \let\bf at newdimen=\newdimen
+%    \end{macrocode}
+% \pkgname{elocalloc} is loaded.  Define |\bf at newdimen| in terms of
+% \pkgname{elocalloc}'s |\locdimen| macro.
+%    \begin{macrocode}
+    \let\bf at newdimen=\locdimen
   \fi
 }
 %    \end{macrocode}

Modified: branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.ins
===================================================================
--- branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.ins	2025-03-03 21:22:04 UTC (rev 74420)
+++ branches/branch2024.final/Master/texmf-dist/source/latex/bytefield/bytefield.ins	2025-03-03 21:22:14 UTC (rev 74421)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2000-2023 by Scott Pakin <scott+bf at pakin.org>
+%% Copyright (C) 2000-2025 by Scott Pakin <scott+bf at pakin.org>
 %%
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3a of this license
@@ -21,7 +21,7 @@
 
 This is a generated file.
 
-Copyright (C) 2000-2023 by Scott Pakin <scott+bf at pakin.org>
+Copyright (C) 2000-2025 by Scott Pakin <scott+bf at pakin.org>
 
 This file may be distributed and/or modified under the conditions of
 the LaTeX Project Public License, either version 1.3a of this license

Modified: branches/branch2024.final/Master/texmf-dist/tex/latex/bytefield/bytefield.sty
===================================================================
--- branches/branch2024.final/Master/texmf-dist/tex/latex/bytefield/bytefield.sty	2025-03-03 21:22:04 UTC (rev 74420)
+++ branches/branch2024.final/Master/texmf-dist/tex/latex/bytefield/bytefield.sty	2025-03-03 21:22:14 UTC (rev 74421)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2000-2023 by Scott Pakin <scott+bf at pakin.org>
+%% Copyright (C) 2000-2025 by Scott Pakin <scott+bf at pakin.org>
 %% 
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3a of this license
@@ -22,23 +22,33 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{bytefield}
-    [2023/09/24 v2.8 Network protocol diagrams]
+    [2025/01/25 v2.9 Network protocol diagrams]
 \RequirePackage{calc}[1998/07/07]
 \RequirePackage{keyval}
-\def\bf at newdimen#1{\advance\count11 by 1
+\def\bf at newdimen@old#1{\advance\count11 by 1
   \ch at ck1\insc at unt\dimen
   \allocationnumber=\count11
   \dimendef#1=\allocationnumber
   \wlog{\string#1=\string\dimen\the\allocationnumber\space (locally)}%
 }
+\def\bf at e@alloc#1#2#3#4#5#6{%
+  \advance#3\@ne
+  \e at ch@ck{#3}{#4}{#5}#1%
+  \allocationnumber#3\relax
+  #2#6\allocationnumber
+  \wlog{\string#6=\string#1\the\allocationnumber\space (locally)}%
+}
 \AtBeginDocument{%
-  \expandafter\ifx\csname e at alloc\endcsname\relax
-    \expandafter\ifx\csname locdimen\endcsname\relax
+  \expandafter\ifx\csname locdimen\endcsname\relax
+    \expandafter\ifx\csname e at alloc\endcsname\relax
+      \global\let\bf at newdimen=\bf at newdimen@old
     \else
-      \let\bf at newdimen=\locdimen
+      \gdef\bf at newdimen{%
+        \bf at e@alloc\dimen \dimendef {\count11}\insc at unt\float at count
+      }%
     \fi
   \else
-    \let\bf at newdimen=\newdimen
+    \let\bf at newdimen=\locdimen
   \fi
 }
 \newlength{\bytefield at height}



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