Incremental margin numbers in legal texts / Randnummern

Get help using and writing Nisus Writer Pro macros.
Post Reply
Þorvarður
Posts: 346
Joined: 2012-12-19 05:02:52

Incremental margin numbers in legal texts / Randnummern

Post by Þorvarður »

German legal texts often require marginalia in the form of the so called Randnummern (margin numbers.) Randnummern are serial numbers that are cited and allow people to refer to exact places in the text. They are used in textbooks, legal commentaries, administrative regulations, court decisions, etc.

The other day, a Mellel user asked me whether this can be done in Nisus. If yes, he said, he would switch to NWP.

I think using Text Boxes with an incremental list style content seems the way to go. That's the easy part. But what makes this tricky is that on odd pages the numbers must appear on the LEFT margin whereas on even pages they must appear on the RIGHT margin.

1.png
1.png (214.91 KiB) Viewed 2222 times

If we have a book of 300 pages, we may be talking about 500 Randnummern here or more. Entering all the numbers manually as we plod along writing the book is not a problem. The problem I see is the following: if we delete or move around parts of the text we end up having numbers (text boxes) on a wrong margin because the text boxes will retain their former marginal position. The same applies, of course, if we drag headings up or down in the Navigator.

Considering this problem, would it perhaps be better to first insert a place holder at the beginning of each paragraph where we want a text box to appear later, and when we have finished the whole document we use a macro to add numbered text boxes on the left and right side, depending on whether we are on an odd or an even page?

Is it possible to write a macro for this purpose?

User avatar
phspaelti
Posts: 1201
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Incremental margin numbers in legal texts / Randnummern

Post by phspaelti »

How about this:
Attachments
Randnummern.nwm
(6.59 KiB) Downloaded 69 times
philip

User avatar
phspaelti
Posts: 1201
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Incremental margin numbers in legal texts / Randnummern

Post by phspaelti »

Just to be clear. This macro is best run when you are finished. If you need to edit after that, remove the numbers (except for the first one) and run again.
It numbers only paragraphs in the the Normal style. Adjust the various details as necessary.
philip

Þorvarður
Posts: 346
Joined: 2012-12-19 05:02:52

Re: Incremental margin numbers in legal texts / Randnummern

Post by Þorvarður »

This seems to work very well if the sample box is set to "float with paragraph."

Is it possible to add something to the macro in order to prevent numbers to appear where empty paragraphs are?
1.png
1.png (189.41 KiB) Viewed 2199 times

Apparently, not all paragraphs should have a number. If the user inserts a place holder at the beginning of each paragraph where he wants a text box to appear later, it would be great to have a macro which replaces all the place holders with text boxes when final editing of the document has been made.
Last edited by Þorvarður on 2021-05-31 09:37:58, edited 1 time in total.

User avatar
phspaelti
Posts: 1201
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Incremental margin numbers in legal texts / Randnummern

Post by phspaelti »

Sure you can do all kinds of things.
This was more intended as a proof of concept than a worked out solution.

If you look in the macro you can see that the biggest part is taken up by working out a list of paragraphs for where to insert. I wasn't going to spend too much time on this stuff. Obviously one should have checked paragraphs for actual content and skip the ones that were empty. Depending on how one wants to use this, one could use other criteria, including labelling the paragraphs by hand.

One problem with inserting temporary markers into the paragraph is that the macro would presumably remove these when run. In that case running the macro a second time wouldn't be possible, or it might require some more complex scheme that updates already inserted boxes etc.

In the larger scheme of things I really would recommend using the built-in line/paragraph numbering feature. But it's also clear that in the current NWP some of the features that you are looking for are not present; such as alternating sides, or the ability to format the numbers with brackets, etc., and probably also not the ability to skip headings or empty paragraphs.

PS: I would generally recommend not using empty paragraphs, and instead just use extra spacing between paragraphs.
philip

Þorvarður
Posts: 346
Joined: 2012-12-19 05:02:52

Re: Incremental margin numbers in legal texts / Randnummern

Post by Þorvarður »

Thank you Philip for your thoughts and suggestions regarding how to refine the macro.
One problem with inserting temporary markers into the paragraph is that the macro would presumably remove these when run. In that case running the macro a second time wouldn't be possible
I think they should indeed be removed when the text boxes are inserted because their only purpose was to tell the macro where the text boxes should be placed. If markers are used, it should not be necessary to run the macro more than once anyhow because editing the document is already finished. Yet, if a text box is later added or deleted the other numbers can easily be updated just by selecting a single number in a text box, cut it and then paste it in again. That will automatically bring all the other numbers into a correct order because the numbers were created as an incremental list style. So I see no need to run the macro a second time.

Post Reply