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:
\documentclass[beamer]{beamer}
\usepackage{easybmat} % I get different errors depending
\usepackage{etex} % on the order of these two lines
\begin{document}
test
\end{document}
Do I need to resort to \LoadClass solutions? (I so, I need help…)
Best Answer
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 bothetex
andeasybmat
loaded beforetikz
and makes the problem disappear:SOLUTION 2. Loading
easybmat
first and thenetex
cannot work because there won't be enoughdimen
registers available foreasybmat
. So you must loadetex
first andeasybmat
second. The error message becomesYou can't use a prefix with '\begingroup'
. The reason for this error is due to botheasybmat.sty
andetex.sty
. The problem witheasybmat.sty
is that it calls the packageeasy.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 becauseetex.sty
is loaded and (the two conditions must be met) the\newdimen
with the\global
occurs whenetex.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 frometex.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.