Hi,
On 29/03/2010, Ted Harding Ted.Harding@manchester.ac.uk wrote:
As illutration, I've done your second one http://www.wtcs.org/snmp4tpc/images/TCP-Header.jpg using pic+groff. I've put the results on
http://www.zen89632.zen.co.uk/Misc
files: tcpheader.tr (text input troff, almost entirely pic language) tcpheader.ps (PostScript output from the first, produced by groff) tcpheader.pdf (PDF converted from PS using pstopdf)
Wow! You did a great job of duplicating that. How long did it take? Did you just manually type the text into the .tr file or was there a tool you used?
Reminds me a little of LaTeX...
This was not the neatest way to do it. There is a lot of repetition in the ".tr" file (and there's quite a bit in the graphic as well). If I were doing this for a repeated type of job job (or just to make the source look nicer), I'd encapsulate much of it in macros.
Yes macros would be nice. So would perhaps some form of introspection in a program that can generate troff from a struct would be great.
I'll have to study your troff source more to figure out exactly how that works.
Thanks for the idea! :)
Srdjan