See at end.
On 31-Mar-10 16:21:55, Ted Harding wrote:
On 30-Mar-10 19:48:49, Srdjan Todorovic wrote:
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?
It tokk something like an hour to an hour and a half all told. It was typed in by hand. I did it piece-meal, looking at the original graphic, identifying its component objects (mainly "box"es) with different attributes, and typing in a description of them one by one. Hence all the repetition. Then there was a certain amount of tweaking of detail to improve the result. It was all done "by eye" with a little trial and error to get proportions and layout looking roughly right.
Reminds me a little of LaTeX...
Only a little (likewise for troff). The pic stuff is more like Turtle Graphics!
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
I'll send you (privately) the .tr file with explanatory comments later. I'm happy you were pleased with the result!
Ted.
For the sake of anyone else who would like to see how it was done, I've put a copy of the file I sent earlier to Srdjan (but with some tpose corrected and a little bit added) on the above web-page, which now contains files:
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) tcpheader_howto.pdf
the last one being a detailed explanation of how the pic code in tcpheader.tr works.
For reference, the original diagram which Srdjan posted is at
http://www.wtcs.org/snmp4tpc/images/TCP-Header.jpg
and is "replicated" by me in the file tcpheader.ps/pdf
Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) Ted.Harding@manchester.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 01-Apr-10 Time: 00:00:59 ------------------------------ XFMail ------------------------------