NOT numbering blank lines?

Everything related to our flagship word processor.
Post Reply
ncdobson
Posts: 25
Joined: 2004-09-17 12:20:27

NOT numbering blank lines?

Post by ncdobson »

Is it possible to have only lines with text numbered and leave blank space un-numbered?

TIA,

Nick D.
User avatar
mrennie
Posts: 173
Joined: 2004-11-10 07:31:31

Re: NOT numbering blank lines?

Post by mrennie »

Hi Nick,

the solution to your problem is to stop using multiple returns to create blank space. If you want to create a blank space after a paragraph, set a "Space after" in the Paragraph palette. Furthermore, you can make this "Space after" setting part of the style definition. If you use "Space after", you do not create blank lines, which means that you do not get line numbers, either.

Hope this helps.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: NOT numbering blank lines?

Post by martin »

There's no option in NWP to skip numbering empty paragraphs. So mrennie's idea is the best solution, use the before/after paragraph spacing to remove the need for hard blank lines/paragraphs.
User avatar
mrennie
Posts: 173
Joined: 2004-11-10 07:31:31

Re: NOT numbering blank lines?

Post by mrennie »

Which leads me to a feature request: I would love to be able to have "suppress line numbering" as part of a style definition. This option exists in Microsoft Word, and it is particularly useful. If I want to prepare a handout, line numbering usually starts with the first line of the body text, i.e. the title is not included. If I had the option to have the Title style suppress line numbering, I could simply apply line numbering. Right now, I need to add a continuous section break after the title to create a new section for the line numbering. This is surprising, actually, given how easy-to-use and accessible Nisus Writer Pro normally is.
User avatar
Matze
Posts: 170
Joined: 2004-12-14 07:54:49
Location: Düsseldorf Germany
Contact:

Re: NOT numbering blank lines?

Post by Matze »

In old NW you could select paragraphs noncontigly and let NW number only those paragraphs. Can one do this with NWP?
feat
Posts: 105
Joined: 2004-01-29 04:17:10
Location: Paris, FR

Re: NOT numbering blank lines?

Post by feat »

I'm using NWP to write programming manuals, and there are languages, like Python, that do require blank lines as part of the syntax: obviously, changing the AB spacing is not an option, since those blank lines have to be numbered like the rest.
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: NOT numbering blank lines?

Post by Kino »

Matze wrote:In old NW you could select paragraphs noncontigly and let NW number only those paragraphs. Can one do this with NWP?
IIRC and AFAIK, only the line number is available in NW Classic. Do you speak of macros written for that purpose? As of the version 1.2, NW Pro Macro language is much more powerful than that of NW Classic although there are still some missing commands, e.g. math functions, PageNum, PageLineNum, etc. Anyway, now we can do something like this.

Code: Select all

### Number Paragraphs in selections ###

# Put paragraph numbers of the format "$prefix + number + $suffix" at the top of each paragraph in selection(s) excluding empty paragraphs.

$prefix = "["
$suffix = "]\t"

Require Pro Version 1.2

$doc = Document.active
if $doc == undefined  # if there is no open document...
	exit
end
$text = $doc.text

$numFound = Find All in Selection '^[^\n\f]', 'E'
if ! $numFound
	exit 'No paragraph start found (nothing selected, perhaps), exit...'
end

$sels = $doc.textSelections
Select End  # deselect

$i = $sels.count - 1
while $i >= 0
	if $sels[$i].text != $text  # then, this selection is not in the document body
		$sels.removeValueAtIndex $i  # remove this selection from $sels
	end
	$i -= 1
end

$n = $sels.count
foreach $sel in reversed $sels
	$paraNium = Cast to String "$prefix$n$suffix"
	$text.insertAtIndex $sel.location, $paraNium
	$n -= 1
end

### end of macro ###
However, if numbers within the text area are sufficient, probably you don't need such a macro in most of cases. NW Pro enables you to control show/hide line/paragraph numbers per section. And you can use a number list style with "Continue numbering across document content" enabled.
Post Reply