aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2021-06-27 14:14:43 +0200
committerGravatar √Čtienne Deparis 2021-06-27 14:14:43 +0200
commit921eb0c8fc85c2332dbb323cd6ad58c2caf60996 (patch)
tree1cfae45099286101c678ea5e3515c042ba63bd4d
parente3fc71df2fdcfd14683e5657a3e94e92c09ee802 (diff)
downloadlatex-awesomebox-921eb0c8fc85c2332dbb323cd6ad58c2caf60996.tar.gz
latex-awesomebox-921eb0c8fc85c2332dbb323cd6ad58c2caf60996.tar.xz
latex-awesomebox-921eb0c8fc85c2332dbb323cd6ad58c2caf60996.zip
Modernize buildchain and make it system-independent
i.e. download required fonts in a dedicated subfolder if needed
-rw-r--r--.gitignore3
-rw-r--r--Makefile55
-rw-r--r--README.org1
-rw-r--r--awesomebox.tex21
4 files changed, 62 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index e34ecb6..d8867c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
*.aux
*.log
*.out
-README.md
_minted-awesomebox
+awesomebox
+fonts
diff --git a/Makefile b/Makefile
index 97cf862..7bd7e31 100644
--- a/Makefile
+++ b/Makefile
@@ -3,30 +3,57 @@ BASENAME = awesomebox
#DESTDIR ?= $(shell kpsewhich -var-value=TEXMFHOME)
DESTDIR ?= /usr/share/texmf-dist
INSTALL_DIR = $(DESTDIR)/tex/xelatex/$(BASENAME)
+EMACS = emacs -Q -nw --batch
-all: distclean ctan
+all: build
-build: README.md $(BASENAME).pdf
+build: $(BASENAME).pdf
-ctan: build
- mkdir $(BASENAME)
- mv README.md $(BASENAME)/
+ctan: all $(BASENAME)/README.md
cp $(addprefix $(BASENAME), .pdf .tex .sty) LICENSE $(BASENAME)/
zip -r $(BASENAME).zip $(BASENAME)
-README.md: README.org
- pandoc -o README.md README.org
+$(BASENAME):
+ mkdir $@
-$(BASENAME).pdf:
- xelatex -interaction batchmode -halt-on-error -shell-escape "$(BASENAME).tex"
- xelatex -interaction batchmode -halt-on-error -shell-escape "$(BASENAME).tex"
+$(BASENAME)/README.md: $(BASENAME) README.org
+ $(EMACS) --eval "(require 'ox-md)" --eval "(find-file \"README.org\")" \
+ -f org-md-export-to-markdown
+ mv README.md $@
+
+$(BASENAME).pdf: allfonts $(BASENAME).tex
+ xelatex -interaction batchmode -halt-on-error -shell-escape $(word 2,$^)
+ xelatex -interaction batchmode -halt-on-error -shell-escape $(word 2,$^)
+
+OTF_FILES = fonts/Inconsolata.otf \
+ fonts/LinBiolinum_R.otf fonts/LinBiolinum_RB.otf fonts/LinBiolinum_RI.otf \
+ fonts/LinLibertine_R.otf fonts/LinLibertine_RB.otf fonts/LinLibertine_RI.otf \
+ fonts/LinLibertine_RBI.otf
+
+fonts:
+ mkdir fonts
+
+fonts/Inconsolata.otf:
+ curl -s -o $@ https://www.levien.com/type/myfonts/Inconsolata.otf
+
+fonts/LinLibertineOTF_5.3.0_2012_07_02.tgz:
+ curl -sL -o $@ https://downloads.sourceforge.net/project/linuxlibertine/linuxlibertine/5.3.0/LinLibertineOTF_5.3.0_2012_07_02.tgz
+
+fonts/Lin%.otf: fonts/LinLibertineOTF_5.3.0_2012_07_02.tgz
+ tar -C fonts -xzf fonts/LinLibertineOTF_5.3.0_2012_07_02.tgz $(@F)
+
+allfonts: fonts $(OTF_FILES)
clean:
- rm -rf $(BASENAME) _minted-$(BASENAME)
- rm -f README.md $(addprefix $(BASENAME), .aux .log .out .zip) $(addprefix test, .aux .log .pdf)
+ rm -rf _minted-$(BASENAME)
+ rm -f $(addprefix $(BASENAME), .aux .log .out .zip) $(addprefix test, .aux .log .pdf)
+
+cleanctan:
+ rm -rf $(BASENAME)
-distclean: clean
- rm $(BASENAME).pdf
+cleanall: clean cleanctan
+ rm -rf fonts
+ rm -f $(BASENAME).pdf
install: $(BASENAME).pdf
install -d -m 755 $(INSTALL_DIR)
diff --git a/README.org b/README.org
index 5900cd0..3396f2f 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,5 @@
#+title: Awesome Boxes
+#+options: toc:nil
Awesome Boxes is all about drawing admonition blocks around text to
inform or alert your readers about something particular. The specific
diff --git a/awesomebox.tex b/awesomebox.tex
index 9362acf..e5896f3 100644
--- a/awesomebox.tex
+++ b/awesomebox.tex
@@ -4,9 +4,24 @@
\usepackage{xltxtra}
\defaultfontfeatures{Scale=MatchLowercase}
-\setmonofont[Mapping=tex-text,Scale=0.9]{Inconsolata}
-\setromanfont[Mapping=tex-text]{Linux Libertine O}
-\setsansfont[Mapping=tex-text]{Linux Biolinum O}
+\setmonofont[
+ Path = fonts/,
+ Extension = .otf,
+ Mapping = tex-text,
+ Scale = 0.9]{Inconsolata}
+\setromanfont[
+ Path = fonts/,
+ Extension = .otf,
+ BoldFont = *B,
+ ItalicFont = *I,
+ BoldItalicFont = *BI,
+ Mapping = tex-text]{LinLibertine_R}
+\setsansfont[
+ Path=fonts/,
+ Extension = .otf,
+ BoldFont = *B,
+ ItalicFont = *I,
+ Mapping = tex-text]{LinBiolinum_R}
\usepackage{polyglossia}
\setdefaultlanguage{english}