Sha256: 5686795dbdca47405d4f8f07a98bc4911fc09fd6483af4dc7f910661beeda56b

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

TARGET_BASE :=<%= name %>
MD_SRC :=$(TARGET_BASE).md
TEX_SRC :=$(TARGET_BASE).src.tex
GENERATED_TEX :=$(TARGET_BASE).tex

BIB :=references.bib

TEMPLATE :=template.pandoc

# Default geometry
geometry =margin=2cm

# Build Rules
#============
default: quick
.PHONY: default

ifeq ("$(wildcard $(TEX_SRC))","")
$(GENERATED_TEX): $(MD_SRC) tex.$(TEMPLATE) $(BIB)
	pandoc \
	--biblatex \
	--template=tex.$(TEMPLATE) \
	--biblio $(BIB) \
	--variable geometry:$(geometry) \
	--variable fontsize:12pt \
	$(CLASSOPTION) \
	-s \
	$< \
	-o $@
$(TEX_SRC): $(GENERATED_TEX)
	mv $< $@
	rm $(MD_SRC)
else
$(GENERATED_TEX): $(TEX_SRC)
	cp $< $@
endif

$(TARGET_BASE).pdf: $(GENERATED_TEX)
	pdflatex $(TARGET_BASE)
	biber $(TARGET_BASE)
	pdflatex $(TARGET_BASE)
	pdflatex $(TARGET_BASE)
	$(MAKE) clean-extra

quick: $(GENERATED_TEX)
	pdflatex $(GENERATED_TEX)
	$(MAKE) clean-extra
.PHONY: quick

pdf: $(TARGET_BASE).pdf
.PHONY: pdf

tex: $(GENERATED_TEX)
.PHONY: tex

tex-src: $(TEX_SRC)
.PHONY: tex-src

draft: CLASSOPTION =--variable classoption:draft
draft: pdf
.PHONY: draft

final: CLASSOPTION =--variable classoption:final
final: pdf
.PHONY: final


# Meta Rules
#===========
print-%:
	@echo $* = $($*)
.PHONY: print-%

clean-extra:
	@-rm *.log *.aux *.bcf *.bbl *.blg *.dvi *.out *.run.xml *.lot *.lof *.toc $(GENERATED_TEX) || true
.PHONY: clean-extra

clean: clean-extra clean-pdf
.PHONY: clean

clean-pdf:
	@-rm *.pdf || true
.PHONY: clean-pdf

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
latex_document-0.1.3 templates/md/Makefile.tt