1,089 karma · joined March 1, 2007
C, Unix system and shell, Python, X Windows, ARM, ...
I do write my own macros. They can be just short-hands for a combination of others in the same way my ~/bin/l is exec ls -l "$@", or sometimes for a simple document I start with just troff and have some macros on top of that. Yes, any distinction over semantics is purely convention.
You may wish to read Kernighan's _Nroff/Troff User's Manual_, http://troff.org/54.pdf, otherwise known as CSTR #54. It's original troff, not groff, but as a succinct reference with elegant prose we often refer back to it. At the end is a tutorial introducing simple macros.
Integrating troff and friends in pipelines and scripts is easy. They take line-based text as input and produce it as output, only switching to binary for some output formats at the last hop. You can also run system(3) from within troff documents, e.g. to include the output of a command, but often that's not the easiest fit.
I recommend again the groff@gnu.org list; they're friendly, patient with newcomers, and interested in showing how they tackle the task at hand.
troff and friends were developed on Unix in its early days by the originators of Unix and it shows in what a good fit they are to the environment and in their elegance; they are Unix programs. TeX was born outside of Unix; it runs on Unix.
Gunnar's Heirloom troff has TrueType support. "troff can access PostScript Type 1, OpenType, and TrueType fonts directly, that is, it can read font metrics from AFM, OpenType, or TrueType files, and can instruct its dpost post-processor to include glyph data from PFB, PFA, OpenType, and TrueType files into the output it generates". http://heirloom.sourceforge.net/doctools.html
sed '1s/.*/0/; s/;[^;]*$//; s///; s/.*;//
s/00$//; s/:..$/+1++/; s/:$/++/; s/:/ 60*/; $s/$/p/' |
dc awk 'NR > 3 && !/foo/ {s += $(NF - 2)} END {print NR, s + 0}' awk -F\; '
$7 != "Duration" {
split($7, t, ":")
s += t[1] * 60 + t[2] + (t[3] != 0)
}
END {print s + 0}
'
Note the handling of s == "" in END. $ printf 'Hello ①②③\n' | preconv
.lf 1 -
Hello \[u2460]\[u2461]\[u2462]
$ printf 'Hello ①②③\n' | groff -k -Tutf8 | grep .
Hello ①②③
$ (head -5; tail -5) <data
but that's a bit misleading. These don't work. seq 20 | (head -5; tail -5)
(head -5; tail -5) < <(seq 20)
Both giving just the first five lines.The Archimedes had ARM 2 BTW, ARM 1 was just in the Tube co-processor for the BBC B. Some instructions are different with the RasPi, mainly to do with the PC register no longer having bits spare for Negative, Carry, etc. http://www.heyrick.co.uk/assembler/32bit.html has more details. There are external programs that detect and trap old 26-bit instructions when on 32-bit RO and allow old games to run but I know little about them; my last Acorn ARM machine was their R140 running RISC iX (a BSD port).