%% test-twocolumn.tex
%% ==================
%% Typesetting test for every engine: with two columns, the pages are
%% the same as those of \twocolumn of the LaTeX kernel.
%%
%%   pdflatex test-twocolumn.tex
%%   pdflatex -jobname=test-twocolumn-off "\def\NCOLoff{1}\input test-twocolumn"
%% With \NCOLoff, ncolumn is not loaded.
%%
%% What is covered:
%%   * \maketitle and an abstract in twocolumn, running heads, a rule
%%     between the columns;
%%   * floats of one column (t, b, htbp), figure* and table* (t, p and
%%     the default), a float page;
%%   * footnotes, \marginpar, \enlargethispage;
%%   * \clearpage with a figure* that waits, \twocolumn[...],
%%     \twocolumn[...] with material that is lower than
%%     \dbltextfloatsep (one line), \onecolumn with a figure*,
%%     \twocolumn.
%%
%% What to check:
%%   * no error;
%%   * every page of the PDF is the same, pixel by pixel, with and
%%     without \NCOLoff (pdftoppm and cmp; see the Makefile).
\documentclass[twocolumn]{article}
\ifdefined\NCOLoff\else\usepackage{ncolumn}\fi
\usepackage{lipsum}
\setlength\columnseprule{.4pt}
\pagestyle{headings}
\title{Compatibility test}\author{A. U. Thor}\date{}
\begin{document}
\maketitle
\begin{abstract}\lipsum[1][1-4]\end{abstract}
\section{First}
\lipsum[1-3]\marginpar{note A}
\begin{figure}[t]\centering\rule{.8\linewidth}{2cm}\caption{column float}\end{figure}
\lipsum[5-7]\footnote{A footnote in some column.}
\begin{figure*}[t]\centering\rule{.8\linewidth}{3cm}\caption{full span top}\end{figure*}
\begin{table*}\centering\rule{.6\linewidth}{2cm}\caption{default table star}\end{table*}
\section{Second}
\lipsum[8-12]\footnote{Another footnote.}\marginpar{note B}
\begin{figure}[b]\centering\rule{.8\linewidth}{2cm}\caption{column float bottom}\end{figure}
\begin{figure*}[p]\centering\rule{.8\linewidth}{12cm}\caption{float page}\end{figure*}
\lipsum[13-22]
\begin{figure}[htbp]\centering\rule{.8\linewidth}{1cm}\caption{here}\end{figure}
\subsection{Sub}
\lipsum[23-30]
\begin{figure*}[t]\centering\rule{.8\linewidth}{3cm}\caption{before clearpage}\end{figure*}
\lipsum[31]
\clearpage
\section{Third}
\lipsum[32-36]
\twocolumn[{\section{Spanning head}\lipsum[1][1-3]\bigskip}]
\lipsum[37-45]
\enlargethispage{2\baselineskip}
\lipsum[46-52]
\twocolumn[\noindent A line across both columns.]
\lipsum[53-56]
\onecolumn
\section{One column}
\lipsum[1-3]
\begin{figure*}[t]\centering\rule{.8\linewidth}{3cm}\caption{star in onecolumn}\end{figure*}
\twocolumn
\lipsum[4-12]
\end{document}
