I'm trying to use bytefield and subfig (and also tested with subfigure with the same results) but I got the error:
! Extra alignment tab has been changed
to \cr. \endtemplate
at the end of the subfloat environment.
The code below reproduces the problem
\documentclass{article}
\usepackage{bytefield}
\usepackage{subfig}
\begin{document}
\pagestyle{empty}
% this works
\begin{figure}
\begin{bytefield}{16}
\wordbox{1}{A 16-bit field} \
\bitbox{8}{8 bits} & \bitbox{8}{8 more bits} \
\wordbox{2}{A 32-bit field. Note that text wraps within the box.}
\end{bytefield}
\caption{Some caption}
\end{figure}
% this doesn't
\begin{figure}
\subfloat[]{
\begin{bytefield}{16}
\wordbox{1}{A 16-bit field} \
\bitbox{8}{8 bits} & \bitbox{8}{8 more bits} \
\wordbox{2}{A 32-bit field. Note that text wraps within the box.}
\end{bytefield}
}% the error is trown here
\subfloat[]{
\begin{bytefield}{16}
\wordbox{1}{A 16-bit field} \
\bitbox{8}{8 bits} & \bitbox{8}{8 more bits} \
\wordbox{2}{A 32-bit field. Note that text wraps within the box.}
\end{bytefield}
}% and here
\caption{Some caption}
\end{figure}
\end{document}


lrboxworked, while using\sboxdid not? Is somehow different in comparison to\sbox? – adn Jan 08 '14 at 11:49\sboxsuffers from the same problem, because the text is absorbed as an argument, andbytefielddoesn't like it. – egreg Jan 08 '14 at 11:50amsmath). The purpose oflrboxis exactly not absorbing the text as an argument, but packaging it in a box nonetheless. It uses some really slick tricks. – egreg Jan 08 '14 at 12:08