Initial commit

This commit is contained in:
2025-02-26 10:03:47 +09:00
commit 1dd3946808
31 changed files with 1458 additions and 0 deletions

41
Makefile Normal file
View File

@@ -0,0 +1,41 @@
NAME := main
RM := rm
TEX := lualatex
BIB := biber
PANDOC := pandoc
LUA := lualatex --luaonly
TEXFLAGS := --interaction=nonstopmode --output-directory=./output/
BIBFLAGS := --input-directory=./output --output-directory=./output/
PRINTFORMAT := "\033[1;92;49m%s\033[m\n"
MARKDOWNS := $(wildcard markdown/*.md)
MAIN := $(addsuffix .tex,${NAME})
MARKDOWN_OUTPUTS := $(patsubst markdown/%.md,md-out/%.tex,$(MARKDOWNS))
.PHONY: ${MAIN} clean
all: ${MAIN}
generate:
${LUA} generate-main.lua
md-out/%.tex: markdown/%.md
mkdir -p md-out
${PANDOC} -f markdown $< -t latex -o $@
${MAIN}: $(MARKDOWN_OUTPUTS)
@mkdir -p output
@printf ${PRINTFORMAT} "[1/4] First Compilation"
-${TEX} ${TEXFLAGS} ./${NAME}.tex
@printf ${PRINTFORMAT} "[2/4] Bib Generation"
${BIB} ${BIBFLAGS} ${NAME}
@printf ${PRINTFORMAT} "[3/4] Second Compilation"
-${TEX} ${TEXFLAGS} ./${NAME}.tex
@printf ${PRINTFORMAT} "[4/4] Final Compilation"
${TEX} ${TEXFLAGS} ./${NAME}.tex
clean:
${RM} ./output/{*.aux,*.log,*.out,*.blg,*.bcf,*.bbl,*.xml}
${RM} -dr ./md-out