Fixed single chapter tex files and Makefiles
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
BASENAME=programmingstyle
|
||||
|
||||
#TEXFILES=programmingstyle.tex
|
||||
|
||||
PYFILES=$(wildcard *.py)
|
||||
PYPDFFILES=$(PYFILES:.py=.pdf)
|
||||
|
||||
@@ -11,6 +9,9 @@ all : pdf
|
||||
pdf : $(BASENAME)-chapter.pdf
|
||||
|
||||
$(BASENAME)-chapter.pdf : $(BASENAME)-chapter.tex $(BASENAME).tex $(PYPDFFILES) ../../header.tex
|
||||
CHAPTER=$$(( $$(sed -n -e '/contentsline {chapter}/{s/.*numberline {\([0123456789]*\)}.*/\1/; p}' $(BASENAME).aux) - 1 )); \
|
||||
PAGE=$$(sed -n -e '/contentsline {chapter}/{s/.*numberline {.*}.*}{\(.*\)}{chapter.*/\1/; p}' $(BASENAME).aux); \
|
||||
sed -i -e "s/setcounter{page}{.*}/setcounter{page}{$$PAGE}/; s/setcounter{chapter}{.*}/setcounter{chapter}{$$CHAPTER}/" $(BASENAME)-chapter.tex
|
||||
pdflatex -interaction=scrollmode $< | tee /dev/stderr | fgrep -q "Rerun to get cross-references right" && pdflatex -interaction=scrollmode $< || true
|
||||
|
||||
$(PYPDFFILES) : %.pdf : %.py
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
\documentclass[12pt]{report}
|
||||
\documentclass[12pt]{book}
|
||||
|
||||
\input{../../header}
|
||||
|
||||
\lstset{inputpath=../code}
|
||||
|
||||
\graphicspath{{figures/}}
|
||||
|
||||
\setcounter{page}{57}
|
||||
\setcounter{chapter}{2}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\begin{document}
|
||||
|
||||
\include{programmingstyle}
|
||||
\input{programmingstyle}
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user