TDX references not working above ch.9

I’ve ran into an issue in my Topic Index (TDX) where references above chapter 9 are not working. The app isn’t going to the correct reference if the chapter is greater than 9, ie. 10, 11, 12, …

Here is a line of code from the TDX as example:
\s2 Iesus fomɨra Godɨn nguibamɨn afeziam God ko iti, //ezɨ God gumazamizibar akurvaghasa nguazir kamɨn anemada
\li5 \xt Aghuzir Akaba 8:22-23; Maika 5:2; Aisaia 9:6; Jon 1:1, 15, 18, 30, 3:13, 16-17, 31, 6:33, 38, 42, 50-51, 58, 62, 7:29, 8:23, 42, 8:38, 17:5, 24; Efesus 1:3-5; Kolosi 1:16-17; Filipai 2:5-11; 1 Pita 1:18-20; 1 Jon 1:1 \xt*

Example in the string above for Jon … , 17:5, … goes to John 7:5. It is like it isn’t seeing anything past 10, 11, 12, … Another example is Isaiah 50:2-3, the app is looking up Chapter 0, verse 2-3. The result is an empty tap, nothing happens in the app. It is like the app is ignoring the first digit and going to the second digit of a reference. (Chapter 17:5, the 1 is skipped and the app pops up 7:5)

This seems to only apply to multiple references in a book where you use a comma. The link works fine in a single instance such as Aposel 14:14-15;

Any help or comments?

I believe you have some problems in your references. It’s possible to set up different ways of handling commas and semicolons in Paratext in Project settings > Scripture reference settings > Reference Format, but I don’t know whether SAB reads and conforms to that configuration in Paratext or not. I do know that normally people use semicolons (with space after) to separate chapters and commas (with no space after) to separate verses. If you don’t use a different punctuation symbol, then you will confuse your readers. Consider:

Jon 1:1,15 and Jon 1:1, 15

Is the first one chapter 1 verses 1 and 15, and the second one 1:1 and chapter 15? That would not be kind to your readers.

Can you try to put this in your text (even if it gives errors temporarily in Paratext), then build with SAB to see if it handles those references better? (You will notice that this list is a lot easier to read than your list above, with a space indicating a new chapter number or book…)

\li5 \xt Aghuzir Akaba 8:22-23; Maika 5:2; Aisaia 9:6; Jon 1:1,15,18,30; 3:13,16-17,31; 6:33,38,42,50-51,58,62; 7:29; 8:23,38,42; 17:5,24; Efesus 1:3-5; Kolosi 1:16-17; Filipai 2:5-11; 1 Pita 1:18-20; 1 Jon 1:1\xt*

(You have one inconsistency in your original list as well, with a chapter number twice: “8:23, 42, 8:38”. Do you mean “8:23,38,42”? That’s what I assumed in my text…)

This test should help us know where the problem lies, and if there is something that needs to be fixed up in SAB or not. And I think you should consider changing your Reference Format to something more like this:


You can tell if there is a space after the punctuation by looking in the example to the right (there are spaces just after the semicolons, I believe). And then of course you will need to fix up all of your cross references in your text. That could be facilitated with Regular Expressions (using RegExPal) - let us know if you need help with that.

1 Like

Hi Jeff
Thanks for the suggestion. That did work. I followed your syntax and used commas for same chapter references then semi-colon for chapter breaks within same book as you had outlined in your markup code. I confirmed that within the app, John 17:5 was referenced and not John 7:5 as previous. Thank you for the help.

Also, as you pointed out the inconsistency…that was from the printed TDX as the reference for 8:38 was wrapped to the next line so I’m guessing the typesetting added chapter 8 for clarity to the reader. It was a carry over from the printed text and was included in the SFM. I fixed that small issue. Thanks.

Would it be possible to get help with an expression that I could apply either to my SFM file or within SAB as a change? As noted below, I don’t have access to the PT project files. I have USX files from the text bundle and the TDX as a SFM file.

Note: I am working with a DBL text bundle as the text has been published and I am working on app creation to go along with printed Bible.

I would be a little reluctant to try to make the changes in SAB “on the fly”, so if you have a way to work directly with the SFM file, I would think that would be preferable. (But you could try just making the changes in SAB and see how well they work…) It sounds like you aren’t working in Paratext. In Paratext you can use RegexPal to limit your changes to a specific context. So, for example, you could say make these changes ONLY within cross references (using the ::: syntax). That would prevent the changes being made within the regular text. In this case, I don’t think there is likely to be regular text that would be modified, but it pays to be careful.

For the changes (regex syntax may vary, but I think this works in Notepad++), try first this change:

Find: (\d), (\d+:)
Replace: \1; \2

And then this change:

Find: (\d), (\d)
Replace: \1,\2

That will make the change I suggested in the post above. Where might that go bad? If you had something like this in the regular text:

David called 3, 2 came.

Then these changes would get rid of that space after the comma:

David called 3,2 came.

Pretty unlikely, to have something like that in the text, I imagine. I think messing up something with semicolons (with numbers) in regular text is even less likely, but as I said, it pays to be careful to make sure that your regular expressions aren’t making unintended changes.

Thanks for the help. I do have the SFM file for the TDX. However, I can’t get Notepad++ to recognize and find/replace expression. Error: Can’t find the text “(\d), (\d+:)”
I’ll try to play around with the TDX more to see if I can find a find/replace option. Otherwise do each one manually would be a very long process.

I don’t use Notepad++ so after reviewing the advanced find/replace features I found ‘regular expressions’. I enabled that, then the (\d)… expression was recognized. I think I was able to work through the expressions to replace commas and semicolons, etc. in the TDX. Now back to testing to make sure all is well throughout the file. Thanks again for your help.

Personally, I would prefer working with the DBL USX files than the TDX version (which has been modified for printing). Another advantage to using the DBL Bundle is that it should include all the correct copyright information which SAB will import.


Hi Chris

Thanks for comment. I just double checked the text bundle I have and the bundle only includes the full 66 books of the Bible. I don’t have any of the extra material that is found from My PT Projects. And I’ve already spilled many hours into the TDX file. The topical index is more or less complete now after many edits, and changes in order to turn the typeset file into a usable SAB file.

Note: I did not create the DBL text bundle but asked for it therefore I am using what I received. Maybe there were more options to tick that the person did not include when creating the text bundle.

Chris, I have been working with my project data for a few weeks now to massage the printed text to work more seamlessly with digital media (Android app). I have come to realize that app development is more in line with digital publishing. The project I’m working on has a printed Bible and I’m working to develop the app to accompany the printed text. What I’m realizing is the typesetter did a fine job for print but the files I’ve received (DBL text bundle) require some massaging of the files for digital publishing through SAB. Maybe this is a common practice…?

As pointed out, the text bundle I received had all 66 books but none of the extra material: Glo, TDX, timeline, etc. I had to pull those files from PT Projects as SFM files but they were there and what the typesetter used for print publication. However the TDX was a nightmare and took a full redo of the format for SAB to read it properly. I have encountered a number of items where print vs digital do not agree. Are other app developers finding this same issue with print vs digital issues when working with building apps?

To be honest, some of the issues aren’t deal breakers but it is more of polishing the car type of thing. I understand “mr” or Major References for printed text however SAB displays that marker in a way that really isn’t ideal for the user. Example: who wants to read the life of Abraham as multiple chapters from a “mr” reference lookup? I understand the developer as the option to display the reference as either popup or main window. To me as a reader, the “mr” isn’t meant to be a reference caller but a notifier to the reader that the next ‘x’ chapters are a major reference to this major title. Perhaps maybe feature request, to enable/disable ‘mr’ code from displaying in SAB?

Anyway, a bit of soap box, but I’ve just noticed that print vs digital publishing is quite a bit different and I’m sure it ranges from project to project. Just curious how SAB could better adopt files either USX, SFM, or other for app builders. Have you had experiences as such?