3

Following page 17 of the bytefield package documentation:

bytefield package doc. pg. 17

extracting the above to this MCVE:

\documentclass{article}
\usepackage{bytefield}
\usepackage{xcolor}
\usepackage{graphicx}

\definecolor{lightgray}{gray}{0.8}

\begin{document} \begin{bytefield}{32} \bitheader{0,4,8,12,16,20,24,28} \ \bitbox{8}{Tag} & \bitbox{8}{Value} & \bitbox{4}[bgcolor=lightgray]{} & \bitbox{12}{Mask} \ \wordbox{1}{Key} \end{bytefield}

\end{document}

and using pdflatex test.tex and firefox test.pdf I'm getting some weird result where it seems the bgcolor argument isn't being recognized (see below):

weird bgcolor behaviour

If I use \listfiles I get:

 *File List*
 article.cls    2019/12/20 v1.4l Standard LaTeX document class
  size10.clo    2019/12/20 v1.4l Standard LaTeX file (size option)
bytefield.sty    2017/09/15 v2.4 Network protocol diagrams
    calc.sty    2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
  pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex
graphicx.sty    2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
l3backend-pdfmode.def    2020-02-03 L3 backend support: PDF mode
supp-pdf.mkii
epstopdf-base.sty    2020-01-24 v2.11 Base part for package epstopdf
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
Ralph
  • 133

1 Answers1

3

Your log file starts with

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2023.10.5)  10 OCT 2023 05:34

which means you're using an outdated TeX distribution. The package bytefield has started supporting colors later than version 2.4 that your distribution provides.

The current version is 2.8 released 2023/09/24.

As an experiment, I copied the current version in the same working directory as your example (you can download it from CTAN) and your example compiles, so you may go through with this workaround. But the best thing is to update your TeX distribution.

See How to install "vanilla" TeXLive on Debian or Ubuntu? for how to do it.

egreg
  • 1,121,712