# Incompatibility between 'flushend' and 'lineno' packages!

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.

• Please (always) make a small example document that shows the problem. – David Carlisle Oct 7 '13 at 23:23
• Yes, they appear to be incompatible. Both are meddling with output routines. – Andrew Swann Oct 8 '13 at 7:56
• Is there any other way I can balance the columns at the last page without using flushend and balance packages? – M.Reza Oct 8 '13 at 19:50

## 1 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:

\documentclass{article}

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

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

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

\end{document}

• Thank you for the reply Andrew. There are several reasons I prefare \twocolumn or multicol. table and figure won't display correctly and need modification. Moreover, the document won't look good after changing to multicol which will take quiet a while to fix every part. BTW, is there any way to switch to \onecolumn without incurring a page break?! – M.Reza Oct 10 '13 at 7:35
• I understand. A command \myonec defined as \makeatletter \def\myonec{\global\columnwidth\textwidth \global\hsize\columnwidth \global\linewidth\columnwidth \global\@twocolumnfalse \col@number \@ne \@floatplacement} \makeatother will switch to one column without page break, but behaves badly with respect to floats, and I don't see how it helps your situation. – Andrew Swann Oct 10 '13 at 9:20