Skip to content

Commit

Permalink
Refine Makefile and rename the test tex source file to temptest.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
weijianwen committed Jan 7, 2016
1 parent b936076 commit 9e5242f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.bak
*.aux
*.log
*.lot
Expand Down
60 changes: 34 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# Makefile for sjtu-thesis-template-latex

# SED tool
SED := gsed
SED = gsed
# Basename of thesis
THESISMAIN := diss
THESISMAIN = diss
# Test file
TESTFILE := test
TESTFILE = temptest
# pdf viewer: evince/open
VIEWER := open
VIEWER = open
# version number, which can be specified when calling make like
# make VERSION="0.5.2"
VERSION = 0.5.2

all: $(THESISMAIN).pdf

all: pdf
.PHONY : all clean version distclean cleantest release

pdf: $(THESISMAIN).pdf
$(THESISMAIN).pdf : $(THESISMAIN).tex body/*.tex reference/*.bib *.cls *.cfg
xelatex -no-pdf --interaction=nonstopmode $(THESISMAIN) &> /dev/null
-bibtex $(THESISMAIN) &> /dev/null
xelatex -no-pdf --interaction=nonstopmode $(THESISMAIN) &> /dev/null
xelatex --interaction=nonstopmode $(THESISMAIN) &> /dev/null

$(THESISMAIN).pdf: $(THESISMAIN).tex body/*.tex reference/*.bib *.cls *.cfg
xelatex -no-pdf --interaction=nonstopmode $(THESISMAIN)
-bibtex $(THESISMAIN)
xelatex -no-pdf --interaction=nonstopmode $(THESISMAIN)
xelatex --interaction=nonstopmode $(THESISMAIN)
view : $(THESISMAIN).pdf
$(VIEWER) $< &

view: $(THESISMAIN).pdf
$(VIEWER) $(THESISMAIN).pdf &

clean:
clean :
-@rm -f \
*~ \
*.aux \
Expand All @@ -50,20 +52,26 @@ clean:
body/*.aux \
body/x.log

distclean: clean
distclean : clean
-@rm -f $(THESISMAIN).pdf

test: $(TESTFILE).tex
xelatex $(TESTFILE)
$(VIEWER) $(TESTFILE).pdf
test : $(TESTFILE).pdf

$(TESTFILE).pdf : $(TESTFILE).tex
xelatex $(TESTFILE) > /dev/null
$(VIEWER) $@

cp: $(THESISMAIN).pdf
-@cp $(THESISMAIN).pdf README.pdf
cleantest :
-@rm $(TESTFILE).pdf

release: diss.tex body/*.tex # make version=0.5.1 release
$(SED) -i "s/templateversion{v.*}/templateversion{v$(version)}/g" sjtuthesis.cfg
$(SED) -i "s/bachelor-.*zip/bachelor-$(version).zip/g" body/chapter01.tex
$(SED) -i "s/master-.*zip/master-$(version).zip/g" body/chapter01.tex
$(SED) -i "s/phd-.*zip/phd-$(version).zip/g" body/chapter01.tex
cp : $(THESISMAIN).pdf
-@cp -f $< README.pdf

version :
$(SED) -i "s/templateversion{v.*}/templateversion{v$(VERSION)}/g" sjtuthesis.cfg
$(SED) -i "s/bachelor-.*zip/bachelor-$(VERSION).zip/g" body/chapter01.tex
$(SED) -i "s/master-.*zip/master-$(VERSION).zip/g" body/chapter01.tex
$(SED) -i "s/phd-.*zip/phd-$(VERSION).zip/g" body/chapter01.tex

release : clean version all cp
@echo "OK. Release version $(VERSION)."
6 changes: 3 additions & 3 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This is (Xe)LaTeX template for thesis of Shanghai Jiaotong University. Currently, templates for bachelor, master, and Ph.D thesis are released in three different branches separately. You can download the zip packages from the following links.

* [SJTU Bachelor Thesis Template Download](https://nodeload.github.com/weijianwen/sjtu-thesis-template-latex/zipball/bachelor-thesis)
* [SJTU Master Thesis Template Download](https://nodeload.github.com/weijianwen/sjtu-thesis-template-latex/zipball/master-thesis)
* [SJTU Ph.D Thesis Template Download](https://nodeload.github.com/weijianwen/sjtu-thesis-template-latex/zipball/phd-thesis)
* [SJTU Bachelor Thesis Template Download](https://github.com/weijianwen/sjtu-thesis-template-latex/archive/bachelor-thesis.zip)
* [SJTU Master Thesis Template Download](https://github.com/weijianwen/sjtu-thesis-template-latex/archive/master-thesis.zip)
* [SJTU Ph.D Thesis Template Download](https://github.com/weijianwen/sjtu-thesis-template-latex/archive/phd-thesis.zip)

The original version of this template dated back about two years ago, when CJK-latex was still the most prevalent solution for TeX/LaTeX to handle CJK (Chinese, Japanese, Korean) characters. A nice guy at the school of physics, SJTU, made a LaTeX template for Ph.D thesis and posted on SJTU's [BBS](https://bbs.sjtu.edu.cn/bbsdoc?board=TeX_LaTeX). I followed his steps, added some refinement and documentations, and made the template more accessible for general people.

Expand Down
File renamed without changes.

0 comments on commit 9e5242f

Please sign in to comment.