From 0c4360b1592473f7da94ddfafd733dd09e4327f4 Mon Sep 17 00:00:00 2001 From: Paul Gannay Date: Wed, 15 Jan 2025 13:01:08 +0100 Subject: [PATCH 1/3] Choose to compile handout or presentation with flags in Makefile --- courses/01_beginners/Makefile | 9 ++++++--- courses/01_beginners/main.tex | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/courses/01_beginners/Makefile b/courses/01_beginners/Makefile index 4d6e713..e7f4a44 100644 --- a/courses/01_beginners/Makefile +++ b/courses/01_beginners/Makefile @@ -1,7 +1,10 @@ -all: main +handout: + latexmk -pdfxe -shell-escape -jobname=handout -usepretex="\def\ishandout{handout}" $< -%: - latexmk -pdfxe $< +all: handout presentation + +presentation: + latexmk -pdfxe -shell-escape -jobname=presentation -usepretex="\def\ishandout{}" $< clean: latexmk -c diff --git a/courses/01_beginners/main.tex b/courses/01_beginners/main.tex index 4f77d31..4e5dc60 100644 --- a/courses/01_beginners/main.tex +++ b/courses/01_beginners/main.tex @@ -2,7 +2,7 @@ \documentclass[ aspectratio=169, - handout, + \ishandout, ]{beamer} \usepackage{minted} \usepackage{xcolor} From 9c612f71ab210afdd376965997315df5623555c3 Mon Sep 17 00:00:00 2001 From: Paul Gannay Date: Mon, 27 Jan 2025 15:32:47 +0100 Subject: [PATCH 2/3] Correctly clean files with the new split between presentation and handout --- courses/01_beginners/.latexmkrc | 5 ++++- courses/01_beginners/Makefile | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/courses/01_beginners/.latexmkrc b/courses/01_beginners/.latexmkrc index 55126bd..de371e4 100644 --- a/courses/01_beginners/.latexmkrc +++ b/courses/01_beginners/.latexmkrc @@ -1 +1,4 @@ -$xelatex = 'xelatex -shell-escape %O %S' +$xelatex = 'xelatex -shell-escape %O %S'; + +# List of extension latexmk can safely clean (correspond to file created by the Beamer plug-in) +$clean_ext = "nav snm vrb"; diff --git a/courses/01_beginners/Makefile b/courses/01_beginners/Makefile index e7f4a44..db5e87e 100644 --- a/courses/01_beginners/Makefile +++ b/courses/01_beginners/Makefile @@ -1,14 +1,16 @@ handout: latexmk -pdfxe -shell-escape -jobname=handout -usepretex="\def\ishandout{handout}" $< -all: handout presentation - presentation: latexmk -pdfxe -shell-escape -jobname=presentation -usepretex="\def\ishandout{}" $< +all: handout presentation + clean: - latexmk -c + latexmk -c -jobname=handout + latexmk -c -jobname=presentation cleanall: - latexmk -C + latexmk -C -jobname=handout + latexmk -C -jobname=presentation rm -rf _minted-* From 4391f0b2cb7de98099c5077ca2d54ff3e840d15a Mon Sep 17 00:00:00 2001 From: Paul Gannay Date: Tue, 28 Jan 2025 10:58:09 +0100 Subject: [PATCH 3/3] New way of choosing between presentation and handout By default, will compile in handout mode, can be compiled in presentation mode if parameter is passed. Both are compiled with 'make all'. --- courses/01_beginners/Makefile | 4 ++-- courses/01_beginners/main.tex | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/courses/01_beginners/Makefile b/courses/01_beginners/Makefile index db5e87e..d7a7468 100644 --- a/courses/01_beginners/Makefile +++ b/courses/01_beginners/Makefile @@ -1,8 +1,8 @@ handout: - latexmk -pdfxe -shell-escape -jobname=handout -usepretex="\def\ishandout{handout}" $< + latexmk -pdfxe -shell-escape -jobname=handout $< presentation: - latexmk -pdfxe -shell-escape -jobname=presentation -usepretex="\def\ishandout{}" $< + latexmk -pdfxe -shell-escape -usepretex="\def\createHandout{}" -jobname=presentation $< all: handout presentation diff --git a/courses/01_beginners/main.tex b/courses/01_beginners/main.tex index 4e5dc60..d5c8e42 100644 --- a/courses/01_beginners/main.tex +++ b/courses/01_beginners/main.tex @@ -1,9 +1,14 @@ % !TeX program = xelatex +% Create command `createHandout` only if it doesn't already exists. +% To compile in presentation mode, pass a command createHandout doing nothing. +\providecommand{\createHandout}{handout} + \documentclass[ aspectratio=169, - \ishandout, + \createHandout ]{beamer} + \usepackage{minted} \usepackage{xcolor} \usepackage{tcolorbox}