Keywords and MSC Classification in LaTeX article class

In the amsart document class, one has the commands \keywords{foo} and \subjclass{foo}. I was wondering, how does one make similar commands for the standard LaTeX article class?

-

The amsart commands are defined to create commands \@keywords and \@subjclass, which are then used to typeset footers in the \maketitle command. You could hack the \maketitle command provided by the article class (or even better, redefine it in a class of your own) to provide similar functionality, but it's easier (and sloppier) to hack the \@title command:

\makeatletter
\newcommand{\subjclass}[2][1991]{%
\let\@oldtitle\@title%
\gdef\@title{\@oldtitle\footnotetext{#1 \emph{Mathematics subject classification.} #2}}%
}
\newcommand{\keywords}[1]{%
\let\@@oldtitle\@title%
\gdef\@title{\@@oldtitle\footnotetext{\emph{Key words and phrases.} #1.}}%
}
\makeatother

These definitions are very hacky and likely require correct ordering of things (and as I said you really should either hack the \maketitle command properly or extend article with your own class). Most importantly, use \keyword and \subject after \title. But it works.

-
You should use \newcommand instead of \gdef whenever you can. –  Martin Schröder Jul 22 '11 at 10:16
I tried to use this, there is one problem: accented letters like ó or ñ do not work within these commands, even when things are set up so they work well in the rest of the document! –  kjetil b halvorsen Nov 22 '12 at 20:29