Sha256: 42fc7f8e22cac96f423b1794d40dcc4c9a83a1b7034cee5b24a58f45ba60486b

Contents?: true

Size: 1.49 KB

Versions: 1

Compression:

Stored size: 1.49 KB

Contents

TARGET_BASE :=<%= name %>
MD_SRC :=$(TARGET_BASE).md
TEX_SRC :=$(TARGET_BASE).tex
GENERATED_TEX :=$(TARGET_BASE).gen.tex
GENERATED_PDF :=$(TARGET_BASE).gen.pdf
GENERATED_HTML :=$(TARGET_BASE).gen.html

ALL_TARGETS :=$(GENERATED_PDF) $(GENERATED_TEX) $(GENERATED_HTML)

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

all: $(ALL_TARGETS)
.PHONY: all

ifdef BIB
  PANDOC_BIB=--biblatex --biblio=$(BIB)
else
  PANDOC_BIB=
endif

ifdef TEX_TEMPLATE
  PANDOC_TEX_TEMPLATE=--template=$(TEX_TEMPLATE)
else
  PANDOC_TEX_TEMPLATE=
endif

%.gen.pdf: %.md $(TEX_TEMPLATE) $(BIB)
	pandoc \
	$(PANDOC_BIB) \
	$(PANDOC_TEX_TEMPLATE) \
	$(CLASSOPTION) \
	-s \
	$< \
	-o $@

%.gen.tex: %.md $(TEX_TEMPLATE) $(BIB)
	pandoc \
	$(PANDOC_BIB) \
	$(PANDOC_TEX_TEMPLATE) \
	$(CLASSOPTION) \
	-s \
	$< \
	-o $@

ifdef HTML_TEMPLATE
  PANDOC_HTML_TEMPLATE=--template=$(HTML_TEMPLATE)
else
  PANDOC_HTML_TEMPLATE=
endif

%.gen.html: %.gen.tex
	pandoc \
	$(PANDOC_HTML_TEMPLATE) \
	--mathjax \
	-s \
	$< \
	-o $@

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

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


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

clean-extra:
	@-rm *.log *.aux *.bcf *.bbl *.blg *.dvi *.out *.run.xml *.lot *.lof *.toc 2> /dev/null || true
.PHONY: clean-extra

clean: clean-extra
	@-rm -r *.gen 2> /dev/null || true
	@-rm *.gen.* 2> /dev/null || true
.PHONY: clean

clean-pdf:
	@-rm *.gen.pdf 2> /dev/null || true
.PHONY: clean-pdf

Version data entries

1 entries across 1 versions & 1 rubygems

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