Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在编写 UNIX 手册页时,我意识到某些短语出现了多次。我想定义一次并重用它(而不是通过编辑器复制)。我看到我可以将变量 ( .ds) 用于多行文本,但是当短语包含点命令 (如.B foo) 时它会失败。是否有解决方案(除了包含文件和 C 预处理器)?
.ds
.B foo
您可以将多行文本变成宏。缺点是要插入它,您必须调用宏而不是插入字符串。
.de Us The usage example is .B very important .. Text text text .Us more text more text
如果您只需要在字符串中加粗,则可以包括字体更改:
.ds Us You can use \fB bold \fR text in your strings \ and it will work fine text text \*(Us