Page 1 of 1

Questions Re Commentary and Notes RTF Codes

Posted: Thu Jul 01, 2021 4:07 pm
by gungadout
I am having another look at converting a commentary file and notes files that I set up around 20 years ago for a Bible program that now has totally incompatible file structures, and is nowhere near as good as TheWord.

There was a commentary file, and a number of reference documents, sections of which were linked to from the commentary. Within TheWord, the resulting reference documents could be individual files or a composite file; either would be practical.

I plan to convert the files programmatically, and will be converting the former control codes to those required in TheWord. I have experimented with the manual verse-by-verse setup, to get some idea, including book comments and chapter comments, but I could not ascertain the codes required by looking at the resulting files. I also looked at a twm file in Notepad, but that didn’t help either.

My proposed method is to work with txt files, then read them into Wordpad and save them as RTF files ready for importing.

I have the following questions with respect to the converted txt/RTF files to be imported into TheWord.

1. How are overall Bible book comments delimited/defined in a commentary file?

2. How are overall Bible chapter comments delimited/defined in a commentary file?

3. How are individual Bible verse comments delimited/defined in a commentary file?

4. How are links to targets (bookmarks?) in the same file delimited/defined in a commentary file?

5. How are links to targets (bookmarks?) in notes files delimited/defined in a commentary file?

6. How are links to targets (bookmarks?) in the same file delimited/defined in a notes file?

7. How are links to targets (bookmarks?) in other files delimited/defined in a notes file?

8. How are links to scripture verses delimited/defined from within:
- Commentaries?
- Books?

9. What should I have asked, that I didn’t even know to ask?

Also, how does one get the book comments and chapter comments to actually display?
- When I set them up manually within TheWord, I could find no way to actually display them.
- I set up book, chapter and verse comments in the Matthew 1:1 area.
- I set up a verse comment for Matthew 1:12.
- The verse comments display for both.
- The book and chapter comments are hiding somewhere.


Re: Questions Re Commentary and Notes RTF Codes

Posted: Fri Jul 02, 2021 10:39 am
by JG
If you could give a link to one of your files you would like to convert it might help in going forward with some suggestions.

Re: Questions Re Commentary and Notes RTF Codes

Posted: Sun Jul 04, 2021 12:34 pm
by gungadout
Hello Jon,

Thanks for your response.

Examples of linking between the commentary file and a composite file of reference material (books), together with hopefully helpful explanations, follow.

What I hope to do is programmatically convert the existing codes in each file type to TheWord equivalents.

Hopefully I have not been burdensome.


An example from within the commentary file.

\\Matthew 1:16\\

\\And Jacob --\\ The real father of Joseph, not Heli, who was his
father-in-law. (\\#Lu 3:23\\) X129 208922
U791:2 211060

The 00016-Mt1.16 structure linked the text following it, to the Bible verse Matthew 1:16, down to but excluding 00017-Mt1.17.

For the program user, the X (in X129) and the U (in U791) were codes identifying individual books (all public domain or used with permission) being linked to. The 129 and the 791 were the published page numbers in the particular books, and the :2 pointed to a published reference point within that particular page. The book codes (X, U, etc.) were explained in a comment for the whole Bible at the start of (first verse in) the commentary file.

Apparently each lookup page number (208922 and 211060 above) had to appear on a separate line from all others. Clicking on the lookup page number resulted in a pop-up window appearing, containing the relevant page. (More detail regarding the pop-up window, below.)

The \\...\\ structure defined bolding. The # in front of Lu 3:23 let the Bible program know that a Scripture reference to be linked to (maybe as another pop-up – I’ve forgotten), followed.


Examples from the composite file of reference books.

08922 and 11060 were manually allocated "bookmark" page numbers within a combined text file containing all the reference books being accessed. The page numbering was continuous, starting with the first component book, and ending with the last component book.

Each lookup page number (as in the commentary section above) pointed to a "bookmark" page number in the composite file; that “bookmark” page number was on a line by itself before the start of the logical page (it was a continuous text file with no special characters to denote page breaks), and consisted of the digits following the initial “2”.

That was the way that particular Bible program worked.

The pop-up window was permanent until dismissed. It itself contained clickable page numbers (2nnnnn) corresponding to the previous and next pages in the file, and thus navigation was possible within that pop-up window. Navigation from one component book to another was therefore also possible, but was not a requirement in this case.


Once I am aware of the conversions required, I hope to create converted text files, convert them to RTF files via Wordpad, and import those into TheWord.

I appreciate your offer of help.

Thanks heaps (as we say “down under”).


Re: Questions Re Commentary and Notes RTF Codes

Posted: Sun Jul 04, 2021 2:37 pm
by JG
Thanks for the example. We will have to wait to see what Jonathan has to say on this as regards the linking.

Re: Questions Re Commentary and Notes RTF Codes

Posted: Wed Jul 07, 2021 7:20 pm
by jonathangkoehn
Greetings gungadout,
If you start with this post: ... &hilit=rtf this should help with RTF linking.
However in regards to building a commentary: Please see this resource
Also it is a good idea to look at a pre-existing unencrypted commentary for ideas on how they work along with the above documentation.
There is another resource that I have messaged you in regards to that does not come with a help manual but is very powerful. However, help is not provided for it. I just don't have the time sorry.
I have put it in its own thread here in the forum but note there will not be help provided for it unless it is from another user.
TotheWord a tool useful for building books, commentaries, etc.

Re: Questions Re Commentary and Notes RTF Codes

Posted: Thu Jul 15, 2021 5:25 pm
by gungadout
Thanks, Jonathan. Much appreciated. Especially since your time is limited.

I now know how to link to Scripture verses and topics.

The knowledge I lack is:
1. How do I define a target topic (bookmark?) within the a source txt file for a book or commentary;
2. What form does the header information required by TheWord take, within a source txt file for a commentary, and for a book (dictionary)?

The only sample file I have found is in SQL format.

Were there a template txt file available for each of a commentary and a book, that would be all I would need. Apart from how to define a target topic within a book, if the template did not include that.

Are such templates available?



Re: Questions Re Commentary and Notes RTF Codes

Posted: Wed Jul 21, 2021 8:03 pm
by jonathangkoehn
Greetings Gungabout,
Please start here:
Here is a portion copied:
Topics that act as anchors/links – link-topics (version 3.2.1+)
It is possible to have a topic that does not have its own content but instead ‘links’ to another topic. In order to support this, a new content.type has been added called ‘meta’. Topics of this type must:
1. Have the content.type column (in topics table) set to the value ‘meta’.
2. The data in the content table should be a meta record. A meta record is defined as follows:
a. A set of name=value properties, each on a new line (separate by CR+LF)
b. The first line must be meta=_twmgc_ (exactly like that)

For a meta record that points to another topic, the following name/value pairs are used: type=link
id=<linked topic id>
anchor=<bookmark/anchor in linked topic, optional>
Notice: both conditions 1 and 2 above must be true for link-topics to work properly. Inconsistencies in the db will lead to unexpected results.
For example, the data column of the content table for a link-topic should look like this:
In the above example, 3 is the id of the topic this one links to, and anchor an (optional) bookmark/anchor defined in this target topic.
The following rules apply for link-topics:
1. They cannot be created from within theWord: they must be created with direct sql manipulation. This implies that they should be mostly used for non-user modules.
2. All operations that are made to link-topic (e.g. highlighting, content update, verse-ref detection) are internally applied to the linked topic instead. So, in normal conditions, a link-topic (having been created with direct sql manipulation) cannot be changed at all from within theWord (except for 3, see below).
3. When copying link-topics from one module to another (using drag-n-drop) from within theWord, the link-topics are not really copied, instead the actual linked copied content is. Be very careful with this operation since it is the only case in which link-topics are not preserved.
4. When searching, link-topics do not appear in the search results for content-search: instead, their linked topics appear. When searching topic-subjects, then link-topics can/will appear
5. When displaying a link-topic in the Book view, the display is not updated if the current topic is the same with the linked-to topic. If an anchor is defined in the link-topic, the display scrolls appropriately.
6. A bookmark icon appears in the topics-tree for link-topics.
7. Changing module content-type (from rvf to rtf, etc) should have no effect on link-topics.

Re: Questions Re Commentary and Notes RTF Codes

Posted: Wed Jul 21, 2021 8:08 pm
by jonathangkoehn
That is how to point to a bookmark, now as to make one in the rtf
One of the quicker ways is go into theWord make a user module put in a bit of text and give it a book mark using theWord.
Then export that topic using RTF.

And you will get rtf code like this

{\*\bkmkstart bkm1}{\*\bkmkend bkm1}This is a bookmark in RTF

This should get you started but that document and TotheWord will help you more.

Re: Questions Re Commentary and Notes RTF Codes

Posted: Mon Jul 26, 2021 5:06 am
by gungadout
Thanks, Jonathan.
I'll give it a go.