Skip to content

Instantly share code, notes, and snippets.

@shhyou
Forked from favonia/Makefile
Created August 12, 2023 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shhyou/ce096ac5ab27bbe555235324f016c388 to your computer and use it in GitHub Desktop.
Save shhyou/ce096ac5ab27bbe555235324f016c388 to your computer and use it in GitHub Desktop.
Agda homework grading
AGDA_FILES=$(wildcard *.agda)
TEX_FILES=${AGDA_FILES:.agda=.tex}
PDF_FILES=${AGDA_FILES:.agda=.pdf}
MONO_FONT=DejaVu Sans Mono # FreeMono is another choice
PYGMENTS_STYLE=tango
GRADED_XOPP_FILES=$(wildcard *-graded.xopp)
GRADED_PDF_FILES=${GRADED_XOPP_FILES:.xopp=.pdf}
.PHONY: all
all: ${PDF_FILES} ${GRADED_PDF_FILES}
${TEX_FILES}:%.tex:%.agda Makefile
echo > $@
echo '\documentclass{article}' >> $@
echo '\usepackage{fontspec}' >> $@
echo '\usepackage{unicode-math}' >> $@
echo '\setmonofont{${MONO_FONT}}' >> $@
echo '\usepackage{fullpage}' >> $@
echo '\usepackage{minted}' >> $@
echo '\usemintedstyle{${PYGMENTS_STYLE}}' >> $@
echo '\begin{document}' >> $@
echo '\inputminted[breaklines,fontsize=\footnotesize]{agda}{$<}' >> $@
echo '\end{document}' >> $@
${PDF_FILES}:%.pdf:%.tex
xelatex --shell-escape $^
${GRADED_PDF_FILES}:%.pdf:%.xopp
xournalpp -p $@ $^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment