Commit 9019a928 authored by Alija Sabic's avatar Alija Sabic
Browse files

Create and setup latexmkrc, add tex, bst, and bib paths, finish and cleanup Makefile

parent 7261f3ba
......@@ -10,3 +10,4 @@
*.snm
*.synctex.gz
*.toc
.deps/
\ No newline at end of file
# -*- cperl -*-
# latexmkrc
$recorder = 1;
$pdf_mode = 1;
$bibtex_use = 2;
$force_mode = 1;
$silence_logfile_warnings = 0;
$use_make_for_missing_files = 1;
$bibdir = $ENV{'BIBDIR'};
@BIBINPUTS = ('.',$bibdir);
$target = $ENV{'TARGET'};
$type = $ENV{'TYPE'};
$builddir = $ENV{'BUILDDIR'};
$dependents_list = 1;
$deps_file = "$builddir/$target.deps";
$out_dir = $builddir;
# $bibtex = 'bibtex %O %B';
$pdflatex = join '', 'pdflatex %O -interaction=nonstopmode -synctex=1 -file-line-error "\PassOptionsToClass{', $type, '}{beamer} \input{%S}"';
push @generated_exts, 'blg', 'cut', 'nav', 'snm', 'vrb', 'synctex.gz';
\ No newline at end of file
BASENAME = demo
BUILDDIR = build
TARGETS = $(BASENAME)-presentation.pdf $(BASENAME)-handout.pdf $(BASENAME)-notes.pdf
LATEX_CMD = pdflatex %O -synctex=1 -interaction=nonstopmode -file-line-error -recorder
FORCE_LATEXMK := $(if $(findstring -B,$(firstword -$(MAKEFLAGS))),-g)
LATEXMK = latexmk -f -outdir=$(BUILDDIR) -bibtex -pdf -use-make -deps-out=$(BUILDDIR)/$1.deps -jobname="$(basename $1)" -pdflatex='$(LATEX_CMD) "\PassOptionsToClass{$2}{beamer}\input{%S}"' $(FORCE_LATEXMK) "$(BASENAME)"
BUILDDIR = build
TARGETS = $(BASENAME)-presentation.pdf \
$(BASENAME)-handout.pdf \
$(BASENAME)-notes.pdf
# Environment
TEXDIRS = resources/latex/:resources/latex-sty/:resources/images/:resources/listings/
BIBDIR = resources/latex/
BSTDIR = resources/latex-bst/
.EXPORT_ALL_VARIABLES:
TEXINPUTS := :.:$(TEXDIRS)
# bibtex invoked from BUILDDIR, thus prepend './../'
BSTINPUTS := ./../$(BSTDIR)
BIBINPUTS := :.:./../$(BIBDIR)
# cf. latexmkrc
LATEXMK = latexmk -deps -jobname="$(basename $1)" $2
LATEXMKF = export TARGET=$1 && export TYPE=$2 && $(call LATEXMK,$1,$(BASENAME))
LATEXMKC = export TARGET=$1 && export TYPE="" && $(call LATEXMK,$1,$2)
all: build/ $(TARGETS)
# Slides
slides: build/ $(BASENAME)-presentation.pdf
slides: $(BUILDDIR)/ $(BASENAME)-presentation.pdf
handout: $(BUILDDIR)/ $(BASENAME)-handout.pdf
notes: $(BUILDDIR)/ $(BASENAME)-notes.pdf
$(BASENAME)-presentation.pdf: .FORCE | $(BUILDDIR)
$(call LATEXMK,$@,presentation)
# mv $(BUILDDIR)/$@ $@
# Handout
handout: build/ $(BASENAME)-handout.pdf
$(call LATEXMKF,$@,presentation)
$(BASENAME)-handout.pdf: .FORCE | $(BUILDDIR)
$(call LATEXMK,$@,handout)
# mv $(BUILDDIR)/$@ $@
# Notes
notes: build/ $(BASENAME)-notes.pdf
$(call LATEXMKF,$@,handout)
$(BASENAME)-notes.pdf: .FORCE | $(BUILDDIR)
$(call LATEXMK,$@,notes)
# mv $(BUILDDIR)/$@ $@
# Clean
$(call LATEXMKF,$@,notes)
clean:
find $(BUILDDIR) -type f -not -name '*.pdf' -delete
# $(foreach t,$(TARGETS),cd $(BUILDDIR); latexmk -c -jobname=$(basename $(t));)
$(foreach t,$(TARGETS), $(call LATEXMKC,$(t),-c);)
distclean:
rm -rf $(BUILDDIR)
$(foreach t,$(TARGETS), $(call LATEXMKC,$(t),-C);)
%/:
mkdir -p $@
......
No preview for this file type
No preview for this file type
......@@ -8,17 +8,18 @@
\@ifclasswith{beamer}{notes}{\setbeameroption{show notes on second screen=right}}{}
\makeatother
% ----------------------------------------------------------------------------------------------------------------------------
% Bibliography/References
% ----------------------------------------------------------------------------------------------------------------------------
\usepackage[square,numbers,sort]{natbib}
% TODO: provide examples
\usepackage{usebib}
\bibinput{references}
\setlength{\bibsep}{1em}
\bibliographystyle{./../IEEEtranSNC}
\interfootnotelinepenalty=10000
% \bibliographystyle{./../\bstpath IEEEtranSNC}
\bibliographystyle{IEEEtranSNC}
% \interfootnotelinepenalty=10000
% ----------------------------------------------------------------------------------------------------------------------------
% Languagues
......@@ -216,12 +217,12 @@
\begin{frame}{Demonstration}{Figures}
\begin{figure}
\centering
\includegraphics<1|handout:0>[width=0.4\textwidth]{resources/images/dilbert1.pdf}%
\includegraphics<2|handout:0>[width=0.4\textwidth]{resources/images/dilbert2.pdf}%
\includegraphics<3|handout:0>[width=0.4\textwidth]{resources/images/dilbert3.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{resources/images/dilbert1.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{resources/images/dilbert2.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{resources/images/dilbert3.pdf}%
\includegraphics<1|handout:0>[width=0.4\textwidth]{dilbert1.pdf}%
\includegraphics<2|handout:0>[width=0.4\textwidth]{dilbert2.pdf}%
\includegraphics<3|handout:0>[width=0.4\textwidth]{dilbert3.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{dilbert1.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{dilbert2.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{dilbert3.pdf}%
\caption{\textcopyright~2018 Scott Adams, \url{dilbert.com}}
\label{fig:figure1}
\end{figure}
......@@ -235,7 +236,7 @@
style=c,
emph={EXIT_SUCCESS},
breaklines=true,
]{resources/listings/main.c}
]{main.c}
\end{adjustbox}
\end{frame}
......
push @generated_exts, 'bbl', 'blg', 'cut', 'nav', 'snm', 'vrb';
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment