Skip to content

Add a base makefile and template

Karl Kosack requested to merge include_makefile_template into main

The idea here is to avoid having to have a complex makefile for each project that uses this class (including the template).

To fix that we:

  • define a base makefile (ComputingDocument.mk) that includes all the necessary rules
  • define a Makefile.template that can be used as a Makefile in projects that include computing-latex-class, this is quite simple and only requires the user to define a few things
  • update the Docker container to have the necessary utilities (e.g. plantuml, java, etc)
  • Fixes #7

Features:

  • much easier to use, and is updated with the latex style module
  • glossary building
  • plantuml diagram building
    • if the user specified PLANTUML_SOURCES, all sources listed there will be converted and placed in the build/ directory as PDFs (e.g. if one source is named figures/thing.plantuml, the pdf will be build/figures/thing.pdf and can be used in the document)
    • The user can also override PLANTUML_OPTS to give more specific options, or set PLANTUML_EXTRA_DEPS if there are non-buildable dependencies (like a style file)

This is (lightly) inspired by the IVOA document makefiles.

Example user makefile:

DOCUMENT = document_template

#optional, if there are diagrams that need to be processed:
PLANTUML_SOURCES = figures/example_model.plantuml

include computing-latex-class/ComputingDocument.mk

Running make info also produces a quick check:

======================================================
CTAO Computing LaTeX document, Makefile version 1.0.0
======================================================
DOCUMENT: document_template
FIGURES: figures/example.pdf
PLANTUML_SOURCES: figures/example_model.plantuml
PLANTUML_PDFS:  build/figures/example_model.pdf
DEPENDENCIES:
- build/glossary.tex
- build/figures/example_model.pdf
-----------------------------

and if you use a more modern Make, like remake, you get e.g:

❯ make --tasks
all                  Build the document
clean                Remove all built and intermediate files
info                 display the build options
plantuml             Force plantuml regeneration
preview              Continuously generate pdf when it changes, useful for realtime editing
Edited by Karl Kosack

Merge request reports

Loading