memops is a simple plain-text to PostScript converter tool.
memops is implemented as a single Embedded Ruby (.erb) document which reads plain text from the standard input and writes the PostScript to standard output. However, because the percent symbol (%) actually has significance within PostScript, it is necessary to run erb
with the -P
option. For example:
$ erb -P memops.ps.erb < mynotes.txt > mynotes.ps
In case you don't like PostScript, or you NEED to give someone a PDF document, then you can use the handy ps2pdf
command which comes with the Ghostscript package:
$ erb -P memops.ps.erb < mynotes.txt | ps2pdf -sPAPERSIZE=letter - mynotes.pdf
With all that said, memops is, in reality, incredibly limited:
- The output is black-and-white 12-point Courier.
- Only one page of output is allowed. This is approximately equal to 55 lines of text.
- The paper must be letter sized. (8.5" by 11")
- The 1-inch margins are on by default.
- Word wrapping is not possible.
Therefore, your input text will usually have to be formatted before being sent to memops. Most implementations of the fmt(1)
command make text at most 65 characters long by default, which is perfect for memops:
$ fmt mynotes.txt | erb -P memops.ps.erb > mynotes.ps
Of course, you can also specify an alternative width if you wish:
$ fmt -w 40 mynotes.txt | erb -P memops.ps.erb > mynotes.ps
One last note. This software is so stupidly simple that I disclaim all copyright to it and release memops into the public domain.