SHELL:=/bin/bash
MARKDOWN_FILES := $(shell find chapters -type f -name "*.md" | sort | tr '\n' ' ')
BACHELOR_TEXT := @cat $(MARKDOWN_FILES)

all: local

help:
	@echo "Please choose an option!"
	@echo "- Create pdf: make pdf"

dir:
	mkdir -p out

bachelor: @cat $(MARKDOWN_FILES)

local: dir
	@echo "Building paper"
	MERMAID_FILTER_FORMAT=pdf pandoc -V colorlinks=true -V linkcolor=black -V urlcolor=black -f 'markdown+autolink_bare_uris' --pdf-engine=lualatex --pdf-engine-opt=-shell-escape --filter mermaid-filter --lua-filter columns.lua --citeproc -s $(MARKDOWN_FILES) -o ./out/bachelor.pdf -V lang=de-DE -V fontsize=11pt --highlight-style tango --reference-links --bibliography Bachelor.bib --csl=harvard-right.csl -M lang:de --number-sections

clean:
	rm -rf out
