I've written an article using the easybmat package and now it is time to create the beamer slides....however, as you can see here, in order to load both the easybmat and tikz (or pgf?) one needs to first load the etex package. This I do not know how to do in the beamer documentclass where the most minimal example fails:


\usepackage{easybmat} % I get different errors depending  
\usepackage{etex}     % on the order of these two lines 


Do I need to resort to \LoadClass solutions? (I so, I need help...)

1 Answer 1


I've already encountered this bug once. Here are two solutions to solve the problem; the first is quick and easy to put in place, while the second needs to look at where the problem occurs.

SOLUTION 1. It is possible to load packages before \documentclass by using \RequirePackage instead of \usepackage. This allows to get both etex and easybmat loaded before tikz and makes the problem disappear:


SOLUTION 2. Loading easybmat first and then etex cannot work because there won't be enough dimen registers available for easybmat. So you must load etex first and easybmat second. The error message becomes You can't use a prefix with '\begingroup'. The reason for this error is due to both easybmat.sty and etex.sty. The problem with easybmat.sty is that it calls the package easy.sty which declares some new dimensions with \global\newdimen. Putting a \global before \newdimen is not necessary but is usually harmless. Here, however, it is not harmless because etex.sty is loaded and (the two conditions must be met) the \newdimen with the \global occurs when etex.sty switches between the vanilla TeX registers and the extended eTeX engine ones. The reason can be found in the code of the \alloc@ macro from etex.sty which has a \begingroup in it. What happens is that the \global before \newdimen gets applied to this \begingroup, thus triggering the error. A (not very elegant) way to solve the problem is to put a dummy definition just before the \begingroup. It should not (I hope) have any side effects.


 {\ifnum\count1#1<#4% make sure there's still room
    \def\etex@dummy@definition{}% <-- code added
    \begingroup \escapechar\m@ne
  \else\errmessage{No room for a new #2}\fi\fi

  • This works!! Thanks. Is this a bug? In what package? are you going to report it with you nifty workaround? Nov 26, 2010 at 12:46
  • @Philippe: Your second solution looks really nice! Maybe you can edit your answer to give this easy solution first? I think this would be very helpful! Nov 26, 2010 at 17:20
  • @ Hendrik: I've put the easiest solution first as well as expanded a little the explanations of the second. @Yossi: It might be considered a bug in etex, but the problem is really with easybmat which should not use \global before \newdimen. I'll try to report the problem, but I'm not sure the easybmat package is still actively maintained or that a hack as a dummy definition would be acceptable in a common package like etex. Nov 26, 2010 at 21:22
  • There's been some discussion of this issue on the LaTeX-L list in the context of the etex package.
    – Joseph Wright
    Nov 26, 2010 at 22:10
  • @Philippe: +1, great, looks much better now. (By the way, I didn't get notified of your comment due to the space after "@". But only this way Yossi was notified: You can only notify one user with "@".) Nov 26, 2010 at 22:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .