1

I would like to move the line numbers from the left side of the right column to its right side using lineno and multicol. Could you please help me how to reach this goal? My example is the following:

\documentclass{article}
\usepackage{lipsum}
\usepackage{lineno}
\usepackage{multicol}

\linenumbers

\title{test}

\begin{document}

\begin{multicols}{2}

\lipsum[1-1]

\end{multicols}

\end{document}
3

2 Answers 2

1

Mutlicol is balancing its output and doing trial runs with different column breaks (at least at the end. For this it uses a different output routine. lineno is also installing its own output routine (by basically sending each line one by one to the OR to attach line numbers. The two do not know about each other and so conflict. To lineno, what multicol does looks like a single long column, so the attachment ends up on one side and the later cutting into columns just makes this wrong. But it would also a problem, because it is not clear what should be done if there are more than 2 columns produced by multicol.

Basically with both together, all you can do right now is to make the column separation large enough to allow the numbers there and have them always on the left or always on the right.

3
  • Is there a way to make multicols and lineno know each other?
    – Y. zeng
    Jun 12 at 4:05
  • @Y.zeng in theory yes (TeX is Turing complete :-)) in practice no, not likely. It would require a lot of changes in both packages and I simply don't have the bandwidth to address that in the forceeable future. Jun 12 at 16:16
  • Okay. It is a pity.
    – Y. zeng
    Jun 13 at 2:31
0

enter image description here

\documentclass[twocolumn]{article}
\usepackage[switch]{lineno} % default option is 'left'
\usepackage{lipsum} % filler text

\begin{document}
    \linenumbers
    \lipsum[1-20]
\end{document}
3
  • Thanks, but I think that this is an answer to another question. Multicol does not behave like that twocolumn.
    – TobiR
    Feb 14, 2021 at 14:37
  • this is not using multicol. It is a solution for twocolumn. Feb 14, 2021 at 14:41
  • It is not balanced.
    – Y. zeng
    Jun 12 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .