Part of Nobumi Iyanaga's website. n-iyanag@ppp.bekkoame.ne.jp. 5/16/03.

logo picture

Migrating from Classic Nisus Writer to OS X NW-Express

— For users of special diacritical fonts —

Introduction

Now that we have Nisus Writer Express for OS X (currently, as of May 2003, we have still only a public beta version), the "dreamt" transition from Classic OS to OS X environment seems to become possible for users of Classic Nisus Writer. Unfortunately, the transition is not so easy, especially for people who had to use special diacritical fonts for transliteration of Asian (or other) languages such as Sanskrit, who write multilingual documents (using for example Japanese, Chinese, Korean, English, French, etc.), who use many footnotes, etc., in short, researchers in the field of Asian studies.

The first version of Nisus Writer Express (hereafter, NW-Ex) is not a full featured word-processor. Jerzy Lewak, CEO Nisus Software, wrote himself, to the members of the Nisus mailing list:

This first version, the Express version, is being released without many of the features, present in Nisus Writer 6.5 because of popular demand that something be released quickly....

One of the most important things lacking in NW-Ex is the footnotes. As to graphics, it is only possible to import external graphic files in NW-Ex documents. Layout capabilities are very basic also. It would be perhaps better to wait for a more featured version of Nisus Writer for OS X. However, there may be impatient users who would like to use the new version already at this stage (for example myself...!). I investigated how it would be possible to make this transition as smooth and as easy as possible.

1. Some Basic Facts to Know...

Before dealing with the actual steps that we should take, it seems good to let the users know some basic differences between Classic OS and OS X.

Case study 1. Simple File without Notes, Written in a Single Diacritical Font

Hereafter, I will consider some typical cases.

The first case will be that of a simple file without notes, written in a single diacritical fonts.
In this case, you will:

  1. Open the file in question in Classic Nisus Writer; run one of the macros in the macro file "font<->HTML_Entities macros" which will convert all the diacritical characters in your file to HTML entities. For example, if the font used in your file is Appeal, you will run the macro "Appeal2htmlEntity"; if it is Minion-Indologist, you will run the macro "Minion-Indologist2htmlEntity". If there is no macro for your font, you will have to make one; for this, please refer to my page East Asian Diacritical Fonts and Unicode. If you have difficulties to do it, please write me; I may be able to help you.
    Explanation: As you will be able to see it yourself, the macro <font_name>2htmlEntity convert all the diacritical characters into their html entity equivalents. For example, "é" will be converted to &#233;, and "ō" will be converted to &#333;. The signs "&" and ";" enclose what is called html entity; and here the entities are "#" sign and Unicode decimal numbers.
    For now, the macro file "font<->HTML_Entities macros" contains macros for the following eleven fonts:
    • Appeal
    • BharatiTimes
    • Hobogirin
    • ITimesSkRom
    • Minion-Indologist
    • MyTimes
    • NormanSk
    • Normyn
    • SanskritTimes
    • TimesCSXPlus
    • Times_Norman
  2. Select all the text, and change the font to one of the fonts which have Bold, Italic, Bold-Italic typefaces in OS X -- for example, Times may be a good choice.
  3. Do a "Save As..." this changed file.

Now, you will have to work with NW-Ex.

  1. Open the newly saved file in NW-Ex. You will see that most of the style information is preserved in NW-Ex: Italic, Bold, Bold-Italic, ruler setting, etc. Now, select all, and change the font to some Unicode font, containing the diacritical characters that you need: Thryomanes can be a good choice.
  2. Now, run the macro named "htmlEntity2RTFUnicode". You will see a new window, in which all the diacritical characters will be restored to their original form.
    Explanation: The Perl macro "htmlEntity2RTFUnicode" works on the raw rtf data. In rtf data, Unicode characters are rendered by the command "\uunicode_decimal_number ?" -- so we simply find occurrences of sequences "&#decimal_number;", and replace the sign "&#" with "\u" and the sign ";" with " ?".
  3. This is the converted rtf file. Save this file as a rtf file doing a "Save As..."

Now, you will work with TextEdit (because for the moment, NW-Ex's "Save As..." Unicode file is not implemented correctly):

  1. Open the newly converted rtf file with TextEdit.
  2. Choose "Make Plain Text" in "Format" menu (Command + Shift + T).
  3. Do a "Save As..." and choose UTF-16, or UTF-8 as encoding. This is the Unicode text file.

Now, if you want, you can work on this new Unicode text file to mark up the text, etc. (but since Unicode text file cannot have any style, it would be more convinient to work on the Classic Nisus file to mark up the text...).

Case Study 2. Multilingual File with Fonts of Different Scripts and Diacritical Font(s)

Although at first glance, this case may seem much more difficult, it is not so different from the first case. Here are the steps to be taken:

First, you prepare a file in Classic Nisus Writer:

  1. Open the file in question in Classic Nisus Writer; run one of the macros in the macro file "font<->HTML_Entities macros" which will convert all the diacritical characters in your file to HTML entities (see above).
  2. If you have Japanese text written in one of the fonts having names in Kanji (for example 細明朝体 or 平成明朝, etc.), select all the text, and change the font to Osaka (it is the only font which has the same name in Classic OS and OS X [see above]). I think you have to do the same thing with Korean text, but as I cannot read hangul, I am unable to give any font name here...
  3. Select all the text, and change the font to one of the fonts which have Bold, Italic, Bold-Italic typefaces in OS X -- for example, Times may be a good choice (note that this will not affect text written in a different script font, for example a Japanese font).
  4. Do a "Save As..." this changed file.

After this, you can take exactly the same steps as in the case 1. Of course, while working in NW-Ex, you can change the font of Japanese text from Osaka to some other font, for example one of the Hiragino family fonts which has a more beatiful shape.

Case Study 3. File with Footnotes/Endnotes

As NW-Ex does not (yet?) support footnotes/endnotes, it is impossible to import simply Classic Nisus Writer files with footnotes/endnotes. For these files, you would perhaps better wait for a later version of NW-Ex. But in fact, it is already possible to work with notes within NW-Ex, if you don't mean them to be "footnotes/endnotes" in ordinary sense.

There are reasons for which I would even recommend the use of these "non-ordinary" notes. First, footnotes/endnotes in Classic Nisus files are stored not in the data fork, but in the resource fork, so that when your publisher asks you to send the text file of your work, the notes will not be included. On the other hand, when you write footnotes, you are in a different window than the main text window, so it is difficult to refer to the main text. It seems impossible to include footnotes/endnotes in your index. Finally, you cannot search in your footnotes/endnotes with search utilities like MgrepApp...

The system I would propose here is the following. You write your notes in the main text itself, enclosing them in a special pair of tags. The tags are "<fn>" and "</fn>". Your text would look like:

My_main_text my_main_text my_main_text<fn>My_note1</fn> my_main_text
my_main_text<fn>My_note2</fn> my_main_text my_main_text my_main_text...

When you have finished writing your document, andhave done all the editing work, you will run a macro, which will send your notes at the end of the document, and add to them the corresponding note numbers, in the main text and at the beginning of each note. The document would look like...:

My_main_text my_main_text my_main_text (n. 1) my_main_text
my_main_text (n. 2) my_main_text my_main_text my_main_text...
<End of the main text>

Notes:
(n. 1) My_note1
(n. 2) My_note2
...

Of course, this method has some drawbacks. First, with this method, you can make endnotes, but not footnotes. Another problem is that if you want to add or remove notes after you have put them at the end of the main text, you will have to insert them at the wanted places, and renomber the notes yourself (you can use a macro to do that work, but the renombering is not fully automatic).

I wrote a macro file for Classic Nisus Writer containing all kinds of converting macros for footnotes: with it, you can convert footnotes to "fn_tag" notes or "text end-notes" or vice-versa in three ways. If you have files with footnotes, and you want to use NW-Ex to edit these files, I would recommend you to use the macro named "Footnotes->TextEndNote" to convert your footnotes into "text end-notes" before opening them with NW-Ex.

I wrote also two Perl macros for NW-Ex which converts "fn_tag" notes into "text end-notes", and vice-versa, and some other macros. And Kino-san wrote a Perl macro that colors "fn-tag" notes in blue, so that it would be easier to distinguish from the main text; and he kindly allowed me to distribute his macro in this page.

So, here are the steps that you would take to import your Classic Nisus file with footnotes into NW-Ex.

First, you prepare a file in Classic Nisus Writer:

  1. Open the file in question in Classic Nisus Writer; run one of the macros in the macro file "font<->HTML_Entities macros" which will convert all the diacritical characters in your file to HTML entities (see above). Open the Footnotes/Endnotes window, and run the same macro.
  2. If you have Japanese text written in one of the fonts having names in Kanji (for example 細明朝体 or 平成明朝, etc., select all the text, and change the font to Osaka (it is the only font which has the same name in Classic OS and OS X [see above]). Do the same in the Footnotes/Endnotes window.
  3. Select all the text, and change the font to one of the fonts which have Bold, Italic, Bold-Italic typefaces in OS X -- for example, Times may be a good choice (note that this will not affect text written in a different script font, for example a Japanese font). -- Do the same in Footnotes/Endnotes window.
  4. Run the macro "Footnotes->TextEndNote" in the macro file NoteMacros, so that all your footnotes/endnotes become "Text end-notes".
  5. Do a "Save As..." this changed file.

When you have done this work, the rest is the same as the case 2 above. You can open the file with NW-Ex, change the font to Thryomanes (for example), run the macro "htmlEntity2RTFUnicode", and change the Japanese font to some other font. When this file is saved as rtf file, you will be able to open it with TextEdit, and convert it to a Unicode text file.

And if you want to edit footnotes (i.e. "Text end-notes") in NW-Ex, you would run the Perl macro "TextEndNotes2fnTags", so that the notes would be in the main text, enclosed between the tags "<fn>" and "</fn>". You could use the macro "fnTags2blue", so that your "fn_tag" notes would be easier to distinguish from your main text. And when you have finished editing, you could run the macro "fnTags2TextEndNotes", to send the notes at the end of the main text.


Download

Here is the download link: download package (80 KB).

This package contains:

You can also download:

A little passage in ReadMe uses this font for the demonstration purpose.


I hope these explanations and macros are of some help for some users.

I would appreciate any feedback. Thank you in advance.


Go to Research tools Home Page
Go to NI Home Page


Mail to Nobumi Iyanaga


frontierlogo picture

This page was last built with Frontier on a Macintosh on Fri, May 16, 2003 at 1:20:02 AM. Thanks for checking it out! Nobumi Iyanaga