我有一个临时的变通方法。我注释掉上面的 .tex 行(使用“%”),然后在我的 PrintDraftChanges.txt 文件中添加以下内容:
'(?<!\\ft) *:( |\n)' > '\u202f:\1' # Place non-breaking thin space before colon
在我的特定情况下,我不想替换 \ft 标记后的空格(因为这会导致它不再工作),所以我在那里加了一个小的负向后行断言。而且冒号实际上可能出现在行尾,所以我必须查找冒号后的空格或换行符。
这之所以有效,是因为我在搜索字符串中添加了更多的上下文,从而避免了更改 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