[texhax] twocolumn with lineno per page centered and only once for both columns

Uwe Lueck uwe.lueck at web.de
Wed Dec 14 09:27:02 CET 2011

"Dieter Studer" <dieterstuder at yahoo.com> on 13.12.2011 wrote:

> Dear support,

Why don't you ask the package authors?

On the other hand, I almost never try tricks with lineno
and so must RTFM myself for each request.

> I've been searching some info for a couple of hours now,
> but I haven't been able to find anything in the multicol or
> lineno documentation nor on-line
> (except for another person asking the same question
> without getting an answer).

Where was that?

> I would like to use a twocolumn layout (preferably with multicol,
> but [twocolumn] would be fine, too)

Although Stephan applied a trick to achieve compatibility
with multicol, a little trying after another request indicated
that multicol columns cannot be numbered with lineno.

I have received a little grant from the TeX Development Fund
for updating lineno and something more, let's see what I can 
do with this (when I am not busy with customers).

> and I would like to number the lines in the gap between the columns.
> For both the left column and the right column I would like to use
> the same line number (or alternatively only use the line number
> for the left column and discard/suppress the line number for the
> right column). The line number ought to start over on each page (pagewise).
> If it would work with memoir and XeLaTeX that would be extra nice.

lineno at least works with XeXaTeX in general, and XeLaTeX
should not restrict lineno's functionality. However, a problem
with polyglossia has been reported recently.

> [page1]
> Line1  1  Line5
> Line2  2  Line6
> Line3  3  Line7
> Line4  4  Line8
> [page2]
> Line09  1  Line13
> Line10  2  Line14
> Line11  3  Line15
> Line12  4  Line16
> etc.
> I know this is a little extravagant, but I would like to do this
> for backwards compatibility with a publication published in Word.

Did Word number the lines?

> Do you think this is possible at all (with my very limited TeX-skills)?
> Thanks for any kind of advice (and if it's RTFM, as long as you
> can give me a hint as to which manual).

An idea (I may try myself a little later):
1. Use packge options [columnwise,switch*] (unfortunately, package options
seem not to be dealt with in a salient way in TFM, see Section 6.4),
or use \columnwiselinenumbers and \switchlinenumbers*.
The order of the commands may matter, those tricks are too much for me
right now. Without the dirty trick following, such tricks should produce
right-hand line numbers for the left-hand column and left-hand line numbers
for the right-hand column.
2. Dirty trick: \let\makeLineNumberLeft\relax.
3. Adjust \linenumbersep for "centering" the line numbers.

Hope that helps

 -- Uwe.

More information about the texhax mailing list