LaTeX Error: Environment keywords undefined

I am using a template for a conference and everything is OK, except for the "Keywords", This is strange, it didn't occur to me before. Usually I don't use a specific package for keywords. and the code is as: \begin{keywords} one, two, three, four \end{keywords}. However, at this time the error is like below:

LaTeX Error: Environment keywords undefined

I would be so glad if you help me with this problem. Mohammad.

• How about \keywords{one, two, three, four}? – Werner Oct 10 '13 at 17:30
• none of the standard article, report book classes define a keywords command or environment. The AMS classes such as amsart define a \keywords{...} command The class you are using doesn't define it. Do you think it should? Does the documentation for the conference say to use that syntax? – David Carlisle Oct 10 '13 at 17:35
• What \documentclass are you using? – Werner Oct 10 '13 at 17:37
• Should you maybe be using the elsarticle document class, which does provide an environment called keywords. – Mico Oct 10 '13 at 17:44
• All this confusion would have been quickly cleared up if you had just provided a minimal example (or here). Providing such an example really makes life easier for everyone. – jon Oct 10 '13 at 18:25

Define your own \keywords macro:

\documentclass{article}
\title{My title}
\author{My author}
\providecommand{\keywords}[1]{\textbf{\textit{Index terms---}} #1}
\begin{document}
\maketitle
\begin{abstract}
Lorem ipsum\ldots
\end{abstract}
\keywords{one, two, three, four}

\section{Introduction}
\end{document}


I use \providecommand instead of \newcommand to accommodate the possibility that the document class you're using has defined \keywords already. \providecommand will only define it if not already defined.

• Yeah, this one is also compiled successfully. Thank you so much. – Mohammad Tofigi Oct 10 '13 at 18:57
• @MohammadTofigi: If this answered your question, consider accepting it as such. – Werner Oct 10 '13 at 18:59
• @Werner- I tried to do it, but since my reputation score is only 4, its not accepting my "The answer is useful". I had an account here, but I couldn't recover it. How can I do the "accepting it as such"? – Mohammad Tofigi Oct 10 '13 at 19:04
• @MohammadTofigi: You can click the tick mark (if you can't vote) which should mark this question as accepted (just below the vote buttons). Voting on posts requires a certain amount of reputation. If you have multiple accounts that you've lost access to one, you should contact the StackExchange staff who can merge them together for you. – Werner Oct 10 '13 at 19:13
\listfiles
\documentclass{article}
\usepackage{spconf}

\begin{document}
foo
%
\begin{keywords}
One, two, three, four, five
\end{keywords}

\end{document}


my files from the logfile:

 *File List*
article.cls    2007/10/19 v1.4h Standard LaTeX document class
size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
spconf.sty
ot1ptm.fd    2001/06/04 font definitions for OT1/ptm.
***********

• Nooo, in a paper, after abstract, there are keywords in this shape: "index terms- ...", but in your example, it appears inside the article. – Mohammad Tofigi Oct 10 '13 at 18:06
• Again: then it is another document class! – user2478 Oct 10 '13 at 18:07
• but in the template the class is article. you can find the templates in this link: icassp2014.org/PaperKit.html#Templates – Mohammad Tofigi Oct 10 '13 at 18:09
• see my edited answer. You need the package spconf, available on that site – user2478 Oct 10 '13 at 18:22
• Then you do not saved the file in a correct place. For a first try put spconf.sty in the same directory as the example doc – user2478 Oct 10 '13 at 18:28