I'm attempting to draft a document that makes very heavy use of the bytefield package and running into the situation that it seems no good solution exists for fields that have to be 64 bits wide (even the documentation doesn't show such examples!). Without further ado, here's the result:
As you can see, the width of the 64-bit value drives off the page. I've attempted to constrain this with the optional bitwidth parameter as described in the documentation (such as following this answer's question to provide an argument of 0.8\textwidth, adjusting from there, but doing so generates an "Arithmetic overflow" error. Does anyone know how to constrain the width of the whole field itself, or at least force bytefield to produce a field that cannot be wider than the page itself?
Here is the code for the minimum working example:
\documentclass[10pt]{extreport}
\usepackage[margin=2.0cm,a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{bytefield}
\begin{document}
\noindent
An \texttt{unsigned word} is defined as a 16-bit or two-octet quantity, having the range \texttt{[0, 65535]}: \\
\begin{center}
\begin{bytefield}[endianness=big]{16}
\bitheader{15, 7, 0} \\
\bitbox{16}{\texttt{unsigned word}} \\
\end{bytefield}
\end{center}
An \texttt{unsigned word} is addressable as an 2-size array of bytes, where \texttt{byte[0]} corresponds to the most-significant byte in the word (the \textit{high byte}) and \texttt{byte[1]} corresponds to the least-significant byte in the word (the \textit{low byte}). \\
\vspace{5pt}
\hrule
\vspace{15pt}
\noindent
An \texttt{unsigned doubleword} is defined as a 32-bit or four-octet quantity, having the range \texttt{[0, 4294967295]}: \\
\begin{center}
\begin{bytefield}[endianness=big]{32}
\bitheader{31, 23, 15, 7, 0} \\
\bitbox{32}{\texttt{unsigned doubleword}} \\
\end{bytefield}
\end{center}
An \texttt{unsigned doubleword} is addressable as an 4-size array of bytes, where \texttt{byte[0]} corresponds to the most-significant byte in the doubleword (the \textit{high byte}) and \texttt{byte[3]} corresponds to the least-significant byte in the doubleword (the \textit{low byte}). \\
\vspace{5pt}
\hrule
\vspace{15pt}
\noindent
An \texttt{unsigned quadword} is defined as a 64-bit or eight-octet quantity, having the range \texttt{[0, 18446744073709551615]}: \\
\begin{center}
\begin{bytefield}[endianness=big]{64}
\bitheader{63, 55, 47, 39, 31, 23, 15, 7, 0} \\
\bitbox{64}{\texttt{unsigned quadword}} \\
\end{bytefield}
\end{center}
An \texttt{unsigned quadword} is addressable as an 8-size array of bytes, where \texttt{byte[0]} corresponds to the most-significant byte in the quadword (the \textit{high byte}) and \texttt{byte[7]} corresponds to the least-significant byte in the quadword (the \textit{low byte}). \\
\end{document}
The non-working code that generates the error is as follows - wrapping it in curly braces does not alleviate the error:
\begin{center}
\begin{bytefield}[endianness=big, bitwidth=0.8\textwidth]{64}
\bitheader{63, 55, 47, 39, 31, 23, 15, 7, 0} \\
\bitbox{64}{\texttt{unsigned quadword}} \\
\end{bytefield}
\end{center}
Also, word to the wise - I'm still (slowly) getting the ropes in TeX, so my skill for self-serving is still somewhat limited to "hunt online for solution, hope someone has implemented it"; you may have to help break a potential answer down for me a bit.
The environment in question, if it helps, is MacTex 2015 (TeXLive-2015); code was built using TeXstudio 2.10.4.





bitwidth=0.015\textwidthseems more likely to work – egreg Feb 08 '16 at 19:16