a very useful function in the tables

Everything related to our flagship word processor.
Post Reply
jdevriendt
Posts: 15
Joined: 2017-05-01 23:38:06

a very useful function in the tables

Post by jdevriendt »

I am obliged to be used to me as MS Word when I work on tables, with on the left a text, on the right his translation. And that only because Nisus, not that of 2001, that of 2017, does not make it possible to insert footnotes, or endnotes in the text of the tables..
Thus, I cannot make use only of Nisus, like “front”. And this is very irritating: obliged to have a MS Word beside Nisus “the strong”! :x
When this function will be implemented?
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: a very useful function in the tables

Post by Þorvarður »

Hi jdevriendt,

I understand your frustration over not being able to enter footnotes in tables.
Meanwhile, you could enter numbers in superscript. Below the table, enter note references with text color white (so the true note references will be invisible.)

If you use "Note references color" you will be able to see them in the document, but they won't be printed. See Preferences > Appearance > Customizable colors > Automatic Text > Note references.

If you decide to use this method, then a macro can be written to enter the fake superscript note references in the table.
2.png
2.png (91.14 KiB) Viewed 17727 times
Last edited by Þorvarður on 2017-05-03 12:39:11, edited 1 time in total.
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: a very useful function in the tables

Post by Þorvarður »

Philip Spaelti wrote a macro called "Table Footnote." You can find it here.
viewtopic.php?f=18&t=2442&p=25945&hilit ... ote#p25945

There is a long thread about the problem here:
viewtopic.php?f=18&t=2442&hilit=Macro+Table+Footnote

In the year 2012 an official Nisus person wrote here in the forum:
"At this time we don't have any news to announce about this enhancement request, but we know it's important."
viewtopic.php?f=18&t=2442&hilit=footnot ... ant#p22886

Although they know it's of great importance to their customers, it's obviously not very important to them. :cry:
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: a very useful function in the tables

Post by Þorvarður »

I don't know if this has been already addressed. The macro "Table Footnote" generates an error if more than 1 footnote is inserted into a cell.

The error message reads:
"There was an error on line 68 in the macro "Table Footnote". The TextSelection object does not have a "location" property.

And when I click on the Open Macro button, I get this error message:
There was an error on line 68 in the macro "Table Footnote". The variable "$txtSel" has not been defined.

The line causing the trouble is highlighted:
if $tblNoteRefs[$i].locaton < $txtSel.location
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: a very useful function in the tables

Post by phspaelti »

Þorvarður wrote:I don't know if this has been already addressed. The macro "Table Footnote" generates an error if more than 1 footnote is inserted into a cell.
Thanks Þorvarður for reporting this. This bug is something that was supposed to have been fixed 3 years ago. I'm not sure how the macro has survived all these years in the the state it was. Maybe the many who downloaded it over the years simply decided it was worthless and moved on :)
I have replaced the broken one with a fixed version. Hope this works better. If there are still problems, feel free to report it.
philip
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: a very useful function in the tables

Post by Þorvarður »

phspaelti wrote:If there are still problems, feel free to report it.
Thank you Philip for looking into this.

Unfortunately the numbers (i.e. the cross-references) in the table are not yet in correct order. When a third footnote is inserted, the natural progression begins to spin out of control. The numbers "2" and "3" are swapped, so that we get this:
3.png
3.png (16.71 KiB) Viewed 17566 times
After 7 footnotes, we end up with this:
7.png
7.png (22.56 KiB) Viewed 17566 times
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: a very useful function in the tables

Post by phspaelti »

Þorvarður wrote:Unfortunately the numbers (i.e. the cross-references) in the table are not yet in correct order. When a third footnote is inserted, the natural progression begins to spin out of control.
Yes, apparently my macro was completely off. Try this new version. Hopefully this should work better. I also changed the "hiding" of the intermediary (true) reference numbers by using a paragraph style.
Attachments
Table Footnote.nwm
(24.37 KiB) Downloaded 626 times
philip
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: a very useful function in the tables

Post by Þorvarður »

phspaelti wrote:Try this new version.
Now I can't insert anything at all because I get this error message:
1.png
1.png (31.63 KiB) Viewed 17464 times
The culprit is this line:
if $doc.text.characterAtIndex($fnLoc + $numFound) != 10
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: a very useful function in the tables

Post by phspaelti »

Þorvarður, I know. Sorry about that. Just make sure to add a return after the table. As it is the table can't be the last thing in the document.

This is all due to the 'hiding' thing. Since I switched to using a paragraph style for hiding the note references at the end of the table, the macro has to insert a "protective" return to make sure the paragraph style doesn't hide all the text following the table. I first forgot to test the case where there is nothing after the table before uploading the macro. And then when I noticed it and tried to fix it, I ran into other issues (which have nothing to do with the macro itself). Basically Nisus seems to have some buggy behavior with returns and styles after a table, but I just don't have the time right now to investigate this.

And I figured you would notice that pretty quickly :)

So just make sure to put a return after the table before you run it. For the time being.
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: a very useful function in the tables

Post by phspaelti »

On second thought, here is a macro with a simple fix that avoids the error message. But note you will have to adjust the styles yourself after you run the macro. I'm not fixing that right now.
Attachments
Table Footnote.nwm.zip
(5.02 KiB) Downloaded 576 times
Last edited by phspaelti on 2018-06-29 23:50:23, edited 1 time in total.
philip
Þorvarður
Posts: 410
Joined: 2012-12-19 05:02:52

Re: a very useful function in the tables

Post by Þorvarður »

phspaelti wrote:here is a macro with a simple fix
Philip, it seems you have provided an excellent solution to a long-standing problem that Nisus Software obviously didn't care to solve. Congratulations! Both macros work well, as far as I can tell. In v.2 one has to remember to insert a return after the table, and in v2.1 the user doesn't have to bother about that anymore. Well done! 8) 8) 8)
jdevriendt
Posts: 15
Joined: 2017-05-01 23:38:06

Re: a very useful function in the tables

Post by jdevriendt »

I tried all these macros.
Not one works without error.

The editors want to print, to see, to read the texts first, then leave to the correctors annotating them, before sent back to me, for I validate them or not, but writing why in the document, at the right place, in the table !
Nisus must overcome a dozen of such problems to become a professional tool, for professional use. We dont need a UFO between note app and text editor.
So, I'm in the morning of the day's work: and forced to do it with MS Word ....
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: a very useful function in the tables

Post by phspaelti »

Hello jd,
you may want to check your blood pressure. I'm really sorry that this issue is causing you so much distress. I'm also pretty sure that my macro works fine, but it is a kludge, and it obviously will not help if your needs include exchanging files with MSWord users. Sorry!

Also remember that those of us posting here are Nisus users just like you.
philip
Post Reply