Extract CodeForces problems to PDF files
A remake of https://github.com/AliOsm/codeforces2pdf, with Selenium replaced by requests + BeautifulSoup + either mathjax or make4ht latex renderer.
- Python 3.9+
- mathjax-node-cli (for default and graphics mode)
- make4ht (for fast mode)
- Tested on Ubuntu 22.04.1 LTS
Install dependencies with poetry
poetry install
or with raw pip
pip install -r requirements.txt
Extract a problem from a contest:
python3 codeforces2pdf.py [-d OUT_DIR] [-f|-g] <contest_id> <problem>
With -f | --fast
the utility executes a tiny bit faster and requires only TexLive distribution, but produces simpler and much less sane views of latex formulas.
With -g | --graphics
the formulas are rendered to SVGs, one may prefer this rendering, but it consumes lots of CPU time.
The project is available as open source under the terms of the MIT License.