I have a book written in LaTeX (WinEdt 9, Windows 7) that I cannot compile after I switched to a new computer (worked perfectly before). The error is You can't use prefix with "\begingroup on one of the \Newassociation-lines (package answers) in the minimal example below. The problems seems to be an incompatibility between packages, but I have not been able to pinpoint which package(s) that is the problem. In the example below the error is on the line \Newassociation{hint}{Hint}{hint}, but if I remove the \newtheorem-line, the error instead comes on the line \Newassociation{sol}{Solution}{sol}. I cannot get rid of the error by switching the order of the \usepackage commands as was recommended in another discussion here. Any suggestions?

Short text

----more info---- I believe that I am using at least quite recent versions of everything as my computer is less than a year old. I am running: This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2015.5.19)

I added \listfiles and used the suggested workaround (otherwise \listfiles would not work; the workaround also worked for the whole book document) and got the following:

*File List*
book.cls    2007/10/19 v1.4h Standard LaTeX document class
bk10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
siunitx.sty    2015/01/21 v2.6e A comprehensive (SI) units package
expl3.sty    2015/03/01 v5547 L3 programming layer (loader) 
expl3-code.tex    2015/03/01 v5547 L3 programming layer 
etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3unicode-data.def    2015/03/01 v5544 L3 Unicode data
l3pdfmode.def    2015/03/01 v5544 L3 Experimental driver: PDF mode
xparse.sty    2014/11/25 v5471 L3 Experimental document command parser
amstext.sty    2000/06/29 v2.01
amsgen.sty    1999/11/30 v2.0
array.sty    2008/09/09 v2.4c Tabular extension package (FMi)
l3keys2e.sty    2014/11/25 v5471 LaTeX2e option processing using LaTeX3 keys
translator.sty    2010/06/12 ver 1.10
keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
answers.sty    2014/08/24 v2.16 Production of solution sheets in LaTeX2e
verbatim.sty    2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
amsthm.sty    2004/08/06 v2.20
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
epstopdf.sty    2010/02/09 v2.5 Conversion with epstopdf on the fly (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
caption.sty    2013/05/02 v3.3-89 Customizing captions (AR)
caption3.sty    2013/05/02 v1.6-88 caption3 kernel (AR)
mhchem.sty    2015/04/07 v4.00 for typesetting chemical formulae
l3regex.sty    2014/11/25 v5471 L3 Experimental regular expressions
l3tl-build.sty    2014/08/25 v5378 L3 Experimental token list construction  
l3tl-analysis.sty    2014/05/06 v4745 L3 Experimental token lists analysis
l3str.sty    2014/11/25 v5471 L3 Experimental strings
l3flag.sty    2014/11/25 v5471 L3 Experimental flags
l3str-convert.sty    2014/06/03 v5028 L3 Experimental string encoding conversions
calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
amsmath.sty    2013/01/14 v2.14 AMS math features
amsbsy.sty    1999/11/29 v1.2d
amsopn.sty    1999/12/14 v2.01 operator names
ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
float.sty    2001/11/08 v1.3d Float enhancements (AL)
placeins.sty    2005/04/18  v 2.2
pdfpages.sty    2015/04/15 v0.4w Insert pages of external PDF documents (AM)
eso-pic.sty    2013/10/06 v2.0d eso-pic (RN)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
pppdftex.def    2015/04/15 v0.4w Pdfpages driver for pdfTeX (AM)
makeidx.sty    2000/03/29 v1.0m Standard LaTeX package
enumerate.sty    1999/03/05 v3.00 enumerate extensions (DPC)
xspace.sty    2009/10/20 v1.13 Space after command names (DPC,MH)
textgreek.sty    2011/10/09 v0.7 Greek symbols in text
lgrenc.def    2013/12/02 v0.11.2 LGR Greek font encoding definitions
greek-fontenc.def    2014/12/12 v0.12 Common Greek font encoding definitions
lgrcmr.fd    2013/09/01 v1.0 Greek European Computer Regular
siunitx-abbreviations.cfg    2015/01/21 v2.6e siunitx: Abbreviated units

----Correction---- A double \usepackage{caption} removed (still the same error). File list updated (probably did not change).

----Problem solved---- I updated MikTeX and all packages; this solved the problem.

  • 1
    Welcome to TeX.SX! This is a cross-post from LC: latex-community.org/forum/…. fixltx2e isn't needed any longer since 2015 format update. And I can compile this without any errors – user31729 Dec 28 '15 at 23:04
  • 1
    You should give us more information on the TeX distribution and its version and adding perhaps the output of \listfiles (put that command before \begin{document} – user31729 Dec 28 '15 at 23:08
  • 1
    I suspect a non up-to-date TeX distribution. Which one are you using? – egreg Dec 28 '15 at 23:08
  • 1
    I have no problem compiling this code. Btw, you don't have to load fixltx2e anymore: the bug fixes are now part of the kernel. – Bernard Dec 28 '15 at 23:09
  • add \listfiles to your preamble and then copy the file list from the log to your question, then someone can tell you which packages are out of date – David Carlisle Dec 28 '15 at 23:19

You are hitting an obscure bug in LaTeX prior to the 2015 kernel. I suspect the “new” machine has a non updated TeX distribution.

The best thing you can do is to ensure that the TeX distribution is the most recent one, with all updates in place.

There is a workaround, anyway: just define a new counter before the error happens.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.