8

I am pretty new to LaTeX. With windows, Miktex/Texmaker pretty-much takes care of package installation whenever needed, but on Ubuntu I have been downloading needed packages from CTAN and installing them manually. So today I installed three packages on my Ubuntu 9.10: xfor, datatool and etoolbox. For some reason I get this weird error on quick build:

(/usr/share/texmf/tex/latex/datatool/datatool-base.sty
Package: datatool-base 2012/07/18 v2.10 (NLCT)
(/usr/share/texmf/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2011/01/03 v2.1 e-TeX tools for LaTeX
\etb@tempcnta=\count97
! LaTeX Error: Command \AtBeginEnvironment already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

Can anyone help me fix this error ? I am actually writing my thesis using a cls file provided by my university. I am using Texmaker editor.

lockstep
  • 250,273
nurabha
  • 249
  • 2
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. – Marco Daniel Aug 04 '12 at 10:46
  • Why do you use Ubuntu 9.10. It's very old and not longer supported. You can install TeX Live 2012 to avoid the manual installation of packages. – Marco Daniel Aug 04 '12 at 10:46
  • 3
    Please cut your document down to load the minimum number of packages such that you still get the error and then edit the question to show the complete document so people can reproduce the problem. You are loading two packages that define \AtBeginEnvironment (etoolbox and something else presumably) but it isn't really possible to help given no information. – David Carlisle Aug 04 '12 at 11:05
  • What do you mean, getting this error “on quick build”? Are you getting these while installing packages (in which case previous commenters are barking up the wrong tree), or while compiling your own LaTeX files? In any case, more detail is needed. – Harald Hanche-Olsen Aug 04 '12 at 11:49

2 Answers2

6

the problem is the etextools package, that contains many names that can easily lead to clashes, like discussed here: Re: The package 'etextools' is not compatible with biblatex

Marco Daniel
  • 95,681
0

I had the exact same issue, but this time in MikTeX, as opposed to Ubuntu. So I thought it might be beneficial to provide a solution for MikTeX too, since this is the first result when googling the error message.

The link provided by susis strolch no longer works, and I could not find it in the Web Archive either. I have googled the error message and found some German forum that advised to update MikTex packages in both user mode and administrator mode. Here are the steps I have performed:

  1. Run MikTeX console as Administrator, choose MikTex Administrator mode in the intro screen, check for updates and install updates several times until it shows no more updates
  2. Run MikTeX normally, select "Stay in MikTeX user mode", check for updates again and install several times until it shows no more updates
  3. Delete any auxiliary files in the document that you're tying to compile, such as aux, log, etc.
  4. Compile the doc again. Install any missing packages.

Steps 3 and 4 might need to be performed several times. If the error message persists, start over. Note, that after step 2 trying to compile it without clearing the aux files has yielded the following error: pdflatex: major issue: User/administrator updates are out-of-sync. Clearing the aux files and compiling again fixed it for me.

tasidonya
  • 23
  • 4