通过添加 id:GLO|,你已经指定了“仅在 GLO 书中”,因此使用另一个标记没有好处,除非你想以不同的方式格式化它。
即使你想在 GLO 中以不同的方式格式化 \m,你仍然可以保持 USFM 不变,并格式化标记 id:GLO|m。我建议使用特殊标记的唯一原因是,如果它本质上不是 \m。
顺便说一句,\penalty 应用于它遇到的确切位置,无论是水平方向(将文本行拆分为段落)还是垂直方向(将段落拆分为页面)。
由于在 \k 的末尾处于水平模式,在 \k 之后插入它表示“不要在这里开始新段落” 。然后 TeX 遇到 \p 或 \m,其定义中包含“如果我们处于水平模式,用指定的内容和 \penalty -10000 填充段落” ,因此它在那里断开(即使没有段落末尾填充,罚分也不累积,所以它会顺从地不在 10000 处断开,而是顺从地在 -10000 处断开)。
再顺便说一句,不要 受诱惑尝试创建一个钩子来尝试在字符样式后插入段落换行。我尝试了好几种方法,得出的结论是,如果你要求它在处理字符样式末尾时设置新段落,代码会真的非常非常混乱。
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.
机器翻译自 English 显示原文