docs/master
changeset 151:ff3a6a0e6255
Added system for references within the document. Macros: .Id and .Cf.
``.Id foo'' places a marker at that place.
``.Cf foo'' puts the section number of the marked place there.
``.Cf foo.page'' puts the page number of the marked place there.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Fri, 06 Jul 2012 14:59:08 +0200 |
parents | 472aa79f9b6f |
children | 1b9bdc178610 |
files | .hgignore makefile style |
diffstat | 3 files changed, 19 insertions(+), 3 deletions(-) [+] |
line diff
1.1 --- a/.hgignore Fri Jul 06 10:13:55 2012 +0200 1.2 +++ b/.hgignore Fri Jul 06 14:59:08 2012 +0200 1.3 @@ -9,3 +9,4 @@ 1.4 thesis.pdf 1.5 1.6 *.ig 1.7 +refs/
2.1 --- a/makefile Fri Jul 06 10:13:55 2012 +0200 2.2 +++ b/makefile Fri Jul 06 14:59:08 2012 +0200 2.3 @@ -7,7 +7,7 @@ 2.4 2.5 all: $(NAME).ps 2.6 2.7 -$(NAME).ps: $(CHAPS) makefile bib rfcs toc.ig 2.8 +$(NAME).ps: $(CHAPS) makefile bib rfcs toc.ig refs 2.9 export TROFFONTS=fonts;\ 2.10 soelim $(CHAPS) | $(REFER) | \ 2.11 grap | pic | troff -Tps -ms 2>err.ig | dpost >$@ 2.12 @@ -20,6 +20,13 @@ 2.13 toc.ig: err.ig 2.14 sed -n '/^TOC____/s///p' err.ig >$@ 2.15 2.16 +refs: err.ig 2.17 + awk '/^REF____/{ \ 2.18 + sub(/^REF____/,""); \ 2.19 + printf $$2 >"refs/"$$1; close("refs/$$1"); \ 2.20 + printf $$3 >"refs/"$$1".page"; close("refs/$$1.page");\ 2.21 + }' err.ig 2.22 + 2.23 pdf: $(NAME).pdf 2.24 $(NAME).pdf: $(NAME).ps 2.25 ps2pdf $(PDFFLAGS) $(NAME).ps 2>/dev/null 2.26 @@ -32,6 +39,7 @@ 2.27 2.28 clean: 2.29 rm -f $(NAME).ps $(NAME).pdf book.ps book.pdf 2.30 + rm -f refs/* 2.31 rm -f *.ig 2.32 2.33 spell:
3.1 --- a/style Fri Jul 06 10:13:55 2012 +0200 3.2 +++ b/style Fri Jul 06 14:59:08 2012 +0200 3.3 @@ -410,6 +410,13 @@ 3.4 .CW "\\*(_t" "]\\$2 3.5 .. 3.6 3.7 -.de Cf \" cf. (ref within document) 3.8 -(\(-> \\$1)\\$2 3.9 +. \" Cf - reference within the document ($1=name of ref file) 3.10 +.de Cf 3.11 +\.if !\\nZ .so refs/\\$1 \c 3.12 +\\$2 3.13 .. 3.14 + 3.15 +. \" Id - put a referenceable marker here ($1=identifier) 3.16 +.de Id 3.17 +.tm REF____\\$1\t\\*(SN\t\\n(PN 3.18 +..