Page 1 of 1

Changing the numbering scheme for footnotes

Posted: 2018-11-02 05:27:59
by vwnisus
For some files I receive from another, the numbering scheme for footnotes is a, b, c, etc rather than 1, 2, 3.

A brief look at the Nisus manual indicates that it is necessary to change this in the Footnote style, which is easy to do manually.

But is it possible to change a the Footnote style with a macro?

Re: Changing the numbering scheme for footnotes

Posted: 2018-11-02 07:12:05
by phspaelti
Hello vw,
I don't see any way to change the list style directly with a macro, but what you could do is just replace it with a list style with the same name and your desired formatting. So this problem will look a bit like the one you were asking about before.

Here's one way to do that.

Code: Select all

$styledBit = '
1.	bit with list style applied' # This line should have the desired list style applied

# Get the list style from the text above
$attr = $styledBit.attributesAtIndex 2
$listStyle = $attr.listStyle

# Replace the list style in the target doc with the one from the macro
$doc = Document.active
$doc.addStyles $listStyle, 'replace'
I do have one caveat. When I tried the above macro, it worked, but the effect was not immediately obvious. The list style definition was changed to that of the replacing style, but the text in the document did not reflect the change. This seems to be a bug. Saving and reopening the document showed the replacing list style.

Re: Changing the numbering scheme for footnotes

Posted: 2018-11-02 08:25:43
by martin
Philip's suggestion to replace the style is a good one, but I don't think replacing any list styles will accomplish the original goal. To update the footnote reference numbering format (1,2,3 vs a,b,c) you want to instead replace the document's Note style. A macro like this should do the trick:

Code: Select all

$macroDoc = Document.macroSource
$noteStyle = $macroDoc.styleWithName("Footnote")

$doc = Document.active
$doc.addStyles($noteStyle, "replace")
You can see the macro obtains the Footnote style defined in the macro document itself, and adds it to the target document. Any customizations you've made to the Note style in the macro file will take effect in the target document.

Re: Changing the numbering scheme for footnotes

Posted: 2018-11-02 08:33:54
by phspaelti
Martin’s right. I seem to have misread the problem and tried to solve the wrong thing.

Re: Changing the numbering scheme for footnotes

Posted: 2018-11-02 08:39:30
by martin
phspaelti wrote: 2018-11-02 08:33:54 Martin’s right. I seem to have misread the problem and tried to solve the wrong thing.
All the same your macro code did turn up a bug. The list style really is very stubborn. It doesn't update or even show correctly in the Style View until you close and reopen the file. I'll file a bug, thank you!