While using groff and pic it is possible to do:
$ cat test.ms
.TL
Test
.NH 1
Test Header
.PS
circle
arrow
box
.PE
$ cat test.ms | groff -ms -p > test.ps
Which generates a valid test.ps file containing the processed figure in pic.
In larger documents, for mainteinability, it might be desirable to keep the picture pic description in a separate file and invoke such file from the main .ms file.
While trying to get this working I have found that .so can source an external file, but I am finding issues to set up this configuration of embeding external .pic files into the main .ms file as shown here:
$ 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?)
$
Which would be the way to achieve this inclusion of .pic code in the main macro .ms files as external files?
s, the parameter to-mhave? Your commands return:troff: fatal error: can't find macro file s-mstellsgroffto usemsmacro package. Notice that I am usinggroff. It might be thattroffhas a different syntax for usingmsmacros. I have noticed thattroffcan not invoke other arguments such as-p(preprocess with pic).PS <test2.picwhere it acts a bit like.so.