宏后逗号前避免 space
Avoid space before comma after macro
我正在尝试使用 Groff 的 man
宏包编写联机帮助页。具体来说,我想写一些像下面这样的文字:
The daemon can be configured by means of a configuration file. The default
location of such file is /etc/trolls.conf, and this is quite nice.
所需的文本属性:
/etc/trolls.conf
呈现为斜体
- 后面跟一个逗号不是斜体,
/etc/trols.conf
和逗号之间没有space。
能得到符合这种礼仪的文字真是太难了!
例如,以下将导致斜体逗号:
.SH DESCRIPTION
The daemon can be configured by means of a configuration file. The default
location of such file is
.I /etc/trolls.conf,
and this is quite nice.
另一方面,第二次尝试将在 /etc/trolls.conf
和罗马逗号之间放置一个 space:
.SH DESCRIPTION
The daemon can be configured by means of a configuration file. The default
location of such file is
.I /etc/trolls.conf
, and this is quite nice.
有什么方法可以让它工作吗?
这种排版语言非常难(好吧,它也非常古老),最终我通过查看现有的联机帮助页解决了这个问题!
解决方法如下:
.SH DESCRIPTION
The daemon can be configured by means of a configuration file. The default
location of such file is
.IR /etc/trolls.conf ,
and this is quite nice.
.IR
宏实际上会在斜体 (I
) 和罗马 (R
) 之间交替,从而产生正确的渲染效果:
我正在尝试使用 Groff 的 man
宏包编写联机帮助页。具体来说,我想写一些像下面这样的文字:
The daemon can be configured by means of a configuration file. The default location of such file is /etc/trolls.conf, and this is quite nice.
所需的文本属性:
/etc/trolls.conf
呈现为斜体- 后面跟一个逗号不是斜体,
/etc/trols.conf
和逗号之间没有space。
能得到符合这种礼仪的文字真是太难了! 例如,以下将导致斜体逗号:
.SH DESCRIPTION The daemon can be configured by means of a configuration file. The default location of such file is .I /etc/trolls.conf, and this is quite nice.
另一方面,第二次尝试将在 /etc/trolls.conf
和罗马逗号之间放置一个 space:
.SH DESCRIPTION The daemon can be configured by means of a configuration file. The default location of such file is .I /etc/trolls.conf , and this is quite nice.
有什么方法可以让它工作吗?
这种排版语言非常难(好吧,它也非常古老),最终我通过查看现有的联机帮助页解决了这个问题!
解决方法如下:
.SH DESCRIPTION The daemon can be configured by means of a configuration file. The default location of such file is .IR /etc/trolls.conf , and this is quite nice.
.IR
宏实际上会在斜体 (I
) 和罗马 (R
) 之间交替,从而产生正确的渲染效果: