numbered headings exported to Word: weird brackets

Everything related to our flagship word processor.
Post Reply
nicka
Posts: 19
Joined: 2007-07-04 14:00:10

numbered headings exported to Word: weird brackets

Post by nicka »

I've been trying out NWP and I seem to have a problem with numbered headings in .rtf or .doc files.

I assigned 'Headings' list style to some headings (levels 2 and 3) so that they were auto-numbered, like this:

1. Section
1.1. Subsection

Then I saved the file (as rtf, and later as doc, with identical results) and opened it in Word (2004). There I get:

1. Section{tc \f D \l 2 "1. Section"}
1.1. Subsection{tc \f D \l 3 "1.1 Subsection"}

I guess the stuff inside the curly brackets is some sort of field code. But Show field codes is unchecked in Preferences in Word.

Does anyone know how to make all that stuff disappear? (Sorry if I've missed previous discussion of this. I had a look in the old beta forum but didn't find anything relevant.)
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: numbered headings exported to Word: weird brackets

Post by xiamenese »

nicka wrote:I've been trying out NWP and I seem to have a problem with numbered headings in .rtf or .doc files.

I assigned 'Headings' list style to some headings (levels 2 and 3) so that they were auto-numbered, like this:

1. Section
1.1. Subsection

Then I saved the file (as rtf, and later as doc, with identical results) and opened it in Word (2004). There I get:

1. Section{tc \f D \l 2 "1. Section"}
1.1. Subsection{tc \f D \l 3 "1.1 Subsection"}

I guess the stuff inside the curly brackets is some sort of field code. But Show field codes is unchecked in Preferences in Word.

Does anyone know how to make all that stuff disappear? (Sorry if I've missed previous discussion of this. I had a look in the old beta forum but didn't find anything relevant.)
I have seen mention of this, perhaps on the Scrivener forum, and from what I remember, these problems arise when Word imports .rtf files. NWP .doc files are not binaries, but .rtf with a changed creator code and extension. It may be that Apple's implementation of RTF is idiosyncratic in places (which I have heard) or that Microsoft Word doesn't fully support all the features of RTF (which I have also heard) so where exactly the blame lies Martin or someone else might know.

Those are clearly the codes marking those header levels to be included in the Table of Contents, giving font and level information and the text to appear in the ToC. If you don't need that, then you can turn off the marking using the "Reference Tools" pane in the drawer (If you can't see that, click on the >> at the top of the tool drawer and it will appear.

The alternative is to leave the ToC assignment in place, and when you get into Word simply use Find and Replace to remove all those extraneous elements and set up the ToC in Word -- but I don't imagine it will be as easy as doing so under Nisus is!

I don't know if NWP respects ToC settings in Word, as it is not something I have had any experience of.

Good luck
Mark
nicka
Posts: 19
Joined: 2007-07-04 14:00:10

Post by nicka »

Thanks for the answer, Mark. The impressive thing is that the file exported by Nisus when opened in Word retains auto-numbered headings. It would all be perfect if I could only get those fields to hide.

I've just tried deleting the fields in Word. I had imagined that that would cause damage of some sort, at least to the structure of the heading levels in the document, but in fact it apparently has no bad effect. The headings are still at the same levels and they are still auto-numbered.

Does anyone know what is going on here?
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: numbered headings exported to Word: weird brackets

Post by martin »

xiamenese wrote:It may be that Apple's implementation of RTF is idiosyncratic in places (which I have heard) or that Microsoft Word doesn't fully support all the features of RTF (which I have also heard)
The RTF is generated by Nisus (eg: we do not rely on Apple for RTF import/export). As for the TOC entries, Word does support them.
nicka wrote:It would all be perfect if I could only get those fields to hide.
Unfortunately Word (on the Mac at least) doesn't obey its own preferences in this case. Theoretically you could simply uncheck View > Show > Field Codes in Word's preference pane and the "tc" field codes should hide. It works for other fields (eg: automatic date/time stamps), but for some reason not for TOC fields. You'll have to take it up with MS.
I've just tried deleting the fields in Word. I had imagined that that would cause damage of some sort, at least to the structure of the heading levels in the document, but in fact it apparently has no bad effect. The headings are still at the same levels and they are still auto-numbered.
The "tc" field codes are only responsible for marking content for inclusion in the TOC. They do not affect list numbering or paragraph style.

In this case your Heading paragraph style specifies that the paragraph should be included in the TOC, so the "tc" fields are actually redundant. As long as your Heading style remains intact you can delete the fields in Word without damaging your document.

However, sometimes you might want to add some arbitrary content to the TOC in NWP by using the menu Insert > Table of Contents > Include in TOC > Level 1. In this case a "tc" field code will also be added. If you delete this field then the TOC will be affected.

Hopefully all that makes sense. If not, please let me know!
nicka
Posts: 19
Joined: 2007-07-04 14:00:10

Post by nicka »

Thank you Martin. That's all very clear. It's really good to get an answer from someone in Nisus -- it shows that you are looking out for the users of your software.

Somehow I'm not surprised Word doesn't honour its own preference settings. Perhaps, like so many other bugs, it will be fixed in Word 2008 and replaced with others.
Post Reply