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 took the STY files(elsarticle.zip) from the following link - http://www.elsevier.com/wps/find/authorsview.authors/elsarticle#models

I am using program package and I want to include the keywords in my paper. However, whenever I include the program package, I get an error.

! Extra }, or forgotten \endgroup.
\endkeyword ->\par \egroup                            
l.34 \end{keyword}

Here is my latex code, which I have stripped down to see if there was any error. If I remove the program package, it works perfectly fine. Or otherwise if I remove the Keywords part, then also it compiles just fine. However, I need both of them. Could anyone please help?

\journal{Microprocessors and Microsystems}

\title{Title of my report}

 keyword1 \sep keyword2 \sep keyword3 \sep keyword4

share|improve this question
up vote 2 down vote accepted

You can keep the syntax with the following trick for loading program:


Then you can still say


\title{Title of my report}

 keyword1 \sep keyword2 \sep keyword3 \sep keyword4


and use \keyword as defined by program in the body of your document. I think that the copy editors of the journal you're submitting the paper to will be happier if the syntax is not modified.

share|improve this answer

The keyword environment macros can be saved with a different name, before you load the program package, which defines its own \keyword macro:

\title{Title of my report}
  keyword1 \sep keyword2 \sep keyword3 \sep keyword4
share|improve this answer
Thanks a lot Stefan ! The answer worked perfectly fine. Just a doubt that the command keyword was modified by the program package? – knowledge_seeker Aug 28 '12 at 13:54
program.sty uses \keyword for markup, such as bold or uppercase. For example, from program.sty: ... \def\keyword##1{\mbox{\normalshape\bf\sf ##1}}% ... – Stefan Kottwitz Aug 28 '12 at 14:22

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.