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
...@@ -9,4 +9,5 @@ ...@@ -9,4 +9,5 @@
*.pdf.deps *.pdf.deps
*.snm *.snm
*.synctex.gz *.synctex.gz
*.toc *.toc
\ No newline at end of file .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 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 BUILDDIR = build
FORCE_LATEXMK := $(if $(findstring -B,$(firstword -$(MAKEFLAGS))),-g) TARGETS = $(BASENAME)-presentation.pdf \
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)" $(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) all: build/ $(TARGETS)
# Slides slides: $(BUILDDIR)/ $(BASENAME)-presentation.pdf
handout: $(BUILDDIR)/ $(BASENAME)-handout.pdf
slides: build/ $(BASENAME)-presentation.pdf notes: $(BUILDDIR)/ $(BASENAME)-notes.pdf
$(BASENAME)-presentation.pdf: .FORCE | $(BUILDDIR) $(BASENAME)-presentation.pdf: .FORCE | $(BUILDDIR)
$(call LATEXMK,$@,presentation) $(call LATEXMKF,$@,presentation)
# mv $(BUILDDIR)/$@ $@
# Handout
handout: build/ $(BASENAME)-handout.pdf
$(BASENAME)-handout.pdf: .FORCE | $(BUILDDIR) $(BASENAME)-handout.pdf: .FORCE | $(BUILDDIR)
$(call LATEXMK,$@,handout) $(call LATEXMKF,$@,handout)
# mv $(BUILDDIR)/$@ $@
# Notes
notes: build/ $(BASENAME)-notes.pdf
$(BASENAME)-notes.pdf: .FORCE | $(BUILDDIR) $(BASENAME)-notes.pdf: .FORCE | $(BUILDDIR)
$(call LATEXMK,$@,notes) $(call LATEXMKF,$@,notes)
# mv $(BUILDDIR)/$@ $@
# Clean
clean: clean:
find $(BUILDDIR) -type f -not -name '*.pdf' -delete $(foreach t,$(TARGETS), $(call LATEXMKC,$(t),-c);)
# $(foreach t,$(TARGETS),cd $(BUILDDIR); latexmk -c -jobname=$(basename $(t));)
distclean: distclean:
rm -rf $(BUILDDIR) $(foreach t,$(TARGETS), $(call LATEXMKC,$(t),-C);)
%/: %/:
mkdir -p $@ mkdir -p $@
......
No preview for this file type
No preview for this file type
...@@ -8,17 +8,18 @@ ...@@ -8,17 +8,18 @@
\@ifclasswith{beamer}{notes}{\setbeameroption{show notes on second screen=right}}{} \@ifclasswith{beamer}{notes}{\setbeameroption{show notes on second screen=right}}{}
\makeatother \makeatother
% ---------------------------------------------------------------------------------------------------------------------------- % ----------------------------------------------------------------------------------------------------------------------------
% Bibliography/References % Bibliography/References
% ---------------------------------------------------------------------------------------------------------------------------- % ----------------------------------------------------------------------------------------------------------------------------
\usepackage[square,numbers,sort]{natbib} \usepackage[square,numbers,sort]{natbib}
% TODO: provide examples
\usepackage{usebib} \usepackage{usebib}
\bibinput{references} \bibinput{references}
\setlength{\bibsep}{1em} \setlength{\bibsep}{1em}
\bibliographystyle{./../IEEEtranSNC} % \bibliographystyle{./../\bstpath IEEEtranSNC}
\interfootnotelinepenalty=10000 \bibliographystyle{IEEEtranSNC}
% \interfootnotelinepenalty=10000
% ---------------------------------------------------------------------------------------------------------------------------- % ----------------------------------------------------------------------------------------------------------------------------
% Languagues % Languagues
...@@ -216,12 +217,12 @@ ...@@ -216,12 +217,12 @@
\begin{frame}{Demonstration}{Figures} \begin{frame}{Demonstration}{Figures}
\begin{figure} \begin{figure}
\centering \centering
\includegraphics<1|handout:0>[width=0.4\textwidth]{resources/images/dilbert1.pdf}% \includegraphics<1|handout:0>[width=0.4\textwidth]{dilbert1.pdf}%
\includegraphics<2|handout:0>[width=0.4\textwidth]{resources/images/dilbert2.pdf}% \includegraphics<2|handout:0>[width=0.4\textwidth]{dilbert2.pdf}%
\includegraphics<3|handout:0>[width=0.4\textwidth]{resources/images/dilbert3.pdf}% \includegraphics<3|handout:0>[width=0.4\textwidth]{dilbert3.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{resources/images/dilbert1.pdf}% \includegraphics<handout>[width=0.3\textwidth]{dilbert1.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{resources/images/dilbert2.pdf}% \includegraphics<handout>[width=0.3\textwidth]{dilbert2.pdf}%
\includegraphics<handout>[width=0.3\textwidth]{resources/images/dilbert3.pdf}% \includegraphics<handout>[width=0.3\textwidth]{dilbert3.pdf}%
\caption{\textcopyright~2018 Scott Adams, \url{dilbert.com}} \caption{\textcopyright~2018 Scott Adams, \url{dilbert.com}}
\label{fig:figure1} \label{fig:figure1}
\end{figure} \end{figure}
...@@ -235,7 +236,7 @@ ...@@ -235,7 +236,7 @@
style=c, style=c,
emph={EXIT_SUCCESS}, emph={EXIT_SUCCESS},
breaklines=true, breaklines=true,
]{resources/listings/main.c} ]{main.c}
\end{adjustbox} \end{adjustbox}
\end{frame} \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