This repository contains the source files for the physics problem collection books for the high school division of the Estonian physics olympiad, including the regional, national and open rounds. There are two books, each containing 200 problems with up to 30 problems from each year (10 from each round). The books span years 2005 - 2011 and 2012 - 2018. There's also a web version containing all the problems in the repository.
The LaTeX files for each book are in corresponding directories and can be freely compiled using the style file problem-collection.sty. However, the .tex files themselves are generated using Python scripts. This is because each problem is stored in a separate file in the problems/ directory and Python is a convenient binder language for collating problems into a single file based on the year, topic, difficulty etc.
All the problems are in separate files containing commands which set the following metadata for each problem:
- name of the author
- round of appearance
- year of appearance
- order number of the problem in the round
- approximate difficulty out of 10 points
- topic
- problem name
The metadata is then used when displaying the problem with the \prob command. A problem contains a statement, hint, and a solution (separated by the \prob, \hint, \solu and \probend tokens), English is also supported. One can toggle displaying either the statement, hint, or solution with the \toggleStatement, \toggleHint or \toggleSolution commands.
On the Python side, the compilation of the book follows a class ProblemManager (found in python_dependencies/) that's fed the directories of the problem .tex files and which then handles the sorting of problems and distributing them between "collections" (i.e the books) specified by the user. The "collections" are additional classes which store problems (class Problem) which support retrieving the LaTeX code for statements, hints, solutions in both Estonian and English in their tidied form.
When feeding the ProblemManager a folder of .tex files, the filenames do not actually matter as the metadata is retreived purely from the file itself, they're only there for nicer sorting in the directory.
The books are compiled using a Python script of the same name.
This file allows one to edit the .tex files generated by the python scripts and then update the corresponding problem .tex files by running the script. When the script is run and it encounters modified text, it will ask for confirmation for the text to be updated in the source file. To cancel the update, you need to close the script. For now, updating the problem year, number and round are not recommended as this creates conflicts when opening the source file (the backtracer assumes a specific naming convention for the source files). Furthermore, when updating the problem statement in English, one needs to modify the name after the \ifEngStatement line not the first argument of the \ylDisplay command.
To run the file, pass the location of the book .tex file as the source argument, e.g.
python helper-backtracer.py --source="book_one/esimene-kogumik-veeb`.tex`
The python scripts in the project are licensed under the GNU General Public License - see the LICENSE-GNU.md file for details
The contents of the problems, including the statements, hints, solutions in both Estonian and English are licensed under the Creative Commons Attribution-NonCommercial 4.0 International Public License - see the LICENSE-CC.md file for details