En ajoutant id:GLO|, vous spécifiez déjà « uniquement dans le livre GLO », il n’y a donc aucun avantage à utiliser un autre marqueur, sauf si vous souhaitez le formater différemment.
Même si vous souhaitez formater \m différemment dans GLO, vous pouvez laisser l’USFM inchangé et formater le marqueur id:GLO|m La seule raison pour laquelle j’utiliserais un marqueur spécial serait s’il ne s’agit pas « fondamentalement » d’un \m.
À titre d’information, \penalty s’applique exactement à l’endroit où il est rencontré, que ce soit en mode horizontal (casser une ligne de texte en paragraphes) ou vertical (casser des paragraphes en pages).
Comme à la fin du \k, nous sommes en mode horizontal, l’insérer après le \k signifie « ne pas commencer un nouveau paragraphe ici ». TeX rencontre ensuite le \p ou le \m, dont la définition inclut « Si nous sommes en mode horizontal, remplir le paragraphe avec ce qui a été spécifié et \penalty -10000 », et il casse donc à cet endroit (même s’il n’y avait pas de remplissage de fin de paragraphe, les pénalités ne sont pas cumulatives, donc il ne casserait pas à 10000 et casserait à -10000).
À titre d’information 2, ne vous laissez pas tenter d’essayer de créer un hook pour insérer une coupure de paragraphe après un style de caractère. J’ai essayé de plusieurs manières et j’ai conclu que cela rend le code vraiment très confus si vous lui demandez de mettre en place un nouveau paragraphe pendant qu’il traite la fin d’un style de caractère.
By adding the id:GLO| you are already specifying ‘only in the GLO book’, so there’s no benefit to using another marker, unless you want to format it differently.
Even if you want to format \m differently in GLO, you can still leave the USFM unchanged, and format the marker id:GLO|m The only reason I’d use a special marker would be if it’s not a \m ‘at heart’.
FWIW, \penalty applies at exactly the place it’s met, whether that’s in horizontal (breaking a line of text into paragraphs) or vertical (breaking paragraphs into pages).
Since at the end of the \k it’s in horizontal mode, inserting it after the \k says ‘don’t start a new paragraph here’. TeX then meets the \p or \m which includes in its definition “If we are in horizontal mode, fill the paragraph with whatever has been specified and \penalty -10000”, and so it breaks there instead (even if there were no end-of-par fill, penalties are not cumulative, so it would obediently not break at the 10000 and obediently break at the -10000).
FWIW2, Don’t get tempted to try to make a hook to try to insert a paragraph break after a character style. I tried it several ways, and concluded that it just gets the code really really confused if you ask it to set up a new paragraph while it’s processing the end of a character style.
Traduit automatiquement depuis English