aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2024-05-08 16:27:09 +0200
committerSébastien Dailly <sebastien@dailly.me>2024-05-08 16:27:09 +0200
commite270c907814c091d047d17d75e65374504ea6bd8 (patch)
treefe3bbfa4410426ca2bf74fc84d236ca630e5304b
parenta8ade224f17c26536b36466ac90a63e505da94ac (diff)
Option in the Makefile to add specific arguments to rst2latex
-rw-r--r--common/Makefile.common6
-rwxr-xr-xmodel_8/Makefile10
2 files changed, 8 insertions, 8 deletions
diff --git a/common/Makefile.common b/common/Makefile.common
index 2a710cc..e324bd8 100644
--- a/common/Makefile.common
+++ b/common/Makefile.common
@@ -20,6 +20,10 @@ comma := ,
TEX_STYLE := $(subst $(space),$(comma),$(strip $(SOURCES)))
TEX_BIBS := $(subst $(space),$(comma),$(strip $(BIBS)))
+# Add a variable for specific options to add in the rst2latex command
+#
+RST_OPTIONS ?=
+
PACK = $(shell sed -e 's/\#.*$$//' -e '/^$$/d' resources/modules)
PACKAGES := $(subst $(space),$(comma),$(strip $(PACK)))
@@ -36,6 +40,7 @@ tmp/%.tex: %.rst $(INCLUDED_PDF) $(SOURCES)| tmp
--documentclass=extarticle \
--documentoption=12pt,A4,table \
--syntax-highlight=short \
+ $(RST_OPTIONS) \
--stylesheet=$(PACKAGES),$(TEX_STYLE) $< $@
sed -i -e 's/continued on next page/suite sur la page suivante/;s|^%$$||' $@
sed -i -e 's/admonition-/admonition/g' $@
@@ -49,6 +54,7 @@ tmp/%.pdf: tmp/%.tex $(BIBS) | tmp
# Put the pdf in the right place
%.pdf: tmp/%.pdf | tmp
cp $< $@
+ # Update mupdf if the process exist, or do nothing.
pkill -HUP mupdf || true
clean:
diff --git a/model_8/Makefile b/model_8/Makefile
index d77d559..eb751fe 100755
--- a/model_8/Makefile
+++ b/model_8/Makefile
@@ -1,11 +1,5 @@
include ../common/Makefile.common
-tmp/%.tex: %.rst $(INCLUDED_TEX) $(SOURCES) | tmp
- $$(command -v rst2latex rst2latex.py | head -n 1) \
+RST_OPTIONS = \
--no-section-numbering \
- --table-style=booktabs \
- --documentclass=article \
- --documentoption=12pt,A4,table \
- --syntax-highlight=short \
- --stylesheet=$(PACKAGES),$(TEX_STYLE) \
- $< $@
+ --table-style=booktabs