Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Macro for SwordSearcher to USFM 
Author Message
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
Hi Eric,
check the last version (v5). I have changed things around, added comments, and added some formatting to make thing easier to read.

NisusUser wrote:
The marker \p can be mid-verse – not necessarily at the beginning of the verse or at the beginning of the line. If it's mid-verse, it does not start on a new line. Then there is no new \v marker until the next verse.

In v5 I have separated the two cases, so you should be able to adjust the latter case to make it come out the way you want it.

NisusUser wrote:
Re: \nd (names of diety). This is going to take some tweaking. That formatting should only be applied (best I can tell) if it is one isolated word in all caps. That's not foolproof, though, so I'll have to think this through. That's because in SS there is other text in all caps also – citations from the OT presented in the NT.


In v5 I have treated words in All-Caps of 3 letters or more as deity names. Again if you find a better rule you should be able to adjust it. Since those cases need to have their case change, dealing with them turned out be more complicated than a simple Find and Replace, but hopefully the way to deal with that should be clear enough from the code.

best
Philip

_________________
philip


2013-05-02 02:01:20
Profile

Joined: 2011-01-12 05:32:38
Posts: 255
Philip,
Thanks again for all your work on this. Maybe you forgot to upload v5?
Eric

OOPS! How did I miss it? I just saw it. I'll try it out. Sorry.


2013-05-02 02:29:07
Profile

Joined: 2011-01-12 05:32:38
Posts: 255
I commented out the \nd part from v5 for now. I'll have to study it out later.

I found a problem with the way the refences are added to the footnotes (e.g., "1:4" in the footnote in Gen 1:4). There needs to be an ending marker \ft so it is "\fr ch:v \ft" (where "ch" is chapter digit(s) and "v" is verse digit(s). Otherwise, USFM thinks the "fr" is just part of the footnote text.


2013-05-02 03:16:34
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
NisusUser wrote:
I found a problem with the way the refences are added to the footnotes (e.g., "1:4" in the footnote in Gen 1:4). There needs to be an ending marker \ft so it is "\fr ch:v \ft" (where "ch" is chapter digit(s) and "v" is verse digit(s). Otherwise, USFM thinks the "fr" is just part of the footnote text.


Okay I didn't read the specification carefully. You'll have to change the line:
Code:
# Change footnotes to USFM format, including ‘chapter:verse’ marker
  $txt.findAndReplace '{(.+?)}', "\\\\f + fr $c:$v \\1\\\\f*", 'Ea'

to
Code:
# Change footnotes to USFM format, including ‘chapter:verse’ marker
  $txt.findAndReplace '{(.+?)}', "\\\\f + fr $c:$v \\\\ft \\1\\\\f*", 'Ea'


[PS: I updated the file on the earlier message.]

_________________
philip


2013-05-02 03:50:40
Profile

Joined: 2011-01-12 05:32:38
Posts: 255
Philip,
I can't thank you enough for your help. Version 5 is working great (except that I commented out the \nd, as I mentioned before). I hope (!) to come back to this next week, but until then I'll be busy with other things.

Unfortunately, I haven't yet reaped the benefits of your "didactic moment(s)", since you did all the work. I understand some of it – not a lot. Hopefully I'll be able to study this out sometime and learn to do my own macros like this. But it obviously is not for the faint-hearted, and I'm going to have to have my heart checked first :)

Thanks again & until next time,
Eric


2013-05-02 11:04:14
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software