Required markers for italic text

We are working on a project that has many of the words that should be italic are not displayed correctly. The majority of the italicized words appear in the body of a footnote, but not all.

The text is marked as ‘\it word’ without the closing ‘\it*’. When this text was typeset, they were told the ‘\it*’ marker was unnecessary, as the closing footnote tag would correctly close the embedded ‘\it’ marker.

Here is a sample of the problem:

missing italic

The Scripture text follows:

\f + \fr 1:3 \fq Beloved of Allah: \ft a translation of the Greek word \it theophilos. \f*

Is there a setting in SAB that will close the tags automatically, or is the ‘\it*’ marker required in the Paratext file in order for the app to display the text correctly?

Thank you.

Your text is not correct USFM markup and needs to be fixed in Paratext, not just for use in SAB.

The correct USFM markup would be \+it text \+it*:

\f + \fr 1:3 \fq Beloved of Allah: \ft a translation of the Greek word \+it theophilos.\+it*\f*

The plus is needed because \ft is a character style and \it is a character style nested within the \ft. It is also not a footnote marker so can’t be handled in the same way as \fr, \fq or \ft with the implied closing of the marker etc.
e.g. \bd bold text \+it bold italic text\+it* more bold text\bd*
See Character Marker Nesting — Unified Standard Format Markers 3.0.0 documentation

Note:
No space is needed between the full stop and the \f*. This would add a trailing space to the footnote.

A question regarding your content: ‘Beloved of Allah’ - this is a mix of English with a transliteration of Arabic الله. For an English speaking audience you would say: beloved of God. Can you tell me for which audience this translation is?

Thanks for the information. I thought the \it* might be required, but didn’t know about the ‘+’ because of the nested markers.

This app is in a sensitive area, so I don’t think I’m at liberty to give more information.

Then let me not ask any more but say this about the expression ‘beloved of Allah’ which you use in English text as I understand it now, though not 100% sure:

we are not in a position to change the name of the most High and True God Who revealed Himself in the flesh, with the name Allah (note: in Arabic language ‘Allah’ it is not a name but a word usually pointing at the most High God, like Elohim usually is pointing at the most High). What I mean: we cannot substitute Dieu, God, Dios, Gott, Arebbi, Khuda, Tanri etc., in the languages where the words are part from, by ‘Allah’ because that means introducing an Arabic name into these languages, not a loanword, but a name! This name, if exported to other languages, is not like introducing a synonymous word into an other language, but it is introducing elements of the worship and the name of the deity that it represents. We probably all know what I am talking about. I think this is linguistically comprising with the false religion and the false god. Since I am not supposed to ask questions, I suggest, if I am right in my understanding of your work, that you come back from this compromising use of ‘allah’ and use ‘God’ instead, in case your work is in English or the note I am talking about is in English.

Note: in an Arabic Bible using ‘Allah’ is normal and perfectly allright, because the word is understood and has been part of the language since several thousands years by now, I think

Here is the explanation of Paratext conventions for formatting footnotes by Heidi Rosendall, who is Complex Script Layout Specialist for SIL’s Global Publishing Services and Language Technology and Publishing Coordinator for SIL Nigeria.

Character formatting is turned off by a closing marker with a * OR by turning on another character format. If you turn it off with the closing marker, e.g., \it*, then the following text will revert to the previous style. You do not want that in footnotes usually.

For example, footnotes begin with:
\f + \fr and then the text. If you start the \text with \it … \it* or \fq … \fq* or \fq … \fq* etc., then the closing marker will make the text revert to the previous format which in this case is \fr which is wrong.

So, in footnotes (or cross references), you just switch to the next style needed till you close it finally with \f* or \x*.

It seems that SAB does not currently recognize this formatting convention for footnotes.
Greg Cooper’s recommendations work as well in Paratext, but that won’t help the projects that have already used the simpler formatting conventions recommended by typographers. If SAB cannot handle those conventions, then teams will have to reformat all of their footnotes.

SAB does recognize this formatting (see below) i.e. implied closing of footnote markers mixed with absolute closing of nested other character markers. Heidi’s example does not involves the \ft marker (which would be required in her example) and is not relevant to this discussion. Please refer to the official USFM documentation as this defines correct USFM markup superseding Heidi’s comments (as well as my own).

The italic text is not separate from the \ft text. It is still \ft text. If the \it is not nested, you are marking up the text as no longer \ft text. Suggesting it be left un-nested would be encouraging incorrect use of USFM markup. Even \fv needs to be nested when used within \ft, \fk or \fq which is most like to always be the case.

Source text:

\f + \fr 6:3 \fk gees: \ft Dit verwys na die lewensasem wat die \+nd Here\+nd* aan die mens gee; vgl \+xt Gen 2:7; Ps 104:29\+xt*.\f*
\f + \fr 6:4 \fk reuse: \ft Sommige vertalings behou die Hebreeuse woord \+tl nefilim\+tl*.\f*

Result:

Thanks, Greg. I sent your original comment to Heidi, and she agreed it would be a better way to do this in the future. But the way she and others have been doing this works in Paratext and in the typesetting software, and my plea is that SAB recognize it as well, as a grandfather or legacy style. Indeed, Paratext does not make the plus option evident at all. If you select text and press backslash, not plus markers appear. If you select text and press backslash and then plus, they still don’t appear in the list. The person has to already know they exist and then enter them manually. So there is room for improvement in Paratext but also in SAB, so it can recognize existing ways of formatting footnotes and produce correctly formatted output, as Paratext is able to do.

The example BrianA gave shows the affected word at the end of the footnote, so it doesn’t show the style being closed by another character style. So I’ll use the example \ft word1 \it word2 \ft word3. Greg, you said that \ft cannot close a character style. The USFM discussion of nesting says, “All new character marker starts (without the + prefix) close all existing nesting.” Thus the \ft character should close the previous character style, whether nested or not, and that is how Paratext displays the formatting in the footnotes. So \ft word1 \it word2 \ft word3 is displayed by Paratext in formatted view (and in exported RTF) as “word 1 word2 word3.” Perhaps you meant that in the footnotes, SAB doesn’t let \ft close the previous character style. But in fact SAB does close the character style after \fqa. So \ft word1 \fqa word2 \ft word 3 is displayed in the mobile app as “word1 word2 word3.” The problem is with the way SAB outputs \ft word1 \it word2 \ft word3, namely as “word1 \ft word2 word 3.” This is clearly an error in SAB and specific to \it. (There were no examples of \bd or \tl or \nd.) Now unless SAB can be fixed, the workaround is to close the \it character styles in the footnotes with \it* or reformat the affected words as +it word2 +it*, as you suggested. Frankly, if the italicized word is surrounded by \ft words on both sides, or it ends the footnote, there should be no need for the plus sign, but it can easily be added with search and replace. However, the marker that closes the italics will need to be added manually in over a thousand places.

Not sure where I said that.

Let’s try explain it like this:

  1. Footnote text (inside a footnote \f ... \f*):
    \ft This is footnote text.\ft*

  2. Footnote text with nested text:
    (this could be \+nd, \+xt, \+add, etc.)
    \ft This is ... \+it (This is italics footnote text.)\+it* ... footnote text.\ft*

  3. Footnote text with non-footnote text:
    \ft This is footnote text. \it (This is italics text, but it is no longer footnote text.) \ft This is more footnote text.\ft*
    Paratext will accept this structure, but it is incorrect usage with footnotes (and cross references), so it will have issues when the text is laid out in print and when it is converted to digital formats (apps, EPUB, etc.) as experienced with SAB.

Any marker starting with \f__ is a footnote character style so it doesn’t need nesting. Everything else should be nested. (Same applies to \x__ in cross references.)

No. This is because of incorrect markup in Paratext. The solution is not a workaround. The solution is to fix the markup in Paratext.

Regex solution

Find:

(\\f[^ re*]+ [^\\]+\\)([^f][^ *]*)( [^\\]+)(\\f)

Replace:

\1+\2\3\\+\2*\4

Disclaimer: This should work in most cases but will need to be checked afterwards with the following find regex to see if anything was missed:

\\f[^ re*]+ [^\\]+\\[^f][^ *]*\s

Thanks for the further comment and the suggested solution. Much appreciated.

Dear Greg: I had already changed the markers in three books, so I tried using the regular expressions you suggested on the remaining books in Paratext, using its Regex Pal tool in the main menu, but the tool did not recognize the expressions. So I exited Paratext, opened the SFM files in NotePad++, and used your expressions there. They worked well. However, Paratext did show the changes I made with Notepad++, so I imported the books afresh. After that I used Paratext to replace the existing \it and \it* pairs in the footnotes to +it and |+it*. Thanks.