我正在處理一個高棉文(Khmer)專案,他們希望 \nd 能夠加上底線。問題在於,「主」(lord)這個詞的第一個字母有很深的下伸部(descender)。如果底線放得足夠低以至於位於下伸部下方,那麼它距離大多數文字就太遠了,特別是在 \nd 用於沒有下伸部的詞語時更是如此。其實我已經簡化了這個問題,因為視覺上的「第一個字母」實際上在字串中是第 4 個字符,這要歸功於高棉文 Unicode 重排規則的複雜性。
\nd ប៉្រ័ះ ប៊កកាតយ័\nd*
為了簡單起見,我改用英文來演示,我使用 changes.txt 將
\nd god Yahweh\nd* 改為
god\zul\u0332\zul*\nd\ Yahweh\nd*。
\zul 樣式會縮小字體大小並將拉伸(stretch)設置為 200%,這樣單個 \u0332 字符就能完美地為「god」中的「o」和「d」加上底線,同時跳過「g」。
「Yahweh」前面的 "\ "(斜槓加空格)會導致 \nd 為「god」和「Yahweh」之間的空格加上底線,所以一切運作得非常好——直到我遇到一個使用 \p^95 記法縮小的段落,這似乎將我的 \zul 樣式的拉伸重置為 100%,導致只有「god」的最後一個字母被加上底線。
理想的情況是有一個複選框,可以讓底線在所有下伸部處中斷,但快速搜索後我認為這在 TeX 中並不是一件簡單的事。
我覺得我在 49 英里前就走錯了路,現在正在尋找其他建議。
我該如何為 ប៉្រ័ះ ប៊កកាតយ័ 這些詞加上漂亮的底線——並且也能適用於 អាញ់ 這個詞?
I’m working with a Khmer script project in which they want \nd to be underlined. The trouble is that the first letter of the word meaning “lord” has a deep descender. If the underline is placed low enough to be below the descender then it’s just too far from the majority of the text, especially in cases where \nd is used on a word without a descender. I’m actually simplifying the problem, since the “first letter” visually is actually the 4th character in the string, due to the beauty of Khmer Unicode re-ordering rules.
\nd ប៉្រ័ះ ប៊កកាតយ័\nd*
Substituting English to keep it simple, I used changes.txt to change
\nd god Yahweh\nd* to
god\zul\u0332\zul*\nd\ Yahweh\nd*.
The \zul style reduces the font size and sets stretch to 200% so that the single \u0332 character nicely underlines both the “o” and “d” of “god”, while skipping the “g”.
The "\ " (slash space) before “Yahweh” causes \nd to underline the space between “god” and “Yahweh”, so it all worked beautifully—until I got to a paragraph which I’d shrunk using the \p^95 notation, which seems to reset to 100% the stretch on my \zul style, leaving only the last letter of “god” underlined.
Ideal would be a check box to cause underlining to dropout at all descenders, but a quick search leads me to believe that this is not a simple thing in TeX.
I feel like I took a wrong turn 49 miles ago and I’m looking for some other suggestions.
How can I make a nice underline of the words ប៉្រ័ះ ប៊កកាតយ័ — and something that will also work for the word អាញ់?
機器翻譯自 English