使用时groff
,pic
可以执行以下操作:
$ cat test.ms
.TL
Test
.NH 1
Test Header
.PS
circle
arrow
box
.PE
$ cat test.ms | groff -ms -p > test.ps
这会生成一个有效的test.ps
文件,其中包含pic
.
在较大的文档中,为了可维护性,可能需要将图片pic
描述保存在单独的文件中并从主.ms
文件中调用该文件。
在尝试使其正常工作时,我发现.so
可以提供外部文件,但我发现设置将外部.pic
文件嵌入主.ms
文件的配置存在问题,如下所示:
$ cat test2.pic
.PS
circle
arrow
box
.PE
$ cat test2.ms
.TL
Test
.NH 1
Test Header
.so test2.pic
$ cat test2.ms | groff -ms -p > test2.ps
test2.pic:1: macro error: bad arguments to PS (not preprocessed with pic?)
$
哪种方法可以.pic
将主宏.ms
文件中的代码包含为外部文件?
您需要添加soelim
预处理器,它将.so
通过包含实际文件来消除命令。
在您的情况下,这应该是(注意添加的-s
标志):
cat test2.ms | groff -ms -p -s > test2.ps
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句