gpt4 book ai didi

manpage - 宏后逗号前避免空格

转载 作者:行者123 更新时间:2023-12-02 15:33:28 24 4
gpt4 key购买 nike

我正在尝试使用 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 和逗号之间没有空格。

要获得满足这样的礼节的文本是非常困难的!例如,以下内容将产生斜体逗号:

.SH DESCRIPTIONThe daemon can be configured by means of a configuration file. The defaultlocation of such file is.I /etc/trolls.conf,and this is quite nice.

Result 1

另一方面,第二次尝试将在 /etc/trolls.conf 和罗马逗号之间放置一个空格:

.SH DESCRIPTIONThe daemon can be configured by means of a configuration file. The defaultlocation of such file is.I /etc/trolls.conf, and this is quite nice.

Result 2

有什么方法可以让它发挥作用吗?

最佳答案

这种排版语言非常困难(嗯,它也非常古老),最终我通过查看现有的联机帮助页解决了这个问题!

解决办法如下:

.SH DESCRIPTIONThe daemon can be configured by means of a configuration file. The defaultlocation of such file is.IR /etc/trolls.conf ,and this is quite nice.

.IR 宏实际上会在斜体 (I) 和罗马 (R) 之间交替,从而产生正确的渲染效果: good result

关于manpage - 宏后逗号前避免空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51939104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com