Commit 1ab04102 authored by Alija Sabic's avatar Alija Sabic
Browse files

Enhance Makefile: cleanup, rewrite main targets, add parametrizable targets for arbitrary tex files

parent 744d5365
# -*- cperl -*- # -*- cperl -*-
# latexmkrc # latexmkrc
$builddir = $ENV{'BUILDDIR'};
$target = $ENV{'TARGET'};
$bibdirs = $ENV{'BIBDIRS'};
$type = $ENV{'TYPE'};
$viewer = $ENV{'VIEWER'};
$recorder = 1; $recorder = 1;
$pdf_mode = 1; $pdf_mode = 1;
$bibtex_use = 2; $bibtex_use = 2;
$force_mode = 1; $force_mode = 1;
$dependents_list = 1;
$silence_logfile_warnings = 0; $silence_logfile_warnings = 0;
$use_make_for_missing_files = 1; $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; $out_dir = $builddir;
$deps_file = "$builddir/$target.deps";
@BIBINPUTS = ('.',$bibdirs);
# $bibtex = 'bibtex %O %B'; # $bibtex = 'bibtex %O %B';
$pdflatex = join '', 'pdflatex %O -interaction=nonstopmode -synctex=1 -file-line-error "\PassOptionsToClass{', $type, '}{beamer} \input{%S}"'; $pdflatex = join '', 'pdflatex %O -interaction=nonstopmode -synctex=1 -file-line-error "\PassOptionsToClass{', $type, '}{beamer} \input{%S}"';
$pdf_previewer = $viewer;
push @generated_exts, 'blg', 'cut', 'nav', 'snm', 'vrb', 'synctex.gz'; push @generated_exts, 'blg', 'cut', 'nav', 'snm', 'vrb', 'synctex.gz';
\ No newline at end of file
...@@ -7,45 +7,79 @@ TARGETS = $(BASENAME)-presentation.pdf \ ...@@ -7,45 +7,79 @@ TARGETS = $(BASENAME)-presentation.pdf \
# Environment # Environment
TEXDIRS = resources/latex/:resources/latex-sty/:resources/images/:resources/listings/ TEXDIRS = resources/latex/:resources/latex-sty/:resources/images/:resources/listings/
BIBDIR = resources/latex/ BIBDIRS = resources/latex/
BSTDIR = resources/latex-bst/ BSTDIR = resources/latex-bst/
.EXPORT_ALL_VARIABLES:
TEXINPUTS := :.:$(TEXDIRS)
# bibtex invoked from BUILDDIR, thus prepend './../'
BSTINPUTS := ./../$(BSTDIR)
BIBINPUTS := :.:./../$(BIBDIR)
# cf. latexmkrc # cf. latexmkrc
LATEXMK = latexmk -deps -jobname="$(basename $1)" $2 LATEXMKV = export TYPE=$1 TARGET="$(BASENAME)-$1" && latexmk -jobname="$(BASENAME)-$1" $2
LATEXMKF = export TARGET=$1 && export TYPE=$2 && $(call LATEXMK,$1,$(BASENAME)) LATEXMK = export TYPE= TARGET="$(basename $(notdir $1))" && latexmk $(basename $1)$2
LATEXMKC = export TARGET=$1 && export TYPE="" && $(call LATEXMK,$1,$2) VIEWER = xdg-open
# main targets
all: $(TARGETS) all: $(TARGETS)
presentation: $(BUILDDIR)/ $(BASENAME)-presentation.pdf clean:
handout: $(BUILDDIR)/ $(BASENAME)-handout.pdf find $(BUILDDIR) -type f -not -name "*.pdf" -delete
notes: $(BUILDDIR)/ $(BASENAME)-notes.pdf
$(BASENAME)-presentation.pdf: .FORCE | $(BUILDDIR)/
$(call LATEXMKF,$@,presentation)
$(BASENAME)-handout.pdf: .FORCE | $(BUILDDIR)/ distclean:
$(call LATEXMKF,$@,handout) rm -rf $(BUILDDIR)
$(BASENAME)-notes.pdf: .FORCE | $(BUILDDIR)/ $(BASENAME)-presentation.pdf presentation presentation.build: setup
$(call LATEXMKF,$@,notes) $(call LATEXMKV,presentation,)
presentation.view: setup
$(call LATEXMKV,presentation,-pv)
presentation.preview: setup
$(call LATEXMKV,presentation,-pvc)
presentation.clean: setup
$(call LATEXMKV,presentation,-c)
presentation.distclean: setup
$(call LATEXMKV,presentation,-C)
clean: $(BASENAME)-handout.pdf handout handout.build: setup
$(foreach t,$(TARGETS), $(call LATEXMKC,$(t),-c);) $(call LATEXMKV,handout,)
handout.view: setup
$(call LATEXMKV,handout,-pv)
handout.preview: setup
$(call LATEXMKV,handout,-pvc)
handout.clean: setup
$(call LATEXMKV,handout,-c)
handout.distclean: setup
$(call LATEXMKV,handout,-C)
distclean: $(BASENAME)-notes.pdf notes notes.build: setup
$(foreach t,$(TARGETS), $(call LATEXMKC,$(t),-C);) $(call LATEXMKV,notes,)
notes.view: setup
$(call LATEXMKV,notes,-pv)
notes.preview: setup
$(call LATEXMKV,notes,-pvc)
notes.clean: setup
$(call LATEXMKV,notes,-c)
notes.distclean: setup
$(call LATEXMKV,notes,-C)
# dynamic targets
%.build: setup
$(call LATEXMK, $@, )
%.view: setup
$(call LATEXMK, $@, -pv)
%.preview: setup
$(call LATEXMK, $@, -pvc)
%.clean: setup
$(call LATEXMK, $@, -c)
%.distclean: setup
$(call LATEXMK, $@, -C)
%/: %/:
mkdir -p $@ mkdir -p $@
.PHONY: all presentation handout notes clean distclean .FORCE setup: .FORCE | $(BUILDDIR)/
.PHONY: all presentation handout notes view preview clean distclean .FORCE
.EXPORT_ALL_VARIABLES:
TEXINPUTS := :.:$(TEXDIRS)
# bibtex invoked from BUILDDIR, thus prepend './../'
BSTINPUTS := ./../$(BSTDIR)
BIBINPUTS := :.:./../$(BIBDIRS)
# Disable implicit suffix and built-in rules (for performance and profit) # Disable implicit suffix and built-in rules (for performance and profit)
.SUFFIXES: .SUFFIXES:
......
\documentclass{standalone}
\usepackage{booktabs,tabu,multirow,multicol,xfrac}
\usepackage[binary-units]{siunitx}
\sisetup{quotient-mode=fraction,fraction-function=\sfrac,product-units=single,exponent-product=\times}
\begin{document}
\begin{tabu} to 0.95\linewidth {X[2]XXX} \toprule
Material & Symbol & $E_{\textup{g}}$ (\si{\electronvolt}) & Type \\
\midrule
\rowfont\bfseries
\multicolumn{4}{c}{Elements} \\
diamond & $C$ & \num{5.46} & i \\
silicon & $Si$ & \num{1.12} & i \\
germanium & $Ge$ & \num{0.67} & i \\
selenium & $Se$ & \num{1.74} & d \\
\midrule
\rowfont\bfseries
\multicolumn{4}{c}{IV-IV Compounds} \\
silicon carbide & $SiC 3C$ & \num{2.36} & i \\
silicon carbide & $SiC 4H$ & \num{3.28} & i \\
silicon carbide & $SiC 6H$ & \num{3.03} & i \\
\midrule
\rowfont\bfseries
\multicolumn{4}{c}{III-V Compounds} \\
indium phosphide & $InP$ & \num{1.27} & d \\
indium arsenide & $InAs$ & \num{0.355} & d \\
gallium nitride & $GaN$ & \num{3.37} & d \\
gallium arsenide & $GaAs$ & \num{1.42} & d \\
aluminium nitride & $AlN$ & \num{6.2} & d \\
\bottomrule
\end{tabu}
\end{document}
\ No newline at end of file
\documentclass{standalone}
\usepackage{booktabs,tabu,multirow,multicol,xfrac}
\usepackage[binary-units]{siunitx}
\sisetup{quotient-mode=fraction,fraction-function=\sfrac,product-units=single,exponent-product=\times}
\usepackage{acro}
\usepackage{enumitem}
\acsetup{ first-long-format = \itshape }
\acsetup{ list-foreign-format = \itshape\acroenparen }
\newlist{acronyms}{description}{1}
\setlist[acronyms]{labelwidth = 5em}
\DeclareAcroListStyle{acrostyle}{list}{ list = acronyms }
\acsetup{ list-style = acrostyle }
\input{resources/latex/acronyms}
\begin{document}
\begin{tabu} to 2.5\linewidth {X[0.2,m]X[0.25,m]X[0.35,m]X[0.3,m]X[c,m]} \toprule
% \everyrow{\midrule}
\rowfont{\large\bfseries}
Unit name & Unit Symbol & Dimension symbol & Quanitity name & Definition\textsuperscript{\normalfont 1}
\\ \midrule
\rowfont{\Large}
\textbf{metre} & \si{\m} & L & length &
\begin{itemize}\footnotesize
\item \textbf{Prior} (\num{1793}): \SI{1/10000000}{} of the meridian through Paris between the North Pole and the Equator.\textsuperscript{FG}
\item \textbf{Interim} (\num{1960}): \SI{1650763.73}{} wavelengths in a vacuum of the radiation corresponding to the transition
between the $\num{2} \textmd{p}^{\num{10}}$ and $\num{5} \textmd{d}^{\num{5}}$ quantum levels of the krypton-\num{86} atom.
\item \textbf{Current} (\num{1983}): The distance travelled by light in vacuum in \SI{1/299792458}{\second}.
\end{itemize}
\\ \midrule
\rowfont{\Large}
\textbf{kilogram}\textsuperscript{\normalfont 2} & \si{\kg} & M & mass &
\begin{itemize}\footnotesize
\item \textbf{Prior} (\num{1793}): The grave was defined as being the mass (then called weight) of one litre of pure water at its freezing point.\textsuperscript{FG}
\item \textbf{Current} (\num{1889}): The mass of a small squat cylinder of $\sim$\SI{47}{\cubic\cm} of platinum-iridium alloy kept in the Pavillon de Breteuil, France.
Also, in practice, any of numerous official replicas of it.
\item \textbf{Future} (\num{2019}): The \si{\kg} is defined by taking the Planck constant h as exactly
\SI{6.62607015e-34}{\joule\second} (\si{\joule} = \si{\kg\square\meter\per\square\second}), given the definitions of the \si{\meter} and the \si{\second}.
\end{itemize}
\\ \midrule
\rowfont{\Large}
\textbf{second} & \si{\second} & T & time &
\begin{itemize}\footnotesize
\item \textbf{Prior}: \SI{1/86400}{} of a day of \SI{24}{\hour} of \SI{60}{\minute} of \SI{60}{\second}.
\item \textbf{Interim} (\num{1956}): \SI{1/31556925.9747}{} of the tropical year for \num{1900} January \num{0} at \SI{12}{\hour} ephemeris time.
\item \textbf{Current} (\num{1967}): The duration of \num{9192631770} periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-\num{133} atom.
\end{itemize}
\\ \midrule
\multicolumn{5}{l}{\textsuperscript{1} Interim definitions are given here only when there has been a significant difference in the definition.} \\
\multicolumn{5}{l}{\textsuperscript{2} Despite the prefix ``kilo-'', the kilogram is the base unit of mass.} \\
\multicolumn{5}{l}{\textsuperscript{FG} \acf{FG}.} \\
\bottomrule
\end{tabu}
\end{document}
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