TOC = --toc --toc-depth=2
COVER_IMAGE = images/cover_ebook_1600x2400.png
LATEX_CLASS = book
+FONTS = fonts/LinBiolinum_R.ttf fonts/LinBiolinum_RI.ttf fonts/LinBiolinum_RB.ttf
all: book
epub: $(BUILD)/epub/$(BOOKNAME).epub
-html: $(BUILD)/html/$(BOOKNAME).html
+html: $(BUILD)/html/$(BOOKNAME).html fonts css
+
+fonts: $(patsubst %,$(BUILD)/html/%,$(FONTS))
+
+css: $(BUILD)/html/css/$(BOOKNAME).css
pdf: $(BUILD)/pdf/$(BOOKNAME).pdf
$(BUILD)/html/$(BOOKNAME).html: $(CHAPTERS) $(METADATA_YAML)
mkdir -p $(BUILD)/html
- pandoc -s $(TOC) --chapters --number-offset=0 --standalone --to=html5 -o $@ $^
+ pandoc -s $(TOC) --chapters --number-offset=0 --standalone --to=html5 --css=css/$(BOOKNAME).css -o $@ $^
+
+$(BUILD)/html/fonts/%: fonts/%
+ mkdir -p $(BUILD)/html/fonts
+ cp $< $@
+
+$(BUILD)/html/css/%: css/%
+ mkdir -p $(BUILD)/html/css
+ cp $< $@
$(BUILD)/pdf/$(BOOKNAME).pdf: $(CHAPTERS) $(METADATA_YAML)
mkdir -p $(BUILD)/pdf
# pandoc $(TOC) --chapters --number-offset=0 --latex-engine=pdflatex -V documentclass=$(LATEX_CLASS) -V papersize=6x9 -o $@ $^
pandoc -s $(TOC) --chapters --number-offset=0 --template=Pandoc/templates/cs-6x9-pdf.latex --latex-engine=xelatex -o $@ $^
-.PHONY: all book clean epub html pdf
+.PHONY: all book clean epub html fonts css pdf
--- /dev/null
+@font-face {
+ font-family: "Linux Biolinum";
+ src: url("../fonts/LinBiolinum_RB.ttf");
+ font-weight: bold;
+}
+
+@font-face {
+ font-family: "Linux Biolinum";
+ src: url("../fonts/LinBiolinum_RI.ttf");
+ font-style: italic, oblique;
+}
+
+@font-face {
+ font-family: "Linux Biolinum";
+ src: url("../fonts/LinBiolinum_R.ttf");
+}
+
+body {
+ font-family: "Linux Biolinum";
+ margin-left: auto;
+ margin-right: auto;
+ max-width: 40em;
+ font-size: 120%;
+}