line numbersExact line spacing is the key

If you’ve ever had to put line num­bers in a word-pro­cess­ing doc­u­ment, you’ve faced the vex­ing prob­lem of keep­ing the line num­bers ver­ti­cally aligned with the text.

The se­cret is sim­ple: use ex­act line spac­ing with the line num­bers and the body text.

Here’s the ba­sic recipe, which you can ad­just to taste:

  1. Cre­ate a new doc­u­ment with one-inch margins.

  2. In the body of the doc­u­ment, in 12 point, type a para­graph of about five lines that looks like this:

    HH­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­HHH
    HH­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­HHH
    HH­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­HHH
    HH­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­HHH
    HH­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­H­HHH

  3. Let’s sup­pose you have to use dou­ble line spac­ing. In that case, you need to set your line spac­ing to ex­actly twice the point size. The H para­graph is set in 12 point, so se­lect the whole para­graph and change its line spac­ing to ex­actly 24 points. Don’t use theDou­ble” line spac­ing op­tion in your word proces­sor—de­spite the name, you’ll end up with line spac­ing larger than you want. (See Line spac­ing.)

  4. Open the doc­u­ment header for editing.

    How to open the document header

    Word In Print Layout view, dou­ble-click near the top of the page.

    Pages Skip this step. In­stead, click in the up­per-left cor­ner of the page so there’s no ac­tive text area.

    Cre­ate a tall, nar­row text box in the left mar­gin. (For those un­fa­mil­iar, a text box lets you put text in an ar­bi­trary po­si­tion on the page, out­side the flow of the main document.)

    How to insert a text box

    Word InsertText panel → Text BoxDraw Text Box. Click and drag on the page to cre­ate the box.

    Mac OS Word 2011 Document Elements tab → Text Elements panel → Text Box icon → Text Box. Click and drag on the page to cre­ate the box.

    Mac OS Word 2016 Insert tab → TextText BoxDraw Text Box. Click and drag on the page to cre­ate the box.

    Pages InsertText Box. A de­fault text box will ap­pear. Ad­just the size and po­si­tion as needed. Se­lect the text box and then se­lect ArrangeSection MastersMove Object to Section Master.

  5. In the text box, type your line num­bers. Use a hard line break be­tween each num­ber, not a car­riage re­turn, so the whole set of num­bers is one para­graph. Se­lect all the num­bers. As you did be­fore, use para­graph for­mat­ting to set the line spac­ing to ex­actly 24 points.

  6. Drag the text box near the H para­graph so it looks ap­prox­i­mately aligned.

  7. Zoom in closely to the top left cor­ner of the H para­graph so you can see the H para­graph on the right, and the first few num­bers in the text box on the left. Se­lect the text box and use the ar­rows on your key­board to move the text box ver­ti­cally un­til the bot­toms of the num­bers line up with the bot­toms of the lines in the H paragraph.

That’s it. You should now have line num­bers that re­peat on every page and that line up with the body text. Re­mem­ber—all the para­graphs in your doc­u­ment, in­clud­ing head­ings, must have line spac­ing of ex­actly 24 points and no space be­tween para­graphs. Oth­er­wise, the text will no longer align with the line numbers.

by the way
  • The line num­bers them­selves don’t have to be the same point size or font style as the body text. I like to make them smaller so they look more like a back­ground el­e­ment on the page. (See max­ims of page lay­out for the idea of con­trast­ing fore­grounds and back­grounds.) Make these ad­just­ments to the line num­bers be­fore align­ing them with the body text.