Skip to content

Commit

Permalink
📎 Merge branch 'master' of github.com:kks32/phd-thesis-template
Browse files Browse the repository at this point in the history
  • Loading branch information
kks32 committed Apr 3, 2018
2 parents 932fcd1 + 34b0238 commit 85a8d91
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 14 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
before_install:
- sudo add-apt-repository -y ppa:texlive-backports/ppa
- sudo apt-get update
install:
- sudo apt-get install -y texlive-latex-base
- sudo apt-get install -y texlive-latex-recommended texlive-latex-extra
- sudo apt-get install -y texlive-science
- sudo apt-get install -y texlive-fonts-recommended texlive-fonts-extra
- sudo apt-get install -y psutils
- sudo apt-get install ghostscript
- curl -L https://github.com/holgern/travis-texlive/releases/download/2017-09-18_02/texlive.tar.xz | tar -JxC ~
- PATH=$HOME/texlive/bin/x86_64-linux:$PATH
script:
- make clean
- make BUILD_STRATEGY=latex
Expand Down
97 changes: 91 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Copyright 2004 Chris Monson (shiblon@gmail.com)
# 2011 Andrew McNabb
# 2013 Krishna Kumar
# 2017 Holger Nahrstaedt
# Latest version available at http://www.bouncingchairs.net/oss
#
# This file is part of ``Chris Monson's Free Software''.
Expand Down Expand Up @@ -30,7 +33,7 @@
#
fileinfo := LaTeX Makefile
author := Chris Monson
version := 2.2.1-alpha9
version := 2.2.1-alpha10
#
.DEFAULT_GOAL := all
# Note that the user-global version is imported *after* the source directory,
Expand All @@ -46,6 +49,8 @@ version := 2.2.1-alpha9
# This can be pdflatex or latex - you can change this by adding the following line to your Makefile.ini:
# BUILD_STRATEGY := latex
BUILD_STRATEGY ?= pdflatex
#BIB_STRATEGY ?= biblatex
BIB_STRATEGY ?= bibtex
# This can be used to pass extra options to latex.
LATEX_OPTS ?=
#
Expand Down Expand Up @@ -117,6 +122,13 @@ export LC_ALL ?= C
#
#
# CHANGES:
# Holger Nahrstaedt (2017-09-25):
# * Bumped version to 2.2.1-alpha10
# * Added XELATEX and LUALATEX to BUILD_STRATEGY
# * New option BIB_STRATEGY, can be biblatex or bibtex
# * Added all Authors to Copyright section
# * Added asymptote file generation
# * Added shell-escape to pdflatex, xelatex and lualatex
# Krishna Kumar (2013-11-27):
# * Added PS to rm_ext to remove PS files generated during LaTeX output
# Krishna Kumar (2013-11-26):
Expand Down Expand Up @@ -746,10 +758,12 @@ XARGS ?= xargs
SLEEP ?= sleep
# == LaTeX (tetex-provided) ==
BIBTEX ?= bibtex
BIBER ?= biber
DVIPS ?= dvips
LATEX ?= latex
PDFLATEX ?= pdflatex
XELATEX ?= xelatex
PDFLATEX ?= pdflatex --shell-escape
XELATEX ?= xelatex --shell-escape
LUALATEX ?= lualatex --shell-escape
EPSTOPDF ?= epstopdf
MAKEINDEX ?= makeindex
XINDY ?= xindy
Expand Down Expand Up @@ -778,6 +792,7 @@ PNGTOPNM ?= pngtopnm # From NetPBM - step 1 for png -> eps
PPMTOPGM ?= ppmtopgm # From NetPBM - (gray) step 2 for png -> eps
PNMTOPS ?= pnmtops # From NetPBM - step 3 for png -> eps
GUNZIP ?= gunzip # GZipped EPS
ASYMPTOTE ?= asy
# == Beamer Enlarged Output ==
PSNUP ?= psnup
# == Viewing Stuff ==
Expand Down Expand Up @@ -1175,18 +1190,29 @@ default_graphic_extension ?= pdf
latex_build_program ?= $(XELATEX)
build_target_extension ?= pdf
hyperref_driver_pattern ?= hdvipdf.*
hyperref_driver_error ?= Using pdflatex: specify pdftex in the hyperref options (or leave it blank).
hyperref_driver_error ?= Using xelatex: specify xelatex in the hyperref options (or leave it blank).
endif

ifeq "$(strip $(BUILD_STRATEGY))" "lualatex"
default_graphic_extension ?= pdf
latex_build_program ?= $(LUALATEX)
build_target_extension ?= pdf
hyperref_driver_pattern ?= hdvipdf.*
hyperref_driver_error ?= Using xelatex: specify lualatex in the hyperref options (or leave it blank).
endif


# Files of interest
all_files.tex ?= $(wildcard *.tex)
all_files.xmpdata ?= $(wildcard *.xmpdata)
all_files.tex.sh ?= $(wildcard *.tex.sh)
all_files.tex.pl ?= $(wildcard *.tex.pl)
all_files.tex.py ?= $(wildcard *.tex.py)
all_files.rst ?= $(wildcard *.rst)
all_files.lhs ?= $(wildcard *.lhs)
all_files.mp ?= $(wildcard *.mp)
all_files.fig ?= $(wildcard *.fig)
all_files.asy ?= $(wildcard *.asy)
all_files.gpi ?= $(wildcard *.gpi)
all_files.dot ?= $(wildcard *.dot)
all_files.xvg ?= $(wildcard *.xvg)
Expand Down Expand Up @@ -1238,6 +1264,7 @@ files.gpi := $(call filter-buildable,gpi)
files.dot := $(call filter-buildable,dot)
files.mp := $(call filter-buildable,mp)
files.fig := $(call filter-buildable,fig)
files.asy := $(call filter-buildable,asy)
files.xvg := $(call filter-buildable,xvg)
files.svg := $(call filter-buildable,svg)
files.png := $(call filter-buildable,png)
Expand Down Expand Up @@ -1268,6 +1295,7 @@ default_files.gpi := $(call filter-default,gpi)
default_files.dot := $(call filter-default,dot)
default_files.mp := $(call filter-default,mp)
default_files.fig := $(call filter-default,fig)
default_files.asy := $(call filter-default,asy)
default_files.xvg := $(call filter-default,xvg)
default_files.svg := $(call filter-default,svg)
default_files.png := $(call filter-default,png)
Expand Down Expand Up @@ -1367,6 +1395,7 @@ graphic_source_extensions := mp \
xvg \
svg \
dot \
asy \
eps.gz

ifeq "$(strip $(BUILD_STRATEGY))" "latex"
Expand All @@ -1384,6 +1413,11 @@ graphic_source_extensions += eps
graphic_target_extensions := pdf png jpg jpeg mps tif
endif

ifeq "$(strip $(BUILD_STRATEGY))" "lualatex"
graphic_source_extensions += eps
graphic_target_extensions := pdf png jpg jpeg mps tif
endif

all_stems_source := $(call concat-stems,tex,all)
all_stems_source_gen := $(call concat-stems,rst lhs,all)
all_stems_script := $(call concat-stems,tex.sh tex.pl tex.py,all)
Expand Down Expand Up @@ -1418,6 +1452,7 @@ allowed_source_suffixes := \
ind \
nls \
bbl \
bci \
aux \
aux.make \
d \
Expand Down Expand Up @@ -1537,7 +1572,7 @@ endif

# Extensions generated by LaTeX invocation that can be removed when complete
rm_ext := \
log *.log aux $(pre_pdf_extensions) ps pdf blg bbl out nav snm toc lof lot lol pfg \
log *.log aux $(pre_pdf_extensions) ps pdf blg bcf bbl out nav snm toc lof lot lol pfg \
fls vrb idx ind ilg glg glo gls lox nls nlo nlg brf mtc* mlf* mlt* maf brf ist fmt
backup_patterns := *~ *.bak *.backup body.tmp head.tmp

Expand Down Expand Up @@ -2421,7 +2456,12 @@ endef
# BibTeX invocations
#
# $(call run-bibtex,<tex stem>)
ifeq "$(strip $(BIB_STRATEGY))" "bibtex"
run-bibtex = $(BIBTEX) $1 | $(color_bib); $(call transcript,bibtex,$1)
endif
ifeq "$(strip $(BIB_STRATEGY))" "biblatex"
run-bibtex = $(BIBER) $1 | $(color_bib); $(call transcript,biber,$1)
endif

# $(call convert-eps-to-pdf,<eps file>,<pdf file>,[gray])
# Note that we don't use the --filter flag because it has trouble with bounding boxes that way.
Expand Down Expand Up @@ -2541,6 +2581,10 @@ define convert-jpg
$(CONVERT) $(if $3,-type Grayscale,) '$1' eps2:'$2'
endef

# Creation of .pdf files from .asy files
# $(call convert-asy,<asy file>)
convert-asy = $(ASYMPTOTE) -V -f pdf $1

# Creation of .eps files from .fig files
# $(call convert-fig,<fig file>,<output file>,[gray])
convert-fig = $(FIG2DEV) -L $(if $(filter %.pdf,$2),pdf,eps) $(if $3,-N,) $1 $2
Expand Down Expand Up @@ -2957,6 +3001,7 @@ endif
# Note that we do NOT touch the .bbl file if there is no need to
# create/recreate it. We would like to leave existing files alone if they
# don't need to be changed, thus possibly avoiding a rebuild trigger.
ifeq "$(strip $(BIB_STRATEGY))" "bibtex"
%.bbl: %.auxbbl.make
$(QUIET)\
$(if $(filter %.bib,$^),\
Expand All @@ -2977,6 +3022,12 @@ endif
$(call echo-build,** annotated extra latex **,output ignored,$(RESTARTS)-2); \
$(call run-latex,$*); \
fi
endif
ifeq "$(strip $(BIB_STRATEGY))" "biblatex"
%.bbl: %.bcf
$(QUIET)$(call echo-build,$<,$@)
$(QUIET)$(call run-bibtex,$<,$@,$*.bcf)
endif

# Create the index file - note that we do *not* depend on %.tex here, since
# that unnecessarily restricts the kinds of indices that we can build to those
Expand Down Expand Up @@ -3082,6 +3133,10 @@ endif
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-fig,$<,$@,$(GRAY))

%.pdf: %.asy
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-asy,$<)

%.pdf: %.svg
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-svg,$<,$@,$(GRAY))
Expand All @@ -3102,6 +3157,37 @@ endif
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-fig,$<,$@,$(GRAY))

%.pdf: %.asy
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-asy,$<)

%.pdf: %.svg
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-svg,$<,$@,$(GRAY))
endif

ifeq "$(strip $(BUILD_STRATEGY))" "lualatex"
%.pdf: %.eps $(if $(GRAY),$(gray_eps_file))
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-eps-to-pdf,$<,$@,$(GRAY))

ifeq "$(strip $(GPI_OUTPUT_EXTENSION))" "pdf"
%.pdf: %.gpi %.gpi.d $(gpi_sed) $(gpi_global)
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-gpi,$<,$@,$(GRAY))
endif

%.pdf: %.fig
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-fig,$<,$@,$(GRAY))

%.pdf: %.asy
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-asy,$<)

%.pdf: %.svg
$(QUIET)$(call echo-graphic,$^,$@)
$(QUIET)$(call convert-svg,$<,$@,$(GRAY))
endif


Expand Down Expand Up @@ -4150,4 +4236,3 @@ endef
-include $(HOME)/.latex-makefile/Targets.ini
#
# vim: noet sts=0 sw=8 ts=8

4 changes: 4 additions & 0 deletions Preamble/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,7 @@
%\fi

% Example todo: \mynote{Hey! I have a note}

% *****************************************************************************
% ******************* Better enumeration my MB*************
\usepackage{enumitem}
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This template supports `XeLaTeX` compilation chain. To generate PDF run

### Using latexmk (Unix/Linux/Windows)

This template supports `XeLaTeX` compilation chain. To generate PDF run
This template supports `LuaLaTeX` compilation chain. To generate PDF run

latexmk -pdflatex=lualatex -pdf thesis.tex

Expand All @@ -85,7 +85,27 @@ To build the `PDF` version of your thesis, run:
make


This build procedure uses `pdflatex` and will produce `thesis.pdf`.
This build procedure uses `pdflatex` with `bibtex` and will produce `thesis.pdf`.
To use `pdflatex` with `biblatex`, you should run:

make BIB_STRATEGY=biblatex

To use `XeLaTeX`, you should run:

make BUILD_STRATEGY=xelatex

or with `biblatex`

make BUILD_STRATEGY=xelatex BIB_STRATEGY=biblatex

To use `LuaLaTeX`, you should run:

make BUILD_STRATEGY=lualatex

or with `biblatex`

make BUILD_STRATEGY=lualatex BIB_STRATEGY=biblatex


To produce `DVI` and `PS` versions of your document, you should run:

Expand Down

0 comments on commit 85a8d91

Please sign in to comment.