2

I have a file with the following heading:

.PS
.ps 8.5

boxht = 1/6
boxwid = 0.3

moveht = 1/12
movewid = 0.15

linethick = 0

It looks like a troff file, at least that's what Linux file tells me (I have not been able to simply open it with, say, Evince). However, if I simply groff -Tps somefile > somefile.ps, it simply gives me the text of the file: it does not create the ps file following the code in it.

The question is, how do I convert this type of file into ps or pdf?

Dervin Thunk
  • 19,515
  • 28
  • 127
  • 217

1 Answers1

3

You have to tell groff which set of macros to use in formatting the document. For example, man-pages use the "an" macros, with the command-line option "-man".

To see what macros would apply, you have to look at more than just the slice that you have quoted. xterm for instance has a file (ctlseqs.ms) which is formatted using the "s" ("-ms") macros.

The "-Tps" option may be redundant; most groff configurations appear to default to PostScript output.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • Thanks. I ran `grog` and it told me `groff -t file` Anyway, accepted. – Dervin Thunk Feb 21 '15 at 13:32
  • I had forgotten about grog - though it is simplistic, basically starting with all possibilities and discarding ones that do not fit. For ctlseqls.ms, it offers all: "groff -t -man -ms ctlseqs.ms" – Thomas Dickey Feb 21 '15 at 14:24