# How to show linenumbers for IEEE proof as one column?

The following is the following but I want the text is in one column, not in two:

## Reproduction of gap between linenumbers

\documentclass{article} % [conference]{IEEEtran}

\usepackage[mathlines]{lineno}
\usepackage{textcomp}
\usepackage{siunitx}

\usepackage{mathtools, amssymb}
\usepackage{unicode-math}

\linenumbers
\begin{document}

\subsection*{Electron Avalanche in GEM Foils}
There are several simplifications made in simulating the electron avalanche in GEM foils.
There is only multiplication from electron collision.
There is no electron lost to negative ion formation.
The space charge effects are negligible.
%
%
$$Q = n_{0} e M$$
%
where $e$ is the electron change, and $M$ is the average \emph{gas multiplication factor} that characterizes the counter operation.

\end{document}


gives

How can you have those small numbers at the side for the review at one column?

You can use lineno package

\documentclass[conference]{IEEEtran}
\usepackage{lipsum}
\usepackage[mathlines,switch]{lineno}

\title{The title}
\author{The authors}
\linenumbers
\begin{document}
\maketitle
\lipsum[1]
$x=y$
\lipsum
\end{document}


The package options mathlines puts numbers to equations and switch puts the numbers in the outer margin.

For one column, just switch to article class.

\documentclass{article}
\usepackage{lipsum}
\usepackage[mathlines]{lineno}

\title{The title}
\author{The authors}
\linenumbers
\begin{document}
\maketitle
\lipsum[1]
$x=y$
\lipsum
\end{document}


# Edit

To answer for the comment, you have to load lineno after mathtools so that the definitions of equation environments (made by linenopackage) are not over written by mathtools.

\documentclass{article} % [conference]{IEEEtran}

\usepackage{textcomp}
\usepackage{siunitx}

\usepackage{mathtools, amssymb}
\usepackage[mathlines]{lineno}   %<---- here
\usepackage{unicode-math}

\linenumbers
\begin{document}

\subsection*{Electron Avalanche in GEM Foils}
There are several simplifications made in simulating the electron avalanche in GEM foils.
There is only multiplication from electron collision.
There is no electron lost to negative ion formation.
The space charge effects are negligible.
%
%
$$Q = n_{0} e M$$
%
where $e$ is the electron change, and $M$ is the average \emph{gas multiplication factor} that characterizes the counter operation.

\end{document}


• @Masi I am not able to reproduce the result. Can you post the code that does this? – user11232 Sep 8 '15 at 23:04
• @Masi: please see the edit. – user11232 Sep 9 '15 at 5:43

Some preview of answers about Why doesn't lineno number a paragraph when it is followed by an “align” equation environment without a space?:

## [#1] Some gaps of lines and Harish's answer

Both answer lead to surprising gaps in different contents. Harish's answer works in simple Mathematical environments where no new declarations is made. The former's code reproduced here:

\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}}%
\AtBeginDocument{%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}


which skips some lines of big files, especially with Math, for example:

## #2 Numbers everything but get clustered sometimes

\newcommand*\patchAmsMathEnvironmentForLineno[1]{%
\expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname
\expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname
\renewenvironment{#1}%
{\linenomath\csname old#1\endcsname}%
{\csname oldend#1\endcsname\endlinenomath}}%
\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{%
\patchAmsMathEnvironmentForLineno{#1}%
\patchAmsMathEnvironmentForLineno{#1*}}%
\AtBeginDocument{%
\patchBothAmsMathEnvironmentsForLineno{equation}%
\patchBothAmsMathEnvironmentsForLineno{align}%
\patchBothAmsMathEnvironmentsForLineno{flalign}%
\patchBothAmsMathEnvironmentsForLineno{alignat}%
\patchBothAmsMathEnvironmentsForLineno{gather}%
\patchBothAmsMathEnvironmentsForLineno{multline}%
}


giving sometimes clusters like