[Tex/LaTex] Incompatibility between ‘flushend’ and ‘lineno’ packages!

incompatibilityline-numberingmulticoltwo-column

I have observed when using flushend package to balance the references at the last page, if at the same time the package linenois loaded, the last page of reference will not be displayed. I have tested using \twocolumn document with default package option for lineno.

As soon as I remove either flushend or lineno package definition, the thing go well!
Is there any incompatibility between these two packages?

In the following MWE, the last page will be gone if you include the lineno package:

\documentclass{article}

\twocolumn
\usepackage{lipsum}
\usepackage{flushend}
\usepackage[switch]{lineno}
\linenumbers

\begin{document}

\lipsum

\end{document}

EDIT:
Is there any other way I can balance the columns at the last page without using flushend and balance and multicol packages? multicol with \twocolum will not result in nice output, if I use \onecolum before \begin{multicols} it will create new page, which I dont want.

Best Answer

Unfortunately, as you observe flushend does not work well with lineno. On the other hand, the lineno package does include specific code to cope with multicol. So I suggest you use mulitcol for the whole document insead of \twocolumn. To allow space for the line numbers, you should increase the space between the columns by setting \columnsep:

Sample output

\documentclass{article}

\usepackage{lipsum}
\usepackage{multicol}
\usepackage{lineno}
\linenumbers

\setlength{\columnsep}{4em}
\begin{document}

\begin{multicols}{2}
  \lipsum
\end{multicols}

\end{document}
Related Question