0

如果我想编写可在不同类 Unix 系统之间移植的手册页,我应该使用哪种源语言标准?或者我可以简单地假设 GNU troff (groff) 无处不在?

4

1 回答 1

0

如果您查看https://www.troff.org/macros.html,在 下man,它列出了编写手册页的两个指南。

一般来说,他们都建议避免使用额外的预处理器,例如tbl, pic,或者eqn特别是如果您想最大限度地提高可移植性。

手册页使用an宏包。-m当您使用显示为 的宏选项调用它时,这是这样做的troff -man。要查找由宏包定义的宏,您应该查找与(对于 UNIX/BSD 系统)或(对于 Linux 系统)an匹配的文件。例如,在 RHEL/CentOS 上,它将是:tmac.an*an*.tmac

/usr/share/groff/1.18.1.4/tmac/an.tmac which refers to
/usr/share/groff/1.18.1.4/tmac/andoc.tmac which refers to
/usr/share/groff/1.18.1.4/tmac/an-old.tmac which defines most of the macros

这些文件是 groff 包的一部分。

于 2018-07-23T16:29:51.277 回答