* [TUHS] It is time to modernise "groff"
@ 2017-09-05 11:37 Doug McIlroy
2017-09-05 13:27 ` Steve Simon
2017-09-05 14:14 ` Larry McVoy
0 siblings, 2 replies; 4+ messages in thread
From: Doug McIlroy @ 2017-09-05 11:37 UTC (permalink / raw)
> > p) Remove the '-a' option (the ASCII approximation output).
>
> I didn't even know this existed. Looking at what it spits out, I find
> myself wondering what good it is. Is this for Unix troff compatibility?
> For people who didn't even have glass TTYs and needed to imagine what
> the typeset output would look like?
Here's a classic use:
Since groff is not WYSIWYG, the experimental cycle is long:
edit - save - groff - view. In many cases that cycle can be
short-circuited by typing straight into groff -a.
doug
^ permalink raw reply [flat|nested] 4+ messages in thread
* [TUHS] It is time to modernise "groff"
2017-09-05 11:37 [TUHS] It is time to modernise "groff" Doug McIlroy
@ 2017-09-05 13:27 ` Steve Simon
2017-09-05 14:40 ` Larry McVoy
2017-09-05 14:14 ` Larry McVoy
1 sibling, 1 reply; 4+ messages in thread
From: Steve Simon @ 2017-09-05 13:27 UTC (permalink / raw)
On 5 Sep 2017, at 12:37, Doug McIlroy <doug at cs.dartmouth.edu> wrote:
>>> p) Remove the '-a' option (the ASCII approximation output).
>>
>> I didn't even know this existed. Looking at what it spits out, I find
>> myself wondering what good it is. Is this for Unix troff compatibility?
>> For people who didn't even have glass TTYs and needed to imagine what
>> the typeset output would look like?
>
> Here's a classic use:
>
> Since groff is not WYSIWYG, the experimental cycle is long:
> edit - save - groff - view. In many cases that cycle can be
> short-circuited by typing straight into groff -a.
>
> doug
i take a different approach.
i try to minimise the number of edit, troff, view cycles by typing as much of the text in as i can before viewing, relying on troff, tbl, and friends to make it look good.
this stops me from being distracted by layout and keeps me on the important stuff - the content.
the fact that troff is slower to display proofs than a WYSIWYG editor is, IMHO, a positive advantage.
-Steve
^ permalink raw reply [flat|nested] 4+ messages in thread
* [TUHS] It is time to modernise "groff"
2017-09-05 13:27 ` Steve Simon
@ 2017-09-05 14:40 ` Larry McVoy
0 siblings, 0 replies; 4+ messages in thread
From: Larry McVoy @ 2017-09-05 14:40 UTC (permalink / raw)
So for those who want WYSIWYG this little script helps. I call it "g"
and you run it like so
g groff -ms -t my_tables.ms
in a terminal (or use &) and it will pop up gv on the processed file[s].
It sits in a loop and stats all the files and if any have changed it
reruns the roff and tells gv.
--
---
Larry McVoy lm at mcvoy.com http://www.mcvoy.com/lm
-------------- next part --------------
#!/usr/bin/perl
# Run the command into PS
# Run gv with the -watch option
# go into a loop watching the file and rerun command whenever the file
# has changed.
use POSIX ":sys_wait_h";
$usage = "usage: $0 comand -args -args file [file ...]\n";
foreach $file (@ARGV) {
next unless -f $file;
push(@files, $file);
}
die $usage unless $#files > -1;
$cmd = "@ARGV > PS.$ENV{USER}";
$gv = "gv -spartan -antialias PS.$ENV{USER}";
$gv = "gv --spartan --antialias --media=letter PS.$ENV{USER}";
system "$cmd";
$pid = fork;
if ($pid == 0) {
exec $gv;
die $gv;
}
# Read all the files looking for .so's so we catch the implied list.
# I dunno if groff catches nested .so's but we don't.
foreach $file (@files) {
$stat{$file} = (stat($file))[9];
open(F, $file);
while (<F>) {
next unless /^\.so\s+(.*)\s*$/;
$stat{$1} = (stat($1))[9];
}
close(F);
}
while (1) {
select(undef, undef, undef, .2);
$kid = waitpid($pid,&WNOHANG);
exit 0 if (kill(0, $pid) != 1);
$doit = 0;
foreach $f (keys %stat) {
if ($stat{$f} != (stat($f))[9]) {
$stat{$f} = (stat($f))[9];
$doit = 1;
}
}
if ($doit) {
system $cmd;
kill(1, $pid);
}
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [TUHS] It is time to modernise "groff"
2017-09-05 11:37 [TUHS] It is time to modernise "groff" Doug McIlroy
2017-09-05 13:27 ` Steve Simon
@ 2017-09-05 14:14 ` Larry McVoy
1 sibling, 0 replies; 4+ messages in thread
From: Larry McVoy @ 2017-09-05 14:14 UTC (permalink / raw)
On Tue, Sep 05, 2017 at 07:37:16AM -0400, Doug McIlroy wrote:
> > > p) Remove the '-a' option (the ASCII approximation output).
> >
> > I didn't even know this existed. Looking at what it spits out, I find
> > myself wondering what good it is. Is this for Unix troff compatibility?
> > For people who didn't even have glass TTYs and needed to imagine what
> > the typeset output would look like?
>
> Here's a classic use:
>
> Since groff is not WYSIWYG, the experimental cycle is long:
> edit - save - groff - view. In many cases that cycle can be
> short-circuited by typing straight into groff -a.
If that is the one that makes pic try to do stuff in ascii I've used
that a lot in the days of yore.
I've found, maybe it's no longer true, but back when I was at Sun 25
years ago, that I got farther with execs if I formatted my stuff two
ways: as postscript (or PDF today) and as ascii. I would send the
ascii version with a header that said "Read this, this is what I
was babbling about, there is a printable version attached".
It was crazy but my influence with the execs went way up and I came
to the conclusion they didn't read attachments.
That's probably all changed, everyone has a mailer that formats
html and people send their stuff that way.
But there's another use for -a.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-05 14:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 11:37 [TUHS] It is time to modernise "groff" Doug McIlroy
2017-09-05 13:27 ` Steve Simon
2017-09-05 14:40 ` Larry McVoy
2017-09-05 14:14 ` Larry McVoy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).