From f76518370c437b42604c7c2c5ef56df95d471b32 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 21 Apr 2008 13:05:39 +0200 Subject: [PATCH] Book style. --- Makefile | 9 ++++++--- concl.tex => epilog.tex | 0 macros.tex | 17 ++++++++++++++--- intro.tex => pref.tex | 2 +- saga.tex | 11 ++++++----- 5 files changed, 27 insertions(+), 12 deletions(-) rename concl.tex => epilog.tex (100%) rename intro.tex => pref.tex (73%) diff --git a/Makefile b/Makefile index 444f312..19a4fee 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,12 @@ all: saga.ps -CHAPTERS=cover intro mst ram adv opt dyn appl rank concl notation +CHAPTERS=cover pref mst ram adv opt dyn appl rank epilog notation %.dvi: %.tex macros.tex biblio.bib - tex $< && bibtex $* && tex $< && tex $< + tex $< && mv $*.toc $*.tok + bibtex $* + tex $< && mv $*.toc $*.tok + tex $< && mv $*.toc $*.tok saga.dvi: $(addsuffix .tex,$(CHAPTERS)) @@ -14,7 +17,7 @@ saga.dvi: $(addsuffix .tex,$(CHAPTERS)) dvipdfm -o $@ -p a4 -r 600 -z 9 $< mostlyclean: - rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg *.ids *.toc + rm -f *.dvi *.log *~ core *.o *.aux *.bbl *.blg *.ids *.toc *.tok clean: mostlyclean rm -f *.ps *.pdf diff --git a/concl.tex b/epilog.tex similarity index 100% rename from concl.tex rename to epilog.tex diff --git a/macros.tex b/macros.tex index 3a734d8..b7f4385 100644 --- a/macros.tex +++ b/macros.tex @@ -323,7 +323,7 @@ \newcount\chapcount \newcount\seccount \newcount\thmcount -\chapcount=-1 +\chapcount=0 \seccount=0 \thmcount=0 \def\currentid{??} @@ -333,6 +333,11 @@ \bigskip } +\def\unchapter#1{ +\rawchapter{#1} +\writetoc{unchap}{#1} +} + \def\chapter#1{\advance\chapcount by 1 \seccount=0 \thmcount=0 @@ -404,13 +409,19 @@ \tocfalse } +\newwrite\tok \def\includetoc{ -\immediate\closeout\toc -\input \jobname.toc +\immediate\openin\tok=\jobname.tok +\ifeof\tok +\else +\input \jobname.tok +\fi +\immediate\closein\tok } \def\tocchap#1#2#3{\smallskip\line{\bo #1.~~#2 \dotfill ~#3}} \def\tocsec#1#2#3{\line{#1.~~#2 \dotfill ~#3}} +\def\tocunchap#1#2#3{\smallskip\line{\bo #2 \dotfill ~#3}} %%% References %%% diff --git a/intro.tex b/pref.tex similarity index 73% rename from intro.tex rename to pref.tex index b3abdc4..5597cc5 100644 --- a/intro.tex +++ b/pref.tex @@ -2,6 +2,6 @@ \input macros.tex \fi -\chapter{Preface} +\unchapter{Preface} \endpart diff --git a/saga.tex b/saga.tex index 5814243..0b81d60 100644 --- a/saga.tex +++ b/saga.tex @@ -2,7 +2,11 @@ \let\endpart=\relax \input cover.tex -\input intro.tex +\input pref.tex + +\unchapter{Table of contents} +\includetoc + \input mst.tex \input ram.tex \input adv.tex @@ -10,13 +14,10 @@ \input dyn.tex \input appl.tex \input rank.tex -\input concl.tex +\input epilog.tex \input notation.tex \chapter{Bibliography} \dumpbib -\rawchapter{Table of contents} -\includetoc - \bye -- 2.39.2