Page 1 of 2

List formatting

Posted: 2014-07-29 17:32:21
by JBB
Is there a way to get a list/paragraph style formatted as follows?

I. Heading

i.e., the underlining does not apply to the number itself? I can't seem to figure this out. Thank you.

Re: List formatting

Posted: 2014-07-29 21:10:33
by phspaelti
The following kludge seems to work. Apply Underline Color > White to the list style that you are using for the automatic Heading number.
I was hoping that "No Underline" (applying Underline twice) might work, but it doesn't seem to. It would be nice if Nisus made the styles applied to list numbers visible in some way, and/or otherwise improved the handling of such styles.

Re: List formatting

Posted: 2014-07-29 23:08:22
by JBB
Thank you, and I agree: the numbering should be independently styled from the content. Hopefully an update will address this.

Re: List formatting

Posted: 2014-07-31 14:20:35
by martin
phspaelti wrote:I was hoping that "No Underline" (applying Underline twice) might work, but it doesn't seem to. It would be nice if Nisus made the styles applied to list numbers visible in some way, and/or otherwise improved the handling of such styles.
The problem is that the "no underline" attribute is culled immediately from the list level because NWP thinks it's unnecessary.

The situation is akin to selecting a character style, applying bold, and then toggling bold again: NWP removes the bold attribute. It would only leave "unbold" as an attribute if the style was overriding an ancestor style, eg: if Heading 1 enforces bold, but Heading 2 needs to turn off bold.

I'm not sure what the best solution here might be. Perhaps we could change NWP so it doesn't cull unnecessary attributes from styles after the user interacts with the stylesheet. That would leave it to the user to manually delete superfluous attributes from style definitions.

Re: List formatting

Posted: 2014-07-31 14:29:20
by JBB
So it's currently not possible to have list styling as:

1. Item 1

or

1. Item 1

But rather just:

1. Item 1

and

1. Item 1

Correct?

Re: List formatting

Posted: 2014-07-31 14:50:38
by martin
Yes, that is correct. To state it more specifically: one cannot have a list style remove attributes that are enforced through other means (eg: your paragraph style). However, you could have a list style add attributes, eg: the list style could make all your list items blue, even if the paragraph isn't blue.

Re: List formatting

Posted: 2014-07-31 19:06:24
by JBB
I see. I hope this can get solved as soon as possible.

Re: List formatting

Posted: 2014-11-30 23:20:08
by JBB
It's been a bit more than a year since the last update…hoping for some new features and fixes such as this soon.

Re: List formatting

Posted: 2015-03-17 17:34:57
by JBB
Just curious if this now can be done in 2.1?

Re: List formatting

Posted: 2015-03-18 17:07:41
by martin
Sorry, but this cannot be done in NWP version 2.1.

Re: List formatting

Posted: 2018-11-18 15:46:02
by JBB
How about 3.0?

Re: List formatting

Posted: 2018-11-19 12:04:50
by martin
I'm sorry but this is still not possible in Nisus Writer Pro 3. List styles cannot remove formatting enforced by your paragraph styles. Your best option is likely to fake this by having your list style enforce a white underline:

list.png
list.png (49.69 KiB) Viewed 18774 times

That will make it appear as if the list item has no underlining in the document text:

text.png
text.png (17.59 KiB) Viewed 18774 times

Re: List formatting

Posted: 2018-11-19 16:28:41
by phspaelti
One possibility is that of using a character style to remove formatting of this kind. While the following solution is a kludge it can be made to work. While a character style cannot directly be given a feature "Unbold" or "No Underline", the trick is to first define a "dummy" character style with all the features turned on. Then create a second style based on the first with all the features turned off. This character style can then be applied to the numbers in heading paragraphs. I provide a screenshot and a demonstration file below.
Turn Off Style Demo.png
Turn Off Style Demo.png (134.01 KiB) Viewed 18766 times

Re: List formatting

Posted: 2018-11-19 17:35:01
by phspaelti
And a short addition. To make inserting a Heading style more convenient one can use a macro like the following to insert the Heading style. Just attach the macro to the preferred shortcut for the heading style.

Code: Select all

Type Newline # Optional convenience
Paragraph Style:Heading 1
if Find '^.+\t', 'Eb'
  Character Style:Turn off
  Select End
  Character Style:Turn off
end
The macro (optionally) inserts a newline applies the Heading style, then checks to see if there is an inserted automatic number. If yes, it applies the "Turn off" character style and then places the cursor after the number and turns the character style back off, so further typing will proceed in the normal Heading style.

Re: List formatting

Posted: 2018-11-21 10:15:32
by martin
Those are good and clever ideas, thanks Philip!

To build off Philip's contributions, I'd probably adjust the macro a bit, so it's not so specific to any particular paragraph style. I could imagine myself wanting to turn off a list item's underline for other styles (eg: Heading 2, etc). I'll attach a macro that just turns off font face options (like underline) for the current paragraph's list item, no matter how the list item got there.