Last active
August 12, 2023 05:33
-
-
Save favonia/c7ed26c4fe2b074471eff2f539be5113 to your computer and use it in GitHub Desktop.
Agda homework grading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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