I have this code:
%Abstracts
\newcommand{\@spanishabstractname}{{\bfseries Resumen}}
\newsavebox\@sabstract
\newenvironment{spanishabstract}{%
\lrbox\@sabstract\minipage{1\textwidth}\selectlanguage{spanish}\itshape}%
{\endminipage\endlrbox\normalfont}
\newcommand{\@englishabstractname}{{\bfseries Abstract}}
\newsavebox\@eabstract
\newenvironment{englishabstract}{%
\lrbox\@eabstract\minipage{1\textwidth}\selectlanguage{english}\itshape}%
{\endminipage\endlrbox\normalfont}
%Making Title
\newcommand{\maketitle}{%
\twocolumn[%
{\centering \@spanishabstractname\par}\linespace
\noindent\usebox{\@sabstract}\par\linespace
\@skeyw\par\onecmskip
{\centering \@englishabstractname\par}\linespace
\noindent\usebox{\@eabstract}\par\linespace
\@ekeyw
]
}
But when I use the command \maketitle in the document, not shows the boxes \@sabstract and \@eabstract, as follows.

If I put the code definition of \maketitle in a \AtEndDocument:
\AtEndDocument{%
\twocolumn[%
{\centering \@spanishabstractname\par}\linespace
\noindent\usebox{\@sabstract}\par\linespace
\@skeyw\par\onecmskip
{\centering \@englishabstractname\par}\linespace
\noindent\usebox{\@eabstract}\par\linespace
\@ekeyw
]
}
Everything works perfectly!

How I can fix this? Why wrong? Thanks!

\begin{lrbox}and\end{lrbox}it doesn't work. – osjerick May 19 '12 at 20:27