Keeping line numbers in tact


W

W. eWatson

Win7, Word 2007l

I have a 1000 line docx that I've inserted line numbers. I would like to
retain the numbers but insert comments between lines without them
getting numbered. Is it possible?
 
Ad

Advertisements

D

Daddy

There might be better ways, but this comes to mind for right now:
"Insert" ribbon > "Text" group > "Text Box" gallery.

Daddy
 
S

Suzanne S. Barnhill

Assuming that the comments are in a separate paragraph, on the Line and Page
Breaks tab of the Paragraph dialog, check the box for "Suppress line
numbering." The most efficient way to handle this is to use a distinct
Comment style that includes this formatting.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
W

W. eWatson

Assuming that the comments are in a separate paragraph, on the Line and
Page Breaks tab of the Paragraph dialog, check the box for "Suppress
line numbering." The most efficient way to handle this is to use a
distinct Comment style that includes this formatting.
Don't see supress ... in Help.

It's actually a listing of computer program stmts:

1 THDOT=6.28318531/86164.
This loop calculates ...
2 DO 12 I=1,2
3 X(I)=R(I)*DCOS(THET(I))*DCOS(PHIP(I))
4 Y(I)=R(I)*DSIN(THET(I))*DCOS(PHIP(I))
5 Z(I)=R(I)*DSIN(PHIP(I))
6 XPR(I)=(-R(I))*THDOT*DSIN(THET(I))*DCOS(PHIP(I))
7 YPR(I)= R(I) *THDOT*DCOS(THET(I))*DCOS(PHIP(I))
8 ZPR(I)=0.0

I might want to put a comment between 1 and 2 without disturbing the
numbers.

While I'm at it, when I'm searching this document (it's primary use,
except for having line references for external comments), sometimes the
window will look as though there's a film over it. I can't change
anything in the text. What's that about?
 
S

Suzanne S. Barnhill

What do you mean you "Don't see supress ... in Help." I've told you exactly
where to find it: on the Line and Page Breaks tab of the Paragraph dialog.
To get to that dialog, right-click in any paragraph and choose Paragraph. If
you're writing (or transcribing) code, most likely each line of code is a
separate paragraph, so that won't be an issue. If you want the comment to be
indented, you can also include the indent in the style you apply to
comments.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
W

W. eWatson

What do you mean you "Don't see suppress ... in Help." I've told you
exactly where to find it: on the Line and Page Breaks tab of the
Paragraph dialog. To get to that dialog, right-click in any paragraph
and choose Paragraph. If you're writing (or transcribing) code, most
likely each line of code is a separate paragraph, so that won't be an
issue. If you want the comment to be indented, you can also include the
indent in the style you apply to comments.
Under Page Layout, there's paragraph tab. In it are Indent and Spacing.
No Suppress, so I tried Help.

If I click on a Line, I see Paragraph in the menu. Clicking on it gives
me a dialog. On the Line and Page Breaks tab, there is a box that says
Suppress line numbers. I click on it. Then OK. All it does is remove the
line number.

If I try to put a line/paragraph between two lines, it gives it a line
number. I don't want a line number there. I want to put a comment there
about the next line. I want line numbers to stay put on their original
line/paragraph. Just line my example above.
 
Ad

Advertisements

S

Suzanne S. Barnhill

You are not listening. When I say "Paragraph dialog," that is what I mean.
In Word 2007/2010, you can get to the Paragraph dialog by clicking the
dialog launcher (the little arrow in the bottom right corner) in the
Paragraph group on the Home tab.

The option to "Suppress line numbers" does just that; it skips numbering for
a given paragraph. When you have a comment that you don't want numbered, you
use that setting. It does not affect numbering for any other paragraphs. If
you incorporate this setting in a paragraph style and apply that to your
comments, then you will get the effect you want.

In the example that you gave:

1 THDOT=6.28318531/86164.
This loop calculates ...
2 DO 12 I=1,2
3 X(I)=R(I)*DCOS(THET(I))*DCOS(PHIP(I))
4 Y(I)=R(I)*DSIN(THET(I))*DCOS(PHIP(I))
5 Z(I)=R(I)*DSIN(PHIP(I))
6 XPR(I)=(-R(I))*THDOT*DSIN(THET(I))*DCOS(PHIP(I))
7 YPR(I)= R(I) *THDOT*DCOS(THET(I))*DCOS(PHIP(I))
8 ZPR(I)=0.0

You would select the paragraph "This loop calculates..." and use the
"Suppress line numbers" setting for just that paragraph. You must have a
paragraph break (not a line break) at the end of each line of the code.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
W

W. eWatson

You are not listening. When I say "Paragraph dialog," that is what I
mean. In Word 2007/2010, you can get to the Paragraph dialog by clicking
the dialog launcher (the little arrow in the bottom right corner) in the
Paragraph group on the Home tab.
Fine. That gives me exactly the same thing as if I do it on a line.
The option to "Suppress line numbers" does just that; it skips numbering
for a given paragraph. When you have a comment that you don't want
I would think I get a paragraph if I have the cursor at the end of a
line and press the Enter key. How does one get a line break? Ctrl-Enter?
numbered, you use that setting. It does not affect numbering for any
other paragraphs. If you incorporate this setting in a paragraph style
and apply that to your comments, then you will get the effect you want.

In the example that you gave:

1 THDOT=6.28318531/86164.
This loop calculates ...
2 DO 12 I=1,2
3 X(I)=R(I)*DCOS(THET(I))*DCOS(PHIP(I))
4 Y(I)=R(I)*DSIN(THET(I))*DCOS(PHIP(I))
5 Z(I)=R(I)*DSIN(PHIP(I))
6 XPR(I)=(-R(I))*THDOT*DSIN(THET(I))*DCOS(PHIP(I))
7 YPR(I)= R(I) *THDOT*DCOS(THET(I))*DCOS(PHIP(I))
8 ZPR(I)=0.0

You would select the paragraph "This loop calculates..." and use the
"Suppress line numbers" setting for just that paragraph. You must have a
paragraph break (not a line break) at the end of each line of the code.
If I have
10 abc = 3.2
20 xyz =40
and position the cursor after 3.2 and press the return key, then I get
10 abc = 3.2
20 hello there
30 xyz = 40
There is no suppression unless, I now use either "Supress" tab on line
20, which then leaves me with
10 abc = 123
hello there
30 xyz = 40
I want
20 xyz = 40

I think I'm looking for an operation like "Maintain line numbers on line
as part of a paragraph". Maybe if I copy the "paragraphs" all into a txt
doc, the line numbers will stay with each line. I think I tried that
once, and it didn't work. Well, if I can't get this to work in Word,
I'll write a computer program that takes the txt file version of these
lines and numbers the lines, and then put it all back into Word.

Putting comments into Word allows me the ability to use math symbols in
the comments. Unchanging line numbers allow consistency in references to
specific lines.
 
Ad

Advertisements

S

Suzanne S. Barnhill

Are you sure you're using line numbers and not paragraph numbers? The line
numbering feature is found on the Layout tab of Page Setup. When it is
enabled, every line is numbered unless numbering is suppressed. A line break
is inserted via Shift+Enter (Ctrl+Enter gives a page break). Pressing Enter
does end a paragraph. If the comment is a separate paragraph from the lines
of code, you can suppress line numbering for just its paragraph.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top