docs/master
changeset 79:f3c95ee96cc4
Moved TOC from end to beginning; extended makefile.
The TOC generation concept and idea was inspired by the book
``UNIX Text Processing''.
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Wed, 06 Jun 2012 10:56:14 +0200 |
parents | 64f177ca2af1 |
children | be3e09c2181e |
files | .hgignore makefile style toc.roff |
diffstat | 4 files changed, 29 insertions(+), 22 deletions(-) [+] |
line diff
1.1 --- a/.hgignore Tue Jun 05 22:24:10 2012 +0200 1.2 +++ b/.hgignore Wed Jun 06 10:56:14 2012 +0200 1.3 @@ -8,4 +8,4 @@ 1.4 thesis-book.ps 1.5 thesis.pdf 1.6 1.7 -bib.ig 1.8 +*.ig
2.1 --- a/makefile Tue Jun 05 22:24:10 2012 +0200 2.2 +++ b/makefile Wed Jun 06 10:56:14 2012 +0200 2.3 @@ -1,13 +1,23 @@ 2.4 NAME = thesis 2.5 -CHAPS = style front.roff dedication.roff abstract.roff preface.roff \ 2.6 - ch*.roff refs.roff toc.roff 2.7 +CHAPS = style front.roff dedication.roff abstract.roff toc.roff \ 2.8 + preface.roff ch*.roff refs.roff 2.9 PDFFLAGS = -sPAPERSIZE=a4 -dPDFSETTINGS=/prepress 2.10 2.11 all: $(NAME).ps 2.12 2.13 $(NAME).ps: $(CHAPS) makefile bib 2.14 export TROFFONTS=fonts REFER=bib;\ 2.15 - cat $(CHAPS) | refer -e -P -sLAD -l,2 -k | troff -Tps -ms | dpost >$@ 2.16 + cat $(CHAPS) | refer -e -P -sLAD -l,2 -k | \ 2.17 + troff -Tps -ms 2>err.ig | dpost >$@ 2.18 + 2.19 +err.ig: $(CHAPS) 2.20 + export TROFFONTS=fonts REFER=bib;\ 2.21 + cat $(CHAPS) | refer -e -P -sLAD -l,2 -k | \ 2.22 + troff -Tps -ms -rZ1 -z 2>$@ 2.23 + 2.24 +toc.roff: toc.ig 2.25 +toc.ig: err.ig 2.26 + sed -n '/^TOC____/s///p' $< >$@ 2.27 2.28 pdf: $(NAME).pdf 2.29 $(NAME).pdf: $(NAME).ps 2.30 @@ -21,4 +31,4 @@ 2.31 2.32 clean: 2.33 rm -f $(NAME).ps $(NAME).pdf book.ps book.pdf 2.34 - rm -f bib.ig 2.35 + rm -f *.ig
3.1 --- a/style Tue Jun 05 22:24:10 2012 +0200 3.2 +++ b/style Wed Jun 06 10:56:14 2012 +0200 3.3 @@ -88,6 +88,11 @@ 3.4 . rs 3.5 .. 3.6 3.7 +.de T_ \" add entry to TOC: .T_ pre-space indent-level text 3.8 +.tm TOC____.sp \\$1 3.9 +.tm TOC____\&\\h'\\$2u*2u*\\n(PIu'\\$3\0\0\a\t\\n(PN\fR 3.10 +.. 3.11 + 3.12 .rm NH 3.13 .de NH 3.14 .SH 3.15 @@ -157,14 +162,9 @@ 3.16 . lg 3.17 .ds _C "\\$1 3.18 . RT 3.19 -. XS 3.20 -. sp .5v 3.21 -. B 3.22 -.ie \\n(.$=1 \{\ 3.23 -\\*(SN \\$1 3.24 -.\} 3.25 -.el .if ,\\$2,no, \&\\$1 3.26 -. XE 3.27 +.rm t_ 3.28 +.if !,\\$2,no, .ds t_ \\*(SN\0\0 3.29 +.T_ .5v 0 "\fB\\*(t_\\$1 3.30 .EH "\\\\*(_E 3.31 .ie \\n(H1 .OH "\\\\*(_O 3.32 .el .OH "\\\\*(_o 3.33 @@ -205,11 +205,8 @@ 3.34 . lg 3.35 . RT 3.36 .if !'\\$2'no' \{\ 3.37 -.ds _S "\\$1 3.38 -. XS 3.39 -. sp .3v 3.40 - \\*(SN \\$1 3.41 -. XE 3.42 +. ds _S "\\$1 3.43 +. T_ .3v 1 "\\*(SN\0\0\\$1 3.44 .\} 3.45 .nr PP 0 3.46 .. 3.47 @@ -222,9 +219,7 @@ 3.48 \\$1 3.49 .RT 3.50 .ds _S "\\$1 3.51 -.XS 3.52 - \\*(SN \\$1 3.53 -.XE 3.54 +.T_ 0 2 "\\*(SN\0\0\\$1 3.55 .nr PP 0 3.56 .. 3.57