2

How am I supposed to put line numbers in 2 columns, on the left side for the left one and on the right side for the right one?

I've read a pdf there's on internet but there's nothing, I've tried already with the next commands, but no one works, the line numbers appear always in the left or in the right side, but not both in a single page:

\documentclass[twocolumn]{article}
\usepackage[columnwise]{lineno}
\usepackage[switch]{lineno} 
\usepackage[switch,columnwise]{lineno}
CarLaTeX
  • 62,716
  • Are you sure that \usepackage[switch]{lineno} doesn't do exactly what you say you want to do? Incidentally, do please tell us which document class you use, and also what the \documentclass directive looks like. – Mico Jan 16 '18 at 04:38
  • 2
    @Mico In my language estrada means a place, where people sing aloud (scene). It may explain crying in the question. ;-) – Przemysław Scherwentke Jan 16 '18 at 04:41
  • 1
    @PrzemysławScherwentke Also in the nick name :) – CarLaTeX Jan 16 '18 at 06:00
  • I used \documentclass{article} and on the text I changed it on 2 columns and I tried with switch but it changed the line numbers from the left to the right on both columns, but what I want is the line numbers on the left for the left column and on the right for the right column. I used just to check that on [twocolumn] and the result is still the same... and Estrada is my last name and has nothing to do with crying jaja – GERMÁN ORLANDO CUEVA ESTRADA Jan 17 '18 at 05:17

1 Answers1

7

Assuming you're using a not-too-funky document class, i.e., one which implements the twocolumn option in a reasonably robust way, setting the option switch while loading lineno should achieve exactly what you say you need to achieve.

Do note that the lineno package does not recognize an option called columnwise. You should have been getting error messages when running either \usepackage[columnwise]{lineno} or \usepackage[switch,columnwise]{lineno}.

Here's an example. Note that the IEEEtran class employs twocolumn mode by default.

\documentclass{IEEEtran} % or any other document class that uses 'twocolumn' mode
\usepackage[switch]{lineno} % default option is 'left'
\usepackage{lipsum} % filler text

\begin{document}
\linenumbers
\lipsum[1-20]
\end{document}

enter image description here

Mico
  • 506,678
  • 1
    I always vote for Mico too. +1. Hi. – Sebastiano Jan 16 '18 at 09:01
  • 1
    @Mico it seems that this method does not number the lines for equations (in the proof produced by IEEE, equations are also numbered in the page margin) and also causes the author biographies to disappear. Any fixtures? – nanjun Feb 27 '19 at 21:36
  • 1
    @nanjun - I'm afraid I don't know what you mean by "causes the author biographies to disappear." If you use just equation environments for displayed equations and \[...\] for unnumbered displayed equations, the user guide of the lineno package suggests (a) setting the package option mathlines and (b) encasing numbered equation environments and unnumbered \[...\] displayed equations in linenomath environments. The user guide of the package is quite clear that the package's code unforunately doesn't work right with the displayed equation environments of the amsmath package. – Mico Feb 27 '19 at 22:24