Date: Tue, 12 Jun 2012 15:11:05 -0500 (CDT) From: Robert Bonomi <bonomi@mail.r-bonomi.com> To: freebsd@edvax.de, pwnedomina@gmail.com Cc: freebsd-questions@freebsd.org Subject: Re: text format Message-ID: <201206122011.q5CKB557038063@mail.r-bonomi.com> In-Reply-To: <4FD7A937.5030607@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> From owner-freebsd-questions@freebsd.org Tue Jun 12 14:39:59 2012 > Date: Tue, 12 Jun 2012 20:40:23 +0000 > From: pwnedomina <pwnedomina@gmail.com> > To: Polytropon <freebsd@edvax.de> > Cc: freebsd-questions@freebsd.org > Subject: Re: text format > > 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.. There *ISN'T* any simple command-line tool that will do what you want, all "automatically". You have to take the 'plain text' ASCII file, and embed 'mark-up' codes in it that describe *what* the desired actions are, and =where= the are to be applied. Then, and -ONLY- then, can you run the 'marked up' file through a 'formatter' function to produce the "pretty-printed', centered/aligned, output. There are basically -two- approaches to this kind of problem. One approach is a 'word processor', where you _interactively_ select` the visual effects you desire, and where to apply then. This includes programs like MS-Word, WordPerfect, OpenOffice, etc. The other approach is a 'text formatter' -- less intuitive than a 'word processor', but much better for large, _structured_, documents. In this situation, you embed codes that identify 'logical' units/sub-divisions of the document, and provide a 'style' specification as to how those various types of units should be rendered. A command-line program then takes the 'marked up' text, and the 'style' specification, and creates the 'formatted' output file.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206122011.q5CKB557038063>