Gradle build infrastructure for lectures
Gradle infrastructure to build Information Science lectures based on Nigel’s LaTeX lecture classes.
Features:
- multiple configurable document targets: slides, handout, notes, examples
- dynamic targets for building PDF images from PlantUML, SVG, R
- builds separate working preview and final published PDFs with lecture numbers (the latter include the lecture number in the file name)
- uses XeLaTeX via
latexmk
This repository serves as both the canonical source for the Gradle files and as an example of how to set things up.
Setting up a new set of lectures
- Create a top level
lectures
directory.
- If you’re using Git, copy
.gitignore
into lectures
.
- Create a sub-directory for each lecture, e.g.,
01_foo
, 02_bar
, …. The prefix numbering is important. Gradle uses it to figure out the lecture number.
- Copy
build.gradle.kts
and settings.gradle.kts
into lectures
.
- Create an empty
settings.gradle.kts
in 01_foo
, 02_bar
, etc.
- Copy
lecture.gradle.kts
into 01_foo
, 02_bar
, etc.
- Edit each
lecture.gradle.kts
to configure targets and images.
- Add the various content files as outlined below.
Typical lecture directory tree
The way Nigel does things 😁.
lectures
01_foo/
build.gradle.kts -> ../build.gradle.kts
doc_init.tex
images/
...
lecture.gradle.kts
lecture_content.tex
lecture_handout.tex
lecture_slides.tex
lecturedates.tex -> ../lecturedates.tex
paper_init.tex -> ../paper_init.tex
pdfs/
lecture_01_handout.pdf
lecture_01_slides.pdf
settings.gradle.kts
02_bar/
...
03_baz etc...
.gitignore
build.gradle.kts
lecturedates.tex
paper_init_tex
settings.gradle.kts
Typical gradle tasks
As applicable depending on which document targets are enabled. This list is not comprehensive, see gradle tasks --all
for a complete list.
Build tasks
- docs - Build all documents. [preview]
- examples - Build examples document. [preview]
- examples.numbered - Build numbered version of examples document.
- handout - Build handout document. [preview]
- handout.numbered - Build numbered version of handout document.
- images - Generate images.
- notes - Build notes document. [preview]
- notes.numbered - Build numbered version of notes document.
- numbered - Create numbered versions of all documents.
- slides - Build slides document. [preview]
- slides.numbered - Build numbered version of slides document.
A dynamic task is created for each generated image, e.g.:
- images.image1.pdf - Generate image1.pdf from image1.svg.
Housekeeping tasks
- debug - Print debugging information.
- clean - Clean up intermediate files.
- deepClean - Remove all files not in Git. [`git clean -fXd`]