我有一個暫時的變通方法。我註釋掉上面的 .tex 行(使用 “%”),然後將以下內容添加到我的 PrintDraftChanges.txt 檔案中:
'(?<!\\ft) *:( |\n)' > '\u202f:\1' # Place non-breaking thin space before colon
在我特定的情況下,我不希望替換 \ft 標記後面的空格(因為這樣會導致其不再起作用),所以我在那裡加入了一個小小的負向預查(negative look-behind)。而且冒號實際上可能出現在行尾,所以我必須尋找冒號後面的空格或換行符。
這之所以有效,是因為我在搜尋字串中增加了更多的上下文,從而避免了更改 PDF 檔案路徑中的冒號。
如果可能的話,我更希望找到另一種解決方案,因為我對 \u202f 的控制遠不如在 .tex 檔案中使用 \kern 命令那樣多。但這至少給我提供了一個粗略的近似值,讓我可以在排版中繼續前進。
I have a temporary word-around. I comment out the .tex line above (with “%”), then add the following into my PrintDraftChanges.txt file:
'(?<!\\ft) *:( |\n)' > '\u202f:\1' # Place non-breaking thin space before colon
In my particular case, I didn’t want to replace the space after the \ft marker (as it makes it not work anymore), so I put in a little negative look-behind there. And the colon can actual occur at the end of the line, so I have to look for either a space or a newline after the colon.
This works because I’m adding a little more context into the search string, so it avoids changing the colon in the PDF file path.
I would prefer to find another solution, if possible, since I don’t have nearly as much control with \u202f as I do with the \kern command in the .tex file. But this at least gives me a rough approximation, to move forward in my typesetting.
機器翻譯自 English