Equation numbering methods.
-
- Posts: 25
- Joined: 2007-10-31 05:58:12
Equation numbering methods.
I have many technical documents from classic Nisus that have many equations. NWP has changed the method of equation numbering to using lists. Since I needed the list number to be centered with respect to the equation (which are often several lines) I inserted a single row table with two columns. The right-most column is 1/2 inch in width and contains the list number. The remaining table column contains the equation. This seams to work well enough. However I consider it a poor replacement of NWP method.
My question is does anyone have a nicer/better/more efficient method to this problem?
When using the list number and inserting it to the right-hand side as in referred journals I can not insert the equation graphic to its left unless I change it from "inline with text" to "moves with paragraph". While this works it tends to cause formatting problems when I am adding CRs.
Thanks
Lorenz H. Menke, Jr.
My question is does anyone have a nicer/better/more efficient method to this problem?
When using the list number and inserting it to the right-hand side as in referred journals I can not insert the equation graphic to its left unless I change it from "inline with text" to "moves with paragraph". While this works it tends to cause formatting problems when I am adding CRs.
Thanks
Lorenz H. Menke, Jr.
- martin
- Official Nisus Person
- Posts: 5227
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Equation numbering methods.
At this point I think this would be my recommended approach for solving this problem. But really we do need to add a variable/sequence number feature separate from the List styles.LongTermUser wrote:I inserted a single row table with two columns. The right-most column is 1/2 inch in width and contains the list number. The remaining table column contains the equation. This seams to work well enough. However I consider it a poor replacement of NWP method.
-
- Posts: 9
- Joined: 2020-10-22 13:36:34
Re: Equation numbering methods.
This is quite an old post. Is there still no better way to do equation numbering with the number aligned on the right of the line?
blah blah blah in Eqn (1):
z = x + y (1)
blah blah blah in Eqn (1):
z = x + y (1)
Re: Equation numbering methods.
If by "better way" you mean "numbers that update automatically and that can be placed elsewhere than the start of a paragraph", then the the answer is "no".
But rather than using tables, I would recommend using a character style for the equation numbers, insert them physically ("hard coded") and then use a macro to update and keep them in order. In fact I would write a macro to insert them so that they stay in sequence at all times.
If you want assistance writing such a macro, let me know.
But rather than using tables, I would recommend using a character style for the equation numbers, insert them physically ("hard coded") and then use a macro to update and keep them in order. In fact I would write a macro to insert them so that they stay in sequence at all times.
If you want assistance writing such a macro, let me know.
philip
Re: Equation numbering methods.
G'day, Martin et al
Perhaps an option in the Lists Palette to choose between leading and trailing list item numbers (with following and preceding tabs respectively) could be of use in this and other contexts.
Cheers,
Adrian
Perhaps an option in the Lists Palette to choose between leading and trailing list item numbers (with following and preceding tabs respectively) could be of use in this and other contexts.
Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
macOS Ventura
Nisus Writer user since 1996
- martin
- Official Nisus Person
- Posts: 5227
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Equation numbering methods.
You could use a "right-to-left" paragraph writing direction, so that automatic numbering is laid out along the right side. I'd enforce all that using a paragraph style. I'll attach an example document that hopefully makes this technique clear. Please let me know if you have any questions.dlrodriguez wrote: ↑2020-10-27 14:23:33 Is there still no better way to do equation numbering with the number aligned on the right of the line?
- Attachments
-
- equations-example.zrtf
- (31.64 KiB) Downloaded 545 times
Re: Equation numbering methods.
Martin, ingenious indeed but placing the equation image inline you'll end up with the equation number aligned with the bottom of the image.
The effect is apparent when inserting multiline equations.
Are there any soutions to this problem?
The effect is apparent when inserting multiline equations.
Are there any soutions to this problem?
- Attachments
-
- Screen Shot 2020-10-30 at 11.13.17.png (77.33 KiB) Viewed 17280 times
Re: Equation numbering methods.
G'day, johseb et al
If you select an image, its dimensions are shown in the Shape Metrics Palette. Choose the Units to be Points, so you see the Height of the image in points. Now select the list item number and raise the baseline (via the Format menu) by half the number of points in the image's height. I think this will achieve what you want. There's bound to be someone out there who can wrap these steps into a nice little macro.
There's also bound to be a pedant out there who will observe that the sort of thing you have adduced is more in the nature of a set of equations than a single multi-line equation (although it actually has characteristics of both).
So another possible approach is to split the set into separate images and remove the List characteristics (via the Format menu, the Lists Palette or the List icon in the Toolbar) from all but the "middle" graphic. You can use Continue Numbering to have subsequent list items numbered in the same sequence.
Cheers,
Adrian
If you select an image, its dimensions are shown in the Shape Metrics Palette. Choose the Units to be Points, so you see the Height of the image in points. Now select the list item number and raise the baseline (via the Format menu) by half the number of points in the image's height. I think this will achieve what you want. There's bound to be someone out there who can wrap these steps into a nice little macro.
There's also bound to be a pedant out there who will observe that the sort of thing you have adduced is more in the nature of a set of equations than a single multi-line equation (although it actually has characteristics of both).
So another possible approach is to split the set into separate images and remove the List characteristics (via the Format menu, the Lists Palette or the List icon in the Toolbar) from all but the "middle" graphic. You can use Continue Numbering to have subsequent list items numbered in the same sequence.
Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
macOS Ventura
Nisus Writer user since 1996
Re: Equation numbering methods.
Hi Adrian, your method works perfectly. Thanks for the tip!
My example was purposely extreme but I guess the number of a significant proportion of equations will be off-center (even though by a small amount).
The table method automatically takes care of the vertical aligment of the numbers but Martin's method seems more "clean"; as you noticed a macro would be a nice addition.
In any case is good to have a choice.
My example was purposely extreme but I guess the number of a significant proportion of equations will be off-center (even though by a small amount).
The table method automatically takes care of the vertical aligment of the numbers but Martin's method seems more "clean"; as you noticed a macro would be a nice addition.
In any case is good to have a choice.
Re: Equation numbering methods.
G'day, all
While Martin's approach works well enough, it is perhaps not ideal for those unaccustomed to working with right-to-left languages, particularly when it comes to placement of the insertion point for new paragraphs.
So I think my earlier suggestion of allowing a choice between leading and trailing list item numbers, taking due cognizance of writing direction, would still be preferable.
Cheers,
Adrian
While Martin's approach works well enough, it is perhaps not ideal for those unaccustomed to working with right-to-left languages, particularly when it comes to placement of the insertion point for new paragraphs.
So I think my earlier suggestion of allowing a choice between leading and trailing list item numbers, taking due cognizance of writing direction, would still be preferable.
Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
macOS Ventura
Nisus Writer user since 1996
Re: Equation numbering methods.
Adrian, you're right, there's for sure room for improvements when it comes to figure/table captions and equation numbering (e.g. simpler ways to create numbering per chapter or create figure/tale lists, etc; all possible now but no so smooth).
Re vertical adjustment of baseline, I noticed that hovering with the mouse over an equation image you get a pop-up showing the dimensions of the image. Unfortunately they are displayed in the unit set for the rulers, which I always set to cm.
If the image dimensions were displayed in points as well we could avoid a trip to the Shape palette and make the baseline adjustment a matter of seconds.
Re vertical adjustment of baseline, I noticed that hovering with the mouse over an equation image you get a pop-up showing the dimensions of the image. Unfortunately they are displayed in the unit set for the rulers, which I always set to cm.
If the image dimensions were displayed in points as well we could avoid a trip to the Shape palette and make the baseline adjustment a matter of seconds.
- martin
- Official Nisus Person
- Posts: 5227
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Equation numbering methods.
A more proper solution is certainly still desirable. I think the most complete way to address this is custom numbering sequences that can be placed anywhere in your text.So I think my earlier suggestion of allowing a choice between leading and trailing list item numbers, taking due cognizance of writing direction, would still be preferable.
That's a great idea Adrian! I'll attach such a macro. To use it just place the selection/caret anywhere within the paragraph with the equation image and run the macro. It will detect the image and list item, and adjust the baseline as needed.
The only issue is that the macro must guess how tall the list item is by itself, in order to properly center it. There's a variable for that near the bottom:
Code: Select all
$textHeight = 10
- Attachments
-
- Equation Image, Align List Item Vertically.nwm
- (6.6 KiB) Downloaded 529 times
Re: Equation numbering methods.
G'day, Martin et al
Thanks for that, Martin. The subtlety of accounting for the text height is a nice little touch.
Strictly speaking, of course, the macro only aligns a list item number, not an entire list item, with an image. Aligning all tab-separated text elements in a list item would obviate the need to resort to tables merely to effect vertical alignment, but I’m not sure how often such a situation would arise in the context of a list.
Cheers,
Adrian
Thanks for that, Martin. The subtlety of accounting for the text height is a nice little touch.
Strictly speaking, of course, the macro only aligns a list item number, not an entire list item, with an image. Aligning all tab-separated text elements in a list item would obviate the need to resort to tables merely to effect vertical alignment, but I’m not sure how often such a situation would arise in the context of a list.
Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
macOS Ventura
Nisus Writer user since 1996
- martin
- Official Nisus Person
- Posts: 5227
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Equation numbering methods.
Nisus Writer Pro version 3.2 improves on this macro by using a new command to measure the list item's height:
Code: Select all
$listItemSize = $text.opticalSizeInRange($listItemRange)
• Image, Align List Item Vertically