TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting below error in Ubuntu 10.04, texlive 2010 I do not get any such errors and get pdf output in my 2011 macbook running texlive 2010.

! Undefined control sequence.
l.44 \AtBeginEnvironment
! Undefined control sequence.
l.45 \AtBeginEnvironment
! Undefined control sequence.
l.46 \AtBeginEnvironment


When I press enter it processes the file and gives the pdf output I am attaching the screenshot of the first page as well. The first page shows "Verse Enumerate and longtable" I could not explain why its does this. I would appreciate your help. enter image description here

second page onwards the document is as I wanted. Here are the two documents, one contants all the required packages (AK.tex) and 2_AK_034.tex has actual verse and its explanation.

Here is the file with all the packages https://docs.google.com/leaf?id=0B2ORRM7gQAXeYmY0MWVhZDAtMDU3My00OTNkLTliMzAtNDEwOWY4YzBjZjcw&hl=en_US

Here is the actual tex file that contains all the verse and explanation. https://docs.google.com/leaf?id=0B2ORRM7gQAXeYjZlYTVmMDEtNTNjZC00NGU3LWEzOGYtNTFkMDUyZGVmMDky&hl=en_US

share|improve this question
up vote 2 down vote accepted

The error says that \AtBeginEnvironment is undefined. This command is defined in the etoolbox package. So ensure that this package is loaded. Consider to install that package if it's missing, or update it if it's not the current version. The most recent version of etoolbox is 2.1.

share|improve this answer
In fact, it formed part of the most recent addition to etoolbox (2011-01-03). – Werner Sep 4 '11 at 15:58
I would appreciate if you can tell me how can I update etoolbox package? Also how can I check if I have latest etoolbox package. – Aku Sep 4 '11 at 17:17
@Aku: On the command line (in a terminal window) type kpsewhich etoolbox.sty to find the directory of the package. There should be two files, etoolbox.sty and etoolbox.def. The version is written in the beginning of those files. Also, the version is printed to the .log file of your document. You can download the package from CTAN and replace it there, or you could install it to your personal TeX home directory. Package installation has often been described on the site, search for it or post a new question if necessary. – Stefan Kottwitz Sep 4 '11 at 17:31
@Stefan-thanks for your help, it worked, I had to replace it on my local directory. – Aku Sep 4 '11 at 18:12
@Aku: it would be great if you would mark the answer as "accepted" then. – Stefan Kottwitz Sep 12 '11 at 21:24

The \AtBeginEnvironment has been added to etoolbox version 2.1 (Jan. 3, 2011). Unfortunately, it's impossible now to update TeX Live 2010: either do a manual install or advance to TeX Live 2011.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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