KattisPDF is a Python library and tool that allows to convert problem statements from Kattis to pdf.
To install KattisPDF just use pip
:
pip install kattispdf
It is necessary to install a LaTeX processor such as TeX Live or MiKTeX. As PyLaTeX is used and it needs pdflatex
or latexmk
(Recommended) to create the pdf.
latexmk
is available in almost every package manager. Search it on your favourite package manager.
In order to uselatexmk
in Windows you need to install perl
.
# If you have pearl install you can omit this
winget install "Strawberry Perl"
winget install MiKTeX
Once you are done reboot your device.
KattisPDF includes a CLI tool kpdf
to download the problems automaticly, but it can also be used in a python script.
kpdf problem-id -o path/to/output
import kattispdf
problem_id = "alchemy101"
kattispdf.generate_pdf(problem_id)
To see an example of the outputed pdf look at example.pdf.