In the file with two columns by twocolumn options, the last page can't be balanced by balance package if lineno package works.
\documentclass[twocolumn]{book}
\usepackage{lipsum,balance}
\usepackage[switch]{lineno}
\begin{document}
\twocolumn[
\begin{@twocolumnfalse}
\chapter{the first}
\end{@twocolumnfalse}
]
\linenumbers
\lipsum[1-8]
balabala
\balance
\end{document}
produces:
Obvious, the last page is not balanced. So, how to balance the last page based on lineno working.
As pbalance would work in sometime, but when there are figures with figure* parameter, pbalance would be very difficult to be adjusted well.
\documentclass[twocolumn]{book}
\usepackage{lipsum,pbalance,stfloats,graphicx}
\usepackage[switch]{lineno}
%\shrinkLastPage{2.2in}
\begin{document}
\twocolumn[
\begin{@twocolumnfalse}
\chapter{the first}
\end{@twocolumnfalse}
]
\linenumbers
\lipsum[1]
\par
\begin{figure}[b]
\centering
\includegraphics[width=0.4\textwidth]{example-image-a}
\end{figure}
\lipsum[2-8]
balabala
\end{document}
produces:




\balanceto work it needs to install a new output routine;linenoalso does its numbering by changing the output routine. The two are incompatible. You can see this immediately by thinking about the question of "where should the line number appear?" Forlinenoto decide whether to put the number on the left or on the right, it needs to know whether the text is in the left or the right column. Butbalanceneeds to set the text first before deciding ... – Willie Wong Jun 12 '23 at 13:53linenoattaches the line numbers as they are set. So you end up with either lack of balancing, or what happens when you try to combinelinenoandmulticol(where the line numbers always show up on the same side). // So the answer is: "they can't work together, unless someone puts in the effort to write some code to makebalancework withlinenoexplicitly." – Willie Wong Jun 12 '23 at 14:01\newpageto force a column switch. I don't know about any "automatic" solutions to this problem. – Willie Wong Jun 12 '23 at 14:13\newpageyou need to locally\setlength\parfillskip{0pt}, and after the\newpageyou need to\noindent.) – Willie Wong Jun 12 '23 at 14:16