I have a simple document class adapted from article
, but independent (.cls
file). The document is twocolumn
, but when I add a title with
\newcommand\maketitle{\begin{titlepage}%
\begin{center}%
{\LARGE \@title \par}%
\end{center}\par
\end{titlepage}%
}
\newenvironment{titlepage}
{%
\@restonecoltrue\onecolumn
\thispagestyle{empty}%
\setcounter{page}\@ne
}%
This makes the entire document onecolumn
. How should I set the titlepage
environment to be onecolumn
without affecting the entire document?
Best Answer
The definition of the
titlepage
environment inarticle.cls
depends on whether compatibility mode is on/off, but both variants includein the code to be executed at the end of the environment. In your version of
titlepage
, you simply switch to\onecolumn
(which makes\@restonecoltrue
superfluous) at the start of the environment, so you need to switch back to\twocolumn
at the end. I suggest, however, to simply use the original non-compatibility variant oftitlepage
, as this will make your custom class also work inonecolumn
mode.