text format

Lars Eighner lars at larseighner.com
Tue Jun 12 21:34:15 UTC 2012

On Tue, 12 Jun 2012, pwnedomina wrote:

> On 12-06-2012 08:22, Polytropon wrote:
>> On Tue, 12 Jun 2012 09:06:07 +0100, i pwn wrote:
>>> on groff i've used this cmd to format the text
>>> groff -Tascii<  normal.txt | sed 's/^/	/'$1>  formatted.txt
>>> on nroff what would be the cmd?
>> Depending on your input data, I'd say the same command:
>> groff -Tascii<  normal.txt>  formatted.txt. But you need
>> to test this yourself with your input text format.
>> See "man nroff" for details.
>> For using roff macros, "man 7 mdoc" has a nice summary.
> im only asking what cmd should i use to format an ascii text to be identical 
> to that one, centered and aligned..

I do not believe there is one.  It seems to me there were some DOS
"amusement" programs that would do this, and you might find one and run it
in dosbox.  There is very little demand for fully justified monospaced text
because it is extremely ugly, hard to read, and error prone.  Nonetheless,
OpenOffice appears able to do this and so can MS-Word.  I suspect many
others can without the necessity of writing your own macro.  There may be
modules in perl and other scripting languages that might be helpful.

Rivers are very difficult to avoid, but as Matthew suggests, you might start
with fmt and fix up the output with whatever scripting language you know. 
If you could find a good hyphenation routine you might get better results.

Lars Eighner
8800 N IH35 APT 1191 AUSTIN TX 78753-5266

More information about the freebsd-questions mailing list