]> mj.ucw.cz Git - saga.git/commitdiff
Book style.
authorMartin Mares <mj@ucw.cz>
Mon, 21 Apr 2008 11:05:39 +0000 (13:05 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 21 Apr 2008 11:05:39 +0000 (13:05 +0200)
Makefile
concl.tex [deleted file]
epilog.tex [new file with mode: 0644]
intro.tex [deleted file]
macros.tex
pref.tex [new file with mode: 0644]
saga.tex

index 444f31227e5d6a5a5cad2343a3158018a4d30198..19a4feec04ebaaf7a469b9f3a87b2f48dbfd8664 100644 (file)
--- 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/concl.tex
deleted file mode 100644 (file)
index ffb159a..0000000
--- a/concl.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-\ifx\endpart\undefined
-\input macros.tex
-\fi
-
-\chapter{Conclusions}
-
-\endpart
diff --git a/epilog.tex b/epilog.tex
new file mode 100644 (file)
index 0000000..ffb159a
--- /dev/null
@@ -0,0 +1,7 @@
+\ifx\endpart\undefined
+\input macros.tex
+\fi
+
+\chapter{Conclusions}
+
+\endpart
diff --git a/intro.tex b/intro.tex
deleted file mode 100644 (file)
index b3abdc4..0000000
--- a/intro.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-\ifx\endpart\undefined
-\input macros.tex
-\fi
-
-\chapter{Preface}
-
-\endpart
index 3a734d87712883b650b6476015443e7c251e0577..b7f43851465e8b438812e34eb3d447a03afc45f5 100644 (file)
 \newcount\chapcount
 \newcount\seccount
 \newcount\thmcount
-\chapcount=-1
+\chapcount=0
 \seccount=0
 \thmcount=0
 \def\currentid{??}
 \bigskip
 }
 
+\def\unchapter#1{
+\rawchapter{#1}
+\writetoc{unchap}{#1}
+}
+
 \def\chapter#1{\advance\chapcount by 1
 \seccount=0
 \thmcount=0
   \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/pref.tex b/pref.tex
new file mode 100644 (file)
index 0000000..5597cc5
--- /dev/null
+++ b/pref.tex
@@ -0,0 +1,7 @@
+\ifx\endpart\undefined
+\input macros.tex
+\fi
+
+\unchapter{Preface}
+
+\endpart
index 581424306ff245cc13e65ceca04fd2d0bb959134..0b81d600f2477ab60092f18dd9d1ce044d817ebe 100644 (file)
--- 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
 \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