- The main purpose of this repository is to collect exercises (pairs of task and solution).
- Overview:
The directory database is a collection of exercises.
An exercise itself is a directory with the following structure:
|-- EXERCISE_NAME
| |-- build
| | `-- print.pdf
| |-- meta.json
| |-- solution.tex
| `-- task.texor for an exercise, where the solution is just (Python) code:
|-- EXERCISE_NAME
| |-- build
| | `-- print.pdf
| | `-- solution.tex
| |-- meta.json
| |-- solution.py
| `-- task.tex- the user has to provide at least
task.texandsolution.tex (.py, .ipynb) meta.jsonis optional- the subdirectory
build/and its content is automatically created by the programs task.tex:- contains the task
- try to avoid your own commands (e.g., rather write
\mathbb{R}instead of\R)
solution.texorbuild/solution.texorsolution.pyorsolution.ipynb- contains the solution to the task
- if the solution just contains code, which is written in
solution.pyorsolution.ipynb, then thesolution.texis auto-generated (simply inputs the code as listing) and thus located in the directorybuild/
- based on the database with the defined structure of an exercise one can write a simple LaTex template engine which collects some exercises from the database and puts them into a worksheet
- the provided example in
worksheet_generatoris quick and dirty; in its core it simply consists of the following two components- a latex command
\exercises{}...{}inlatex_src/exercisecommand.sty(should rather be an environment or existing package) - some python functions, which take the selected exercises and generate
exercises.tex(list of exercise commands\exercises{}...{})table.tex(point table, if specified)
- a latex command
-
Template: Create a template, say
sheet.tex(or simply copyworksheet_generator/examples/templates/sheet.tex)- in the preamble
- you have to write
\usepackage{exercisecommand} - import any usepackages which may be needed to properly compile your selected
exercises (e.g.,
amsmath,amsthm,amssymb,...)
- you have to write
- in the document body you can input the following three auto-generated files:
\input{newcommands}- some arbitrarily many variables that you would like to use in your
template (e.g.,
\Lecturer,\Semester) - you inform the code about your newcommands in the JSON file in the next step
- some arbitrarily many variables that you would like to use in your
template (e.g.,
\input{table}- contains a table with exercise numbers and specified Points
\input{exercises}- the selected exercises
- in the preamble
-
Config: create a config JSON file, say
sheets.json
{
"SHEET_NAME_1": {
"exercises_database": "PATH TO DIRECTORY DATABASE",
"build_directory": "WHERE YOUR OUTPUT IS PLACED",
"template": {
"filename": "PATH TO YOUR TEMPLATE .tex-FILE",
"symlink": false,
"newcommands": {
"COMMAND_NAME": "COMMAND"
}
},
"table": true,
"exercises": {
"REL. PATH FROM exercise_database TO EXERCISE-DIR": {
"Points": "5",
"tags": "Python"
},
"REL. PATH FROM exercise_database TO EXERCISE-DIR": {
"Points": "10",
"Header": false
}
}
},
"SHEET_NAME_2": {
"...": "..."
}
}- Run:
- execute
worksheet_create.py sheets.json - find the output in
build_directory/* - by default three versions of
exercises.texare generated, this results in three versions of your sheetSHEET_NAME-plain.pdf(just the tasks)SHEET_NAME-inclass.pdf(the tasks with empty space (squared) after each task to develop the solution in class)SHEET_NAME-solution.pdf(the tasks with solutions)
- also the LaTex-source will be copied to modify the sheet later on if necessary
- some examples can be found in
worksheet_generator/examples - copy them and adapt to your needs
The Latex code and the Python sample programs are licensed under GPL-3.0 and the content of the exercises is licensed under CC-BY-SA 4.0.
- Manuel Klar has contributed all exercises in
exercises/database/Python_Intro_de/ - Dominik Annen has translated handwritten solutions into LaTex and also added new exercises.
- data base editor
- data base
- set reasonable meta in sidecar files meta.json