From c4de1d3a4244568b841c966c75cf3593171c8dbd Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 19 Feb 2020 15:12:23 +0100 Subject: [PATCH] Iniitla commit --- .gitignore | 1 + Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ main.tex | 9 +++++++++ 3 files changed, 53 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 main.tex diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a7fe91b --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +default: pdf + +all: pdf printer screen + +# Constants. +rootname = main +rootfile = $(rootname).tex +outdir = build +outfile = $(outdir)/$(rootname).pdf + +# Compression with ghostscript. +compress = gs -sDEVICE=pdfwrite -dPDFSETTINGS=/$(1) -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$(outdir)/$(rootname)-$(1).pdf $(outfile) + +# Latex command to build pdf file. +latexmk = latexmk -lualatex -f -latexoption=-shell-escape -interaction=nonstopmode $< -outdir=$(outdir) $(1) $(rootfile) + +# Build PDF version adapted to printers. +printer: pdf + $(call compress,printer) + +# Build PDF version adapted to screens. +screen: pdf + $(call compress,screen) + +# Build PDF version of the thesis manuscript. +pdf: $(rootfile) + $(call latexmk) + +# Watch and automatically recompile when a file changes. +watch: $(rootfile) + $(call latexmk,-pvc -view=none) + +# Remove intermediate build artifacts. +clean: + latexmk -c -outdir=$(outdir) $(rootfile) + +# Remove all build artifacts. +clean-all: + rm -rf $(outdir) + +# Phony targets will always trigger a re-run. +.PHONY: clean-all clean watch pdf + diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..9e48b57 --- /dev/null +++ b/main.tex @@ -0,0 +1,9 @@ +\documentclass{beamer} + +\begin{document} + +\begin{frame}{Hello world!} + +\end{frame} + +\end{document}