Compare commits

...

No commits in common. "master" and "bachelor-thesis-build" have entirely different histories.

43 changed files with 6135 additions and 8 deletions

View file

@ -1,8 +0,0 @@
# LatexPackagesBuild
Ready to use builds of my LaTeX packages.
These are mirrored builds of the main [latex-packages](https://git.abstractnonsen.se/latex/latex-packages) repository.
Branches named `${BRANCH}` in the main repository will be built and made available here as `${BRANCH}-build`. So feel free to clone these branches here to easily update your packages when the main package repo updates - without having to build the packages yourself!
For further information about these packages, visit the LatexPackages repository.

466
build_info.json Normal file
View file

@ -0,0 +1,466 @@
{
"build_time": "",
"source files": {
"version": "v2.9-27-g2d16a2d",
"commit": "2d16a2d72a81696210140564037ce71ac4d8d91b",
"dirty": false
},
"pytex": {
"version": "v1.2.0-31-gc9bb0e8",
"commit": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"dirty": false
},
"tex_sources": [
{
"name": "math/faktor/mkessler-faktor.sty",
"source file": "math/faktor/faktor.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "618fa0a7a27b148f11ce06d43d5e0170",
"dirty": false
},
{
"name": "math/mathfont/mkessler-mathfont.sty",
"source file": "math/mathfont/mathfont.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "788546ecf5b583122f2088467f39021e",
"dirty": false
},
{
"name": "math/mathop/mkessler-mathop.sty",
"source file": "math/mathop/mathop.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "fa41a1c28ed039fdf647aedf72c1a7d5",
"dirty": false
},
{
"name": "math/mathfixes/mkessler-mathfixes.sty",
"source file": "math/mathfixes/mathfixes.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "ddbad7b601312828f19f9812c30247ba",
"dirty": false
},
{
"name": "math/mathsymb/mkessler-mathsymb.sty",
"source file": "math/mathsymb/mathsymb.pysty",
"build time": "2022/06/27 14:32",
"source version": "v2.9-24-g80377fc",
"source commit hash": "80377fc7844887fae81a19280a0c96087eba99b0",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "1a1e3360defc5ac209a9620f2c84cc20",
"dirty": false
},
{
"name": "math/mathalias/mkessler-mathalias.sty",
"source file": "math/mathalias/mathalias.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "710f8e96ac17316c338489e9042d7e27",
"dirty": false
},
{
"name": "math/mathfig/mkessler-mathfig.sty",
"source file": "math/mathfig/mathfig.pysty",
"build time": "2022/06/27 15:10",
"source version": "v2.9-26-g8c5b9ad",
"source commit hash": "8c5b9ad7a43452dd729b066ea7818e2a7436a149",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "fd27c49b9ffdb8bd8756095816488beb",
"dirty": false
},
{
"name": "wrappers/todo/mkessler-todo.sty",
"source file": "wrappers/todo/todo.pysty",
"build time": "2022/06/27 15:33",
"source version": "v2.9-27-g2d16a2d",
"source commit hash": "2d16a2d72a81696210140564037ce71ac4d8d91b",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "2c09ed62ddf08a701e9b51995ca17296",
"dirty": false
},
{
"name": "wrappers/math/mkessler-math.sty",
"source file": "wrappers/math/math.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "f90a3672b511eb8b37264b7a286d46cf",
"dirty": false
},
{
"name": "wrappers/hypersetup/mkessler-hypersetup.sty",
"source file": "wrappers/hypersetup/hypersetup.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "3143151d3e987e479a9f6ef242156814",
"dirty": false
},
{
"name": "wrappers/enumerate/mkessler-enumerate.sty",
"source file": "wrappers/enumerate/enumerate.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "a2a3eab71093fac3709925890a7df306",
"dirty": false
},
{
"name": "wrappers/unicodechar/mkessler-unicodechar.sty",
"source file": "wrappers/unicodechar/unicodechar.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "5ed2b996d495d8d1f32524a93184f96b",
"dirty": false
},
{
"name": "wrappers/incfig/mkessler-incfig.sty",
"source file": "wrappers/incfig/incfig.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "7c4be513b46c172683e075d5206f07d6",
"dirty": false
},
{
"name": "utils/findpackage/mkessler-findpackage.sty",
"source file": "utils/findpackage/findpackage.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "a755107a340cc79c3121f067b2e33ba7",
"dirty": false
},
{
"name": "utils/counters/mkessler-counters.sty",
"source file": "utils/counters/counters.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "b6c586ab3f307ff7a9b8b3594ec1b5c9",
"dirty": false
},
{
"name": "indexing/vocab/mkessler-vocab.sty",
"source file": "indexing/vocab/vocab.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "c69b7350ab57b062ec42c408cf30ecbb",
"dirty": false
},
{
"name": "lecture-notes/lectures/mkessler-lectures.sty",
"source file": "lecture-notes/lectures/lectures.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "12de756cdaf55cb9510085084a6c0be6",
"dirty": false
},
{
"name": "wip/removed/mkessler-removed.sty",
"source file": "wip/removed/removed.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "bdc4b470c0f4f3ddc21c2ebbf80501be",
"dirty": false
},
{
"name": "wip/code/mkessler-code.sty",
"source file": "wip/code/code.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "ccd43b8b097192d79e6dee3a9904a272",
"dirty": false
},
{
"name": "wip/lang-input/mkessler-lang-input.sty",
"source file": "wip/lang-input/lang-input.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "b0593c4e5620465557ae10ad7c050dea",
"dirty": false
},
{
"name": "wip/restate/mkessler-restate.sty",
"source file": "wip/restate/restate.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "f1f3070209a9a0775262ac8c14007b6e",
"dirty": false
},
{
"name": "wip/bibliography/mkessler-bibliography.sty",
"source file": "wip/bibliography/bibliography.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "298338a3ecffa320d4d19b6885737f13",
"dirty": false
},
{
"name": "wip/gag/mkessler-gag.sty",
"source file": "wip/gag/gag.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "b50afc5a5bfabfce6be3e1d802d9d852",
"dirty": false
},
{
"name": "wip/subproof/mkessler-subproof.sty",
"source file": "wip/subproof/subproof.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "4bd597101342feff72c63e34fd142236",
"dirty": false
},
{
"name": "wip/figures/mkessler-figures.sty",
"source file": "wip/figures/figures.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "5a8399b3bc7b6208ab8188a340fb2c53",
"dirty": false
},
{
"name": "wip/exsheet/mkessler-exsheet.sty",
"source file": "wip/exsheet/exsheet.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "21757fc9c7ed670b5f9296ff0828edd2",
"dirty": false
},
{
"name": "quiver/mkessler-quiver.sty",
"source file": "quiver/quiver.pysty",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "55dda8b2de907a11bef1b698352b50ea",
"dirty": false
},
{
"name": "lecture-notes/script/mkessler-script.cls",
"source file": "lecture-notes/script/script.pycls",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "669a15fc94e1222274a7625133e3ab62",
"dirty": false
},
{
"name": "exercises/sheet/mkessler-sheet.cls",
"source file": "exercises/sheet/sheet.pycls",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "e3d249089d21d99c24f817712c686357",
"dirty": false
},
{
"name": "math/categories/translator-mathematical-categories-dictionary-English.dict",
"source file": "math/categories/mathematical-categories.pydict",
"build time": "2022/06/27 14:32",
"source version": "v2.9-24-g80377fc",
"source commit hash": "80377fc7844887fae81a19280a0c96087eba99b0",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "f9f9aae576fe604594a66db7bffac825",
"dirty": false
},
{
"name": "math/categories/translator-mathematical-categories-dictionary-German.dict",
"source file": "math/categories/mathematical-categories.pydict",
"build time": "2022/06/27 14:32",
"source version": "v2.9-24-g80377fc",
"source commit hash": "80377fc7844887fae81a19280a0c96087eba99b0",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "1bdf8dade83a662c3dc6f9866daf8962",
"dirty": false
},
{
"name": "environments/refproof/translator-proof-dictionary-English.dict",
"source file": "environments/refproof/proof.pydict",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "7d7e8be901315313da48f658980ab691",
"dirty": false
},
{
"name": "environments/refproof/translator-proof-dictionary-German.dict",
"source file": "environments/refproof/proof.pydict",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "5473401c146887c2e17d2f2aab06317f",
"dirty": false
},
{
"name": "math/categories/mkessler-categories.sty",
"source file": "math/categories/categories.pysty3",
"build time": "2022/06/27 14:46",
"source version": "v2.9-25-ge9f75cd",
"source commit hash": "e9f75cd2200d15fad9c02b0a72f34344285b094a",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "5c0f6e9f160bab138140e1ae3850f02a",
"dirty": false
},
{
"name": "utils/powerset/mkessler-powerset.sty",
"source file": "utils/powerset/powerset.pysty3",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "b565662b5c3a69790ab793f3f627d37f",
"dirty": false
},
{
"name": "indexing/symbindex/mkessler-symbindex.sty",
"source file": "indexing/symbindex/symbindex.pysty3",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "c632ef34aebf5c5d781674f4f7d00b65",
"dirty": false
},
{
"name": "environments/refproof/mkessler-refproof.sty",
"source file": "environments/refproof/refproof.pysty3",
"build time": "2022/06/27 14:32",
"source version": "v2.9-24-g80377fc",
"source commit hash": "80377fc7844887fae81a19280a0c96087eba99b0",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "c2ca093a0f88cdb9a44c8a1ba3e30d90",
"dirty": false
},
{
"name": "wip/cache/mkessler-cache.sty",
"source file": "wip/cache/cache.pysty3",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "8750b59f5a8f6f9597d7f3554d337780",
"dirty": false
},
{
"name": "environments/fancythm/fancythm.sty",
"source file": "environments/fancythm/fancythm.dtx",
"build time": "2022/06/27 14:32",
"source version": "v2.9-24-g80377fc",
"source commit hash": "80377fc7844887fae81a19280a0c96087eba99b0",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "fe42cebefd1d73bf723bf4a1dc8071e7",
"dirty": false
},
{
"name": "environments/thmstyle/thmstyle.sty",
"source file": "environments/thmstyle/thmstyle.dtx",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "25887354cf8b134a804f11e8c8e05746",
"dirty": false
},
{
"name": "environments/groupthm/groupthm.sty",
"source file": "environments/groupthm/groupthm.dtx",
"build time": "2022/06/12 15:21",
"source version": "v2.9-14-g6545412",
"source commit hash": "6545412baf11aa044aabf606c7d44b3941c9fb20",
"pytex version": "v1.2.0-31-gc9bb0e8",
"pytex commit hash": "c9bb0e87c91beae3e17a829603e4459cf804ec51",
"md5sum": "72edca95f60949839b50cb9a5fb0b012",
"dirty": false
}
]
}

View file

@ -0,0 +1,412 @@
%%
%% This is file `fancythm.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fancythm.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from fancythm.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file fancythm.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% File: fancytm.dtx
\ProvidesExplPackage{fancythm}{2022/01/30}{0.0.2}{Grouped theorems.}
\RequirePackage{l3keys2e}
\RequirePackage[default styles]{thmstyle}
\cs_set_eq:NN \arabic:n \arabic
\cs_set_eq:NN \counter_new:n \newcounter
\cs_set_eq:NN \counter_within:nn \counterwithin
\cs_new:Npn \counter_new:nn #1 #2
{
\counter_new:n { #1 }
\counter_within:nn { #1 } { #2 }
}
\cs_new:Npn \counter_if_exist_p:n #1
{
\cs_if_exist_p:c { c@ #1 }
}
\cs_new:Npn \counter_if_exist:nT #1
{
\cs_if_exist:cT { c@ #1 }
}
\cs_new:Npn \counter_if_exist:nF #1
{
\cs_if_exist:cF { c@ #1 }
}
\cs_new:Npn \counter_if_exist:nTF #1
{
\cs_if_exist:cTF { c@ #1 }
}
\cs_set_eq:Nc \counter_undefined_error:n { @nocounterr }
\cs_new:Npn \counter_ensure_exist:n #1
{
\counter_if_exist:nF { #1 }
{
\counter_undefined_error:n { #1 }
}
}
\cs_new:Npn \counter_the:n #1
{
\use:c { the #1 }
}
\cs_new:Npn \counter_set_the:nn #1 #2
{
\counter_ensure_exist:n { #1 }
\exp_args:Nc \renewcommand { the #1 } { #2 }
}
\cs_new:Npn \counter_sub:nn #1 #2
{
\counter_within:nn { #1 } { #2 }
\counter_set_the:nn { #1 }
{
\counter_the:n { #2 } . \arabic:n { #1 }
}
}
\cs_new:Npn \counter_new_sub:nn #1 #2
{
\counter_new:n { #1 }
\counter_sub:nn { #1 } { #2 }
}
\cs_new:Npn \__fancythm_counter_sub_if_exist:n #1
{
\counter_if_exist:nT { #1 }
{
\counter_new_sub:nn { in #1 } { #1 }
}
}
\cs_new:Npn \counter_alias:nn #1 % trailing #2
{
\cs_undefine:c { c@ #1 }
\use:c { @counteralias } { #1 } % implicit #2
}
\cs_generate_variant:Nn \counter_alias:nn { n x }
\counter_new:n { indocument }
\__fancythm_counter_sub_if_exist:n { section }
\__fancythm_counter_sub_if_exist:n { subsection }
\__fancythm_counter_sub_if_exist:n { chapter }
\__fancythm_counter_sub_if_exist:n { part }
\counter_alias:nn { toplevel } { indocument }
\counter_new_sub:nn { sublevel } { toplevel }
\counter_new_sub:nn { subsublevel } { sublevel }
\counter_new_sub:nn { subsubsublevel } { subsublevel }
\str_new:N \g__fancythm_style_str
\bool_new:N \g__fancythm_translator_bool
\bool_new:N \g__fancythm_generate_defaults_bool
\tl_new:N \l__fancythm_key_name_tl
\tl_new:N \l__fancythm_key_mdframed_tl
\tl_new:N \l__fancythm_key_style_tl
\clist_new:N \l__fancythm_key_group_clist
\clist_new:N \l__fancythm_key_thmtools_clist
\tl_new:N \l__fancythm_name_tl
\clist_new:N \l__fancythm_thmtools_clist
\clist_new:N \l__fancythm_group_clist
\clist_new:N \g__fancythm_groupthm_option_clist
\keys_define:nn { fancythm }
{
translator .bool_set:N = \g__fancythm_translator_bool ,
translator .default:n = { true } ,
generate defaults .bool_set:N = \g__fancythm_generate_defaults_bool ,
generate defaults .default:n = { true } ,
number in .choices:nn =
{ document, section, subsection, chapter, part }
{
\counter_alias:nx { toplevel } { in \tl_use:N \l_keys_choice_tl }
} ,
number in .default:n = { document } ,
style .choices:nn =
{ fancy, plain, classic }
{
\str_set:Nn \g__fancythm_style_str { \tl_use:N \l_keys_choice_tl }
} ,
style .default:n = { fancy } ,
cache .code:n =
{
\clist_put_right:Nn \g__fancythm_groupthm_option_clist { cache = #1 }
} ,
cache .default:n = { true } ,
cache version .code:n =
{
\clist_put_right:Nn \g__fancythm_groupthm_option_clist { cache version = #1 }
} ,
cache version .default:n = { 0 } ,
}
\keys_define:nn { fancythm / fancytheorem }
{
name .tl_set:N = \l__fancythm_key_name_tl ,
name .default:n = \c_novalue_tl ,
mdframed .tl_set:N = \l__fancythm_key_mdframed_tl ,
mdframed .default:n = \c_novalue_tl ,
style .tl_set:N = \l__fancythm_key_style_tl ,
style .default:n = \c_novalue_tl ,
group .clist_set:N = \l__fancythm_key_group_clist ,
group .default:n = {} ,
thmtools .clist_set:N = \l__fancythm_key_thmtools_clist ,
thmtools .default:n = {} ,
}
\keys_set:nn { fancythm } { translator, generate defaults, number in, style }
\ProcessKeysOptions{ fancythm }
\cs_new:Npn \__fancythm_require_package:nn #1
{
\RequirePackage [ #1 ]
}
\cs_generate_variant:Nn \__fancythm_require_package:nn { V n }
\__fancythm_require_package:Vn \g__fancythm_groupthm_option_clist { groupthm }
\bool_if:NTF \g__fancythm_translator_bool
{
\RequirePackage{translator}
\usedictionary{translator-environment-names}
\cs_set_eq:NN \__fancythm_translate:n \translate
}
{
\cs_set_eq:NN \__fancythm_translate:n \use:n
}
\cs_new:Npn \__fancythm_set_normalized_keys:nn #1 #2
{
\keys_set:nn { fancythm / fancytheorem } { name, mdframed, style, group, thmtools }
\keys_set:nn { fancythm / fancytheorem } { #1 }
\clist_set_eq:NN \l__fancythm_group_clist \l__fancythm_key_group_clist
\clist_set_eq:NN \l__fancythm_thmtools_clist \l__fancythm_key_thmtools_clist
\tl_if_eq:NnF \l__fancythm_key_mdframed_tl { \c_novalue_tl }
{
\clist_put_right:Nx \l__fancythm_thmtools_clist
{
mdframed = { style = \tl_use:N \l__fancythm_key_mdframed_tl }
}
}
\tl_if_eq:NnF \l__fancythm_key_style_tl { \c_novalue_tl }
{
\clist_put_right:Nx \l__fancythm_thmtools_clist
{
style = \tl_use:N \l__fancythm_key_style_tl
}
}
\tl_if_eq:NnTF \l__fancythm_key_name_tl { \c_novalue_tl }
{
\tl_set:Nx \l__fancythm_name_tl
{
\text_titlecase_first:n { \tl_trim_spaces:n { #2 } }
}
}
{
\tl_set_eq:NN \l__fancythm_name_tl \l__fancythm_key_name_tl
}
\tl_set:Nx \l__fancythm_name_tl
{
\exp_not:N \csname __fancythm_translate:n \exp_not:N \endcsname { \tl_use:N \l__fancythm_name_tl }
}
}
\cs_new:Npn \__fancythm_wrap_multiple:nnn #1 #2 #3
{
\cs_set:Npn \__fancythm_map_aux:n ##1
{
\cs_new:cn { #2 }
{
#3
}
}
\clist_map_function:nN { #1 } \__fancythm_map_aux:n
}
\__fancythm_wrap_multiple:nnn
{ new, provide }
{ fancythm_#1_theorem:nnnn }
{
\use:c { groupthm_#1_family:nnnnn } { ##1 } { dagger, star, nobraces } { ##3 } { ##4 } { ##2 }
\use:c { groupthm_#1_family_options:nnnn }
{ ##1 }
{ !s !t+ !t-}
{
\IfBooleanT { ####1 }
{
\AddTheoremToGroup { star }
}
\IfBooleanT { ####2 }
{
\AddTheoremToGroup { dagger }
}
\IfBooleanT { ####3 }
{
\AddTheoremToGroup { nobraces }
}
}
{ ##2 }
}
\cs_generate_variant:Nn \fancythm_new_theorem:nnnn { n V V V }
\cs_generate_variant:Nn \fancythm_provide_theorem:nnnn { n V V V }
\__fancythm_wrap_multiple:nnn
{ new, provide }
{ fancythm_#1_theorem:nn }
{
\__fancythm_set_normalized_keys:nn { ##1 } { ##2 }
\use:c { fancythm_#1_theorem:nVVV }
{ ##2 }
\l__fancythm_group_clist
\l__fancythm_name_tl
\l__fancythm_thmtools_clist
}
\cs_new:Npn \__fancythm_new_document_command:Nnn #1 #2 #3
{
\NewDocumentCommand { #1 } { #2 } { #3 }
}
\cs_generate_variant:Nn \__fancythm_new_document_command:Nnn { c n n }
\cs_new:Npn \__fancythm_wrap_multiple_document:nnnn #1 #2 #3 #4
{
\cs_set:Npn \__fancythm_map_aux:n ##1
{
\cs_set:Nn \__fancythm_Declarator: { \text_titlecase_first:n { ##1 } }
\__fancythm_new_document_command:cnn { #2 } { #3 } { #4 }
}
\clist_map_function:nN { #1 } \__fancythm_map_aux:n
}
\__fancythm_wrap_multiple_document:nnnn
{ new, provide }
{ \__fancythm_Declarator: FancyTheorem }
{ O{} m }
{
\use:c { fancythm_#1_theorem:nn } { ##1 } { ##2 }
}
\declaretheoremstyle[notebraces={{}{}}]{nobraces}
\groupthm_new_group:nnnnn { star } { } { * } { } { }
\groupthm_new_group:nnnnn { dagger } { } { $^{\dagger}$ } { } { }
\groupthm_new_group:nnnnn { big } { } { } { } { sibling = toplevel }
\groupthm_new_group:nnnnn { small } { } { } { } { sibling = sublevel }
\groupthm_new_group:nnnnn { tiny } { } { } { } { numbered = no }
\groupthm_new_group:nnnnn { custom } { } { } { } { sibling = sublevel }
\groupthm_new_group:nnnnn { nobraces } { } { } { } { style = nobraces }
\groupthm_add_parent:nn { star } { custom }
\groupthm_add_parent:nn { dagger } { custom }
\DeclareTheoremGroupRule [ suffix ] { dagger } { higher } { star }
\DeclareTheoremGroupRule { tiny } { higher } { small }
\DeclareTheoremGroupRule { tiny } { higher } { big }
\DeclareTheoremGroupRule { tiny } { higher } { custom }
\DeclareTheoremGroupRule { small } { higher } { big }
\DeclareTheoremGroupRule { custom } { higher } { big }
\cs_new:Npn \fancythm_add_provided_theorem_to_group:nn #1 #2
{
\cs_if_exist:cF { __fancythm_provided_theorem__#1__group_clist }
{
\clist_new:c { __fancythm_provided_theorem__#1__group_clist }
}
\clist_put_left:cn { __fancythm_provided_theorem__#1__group_clist } { #2 }
}
\NewDocumentCommand { \AddProvidedFancyTheoremToGroup } { m m }
{
\fancythm_add_provided_theorem_to_group:nn { #1 } { #2 }
}
\cs_new:Npn \__fancythm_provide_package_theorem:nnn #1 #2 #3
{
\__fancythm_set_normalized_keys:nn { #1 } { #2 }
\cs_if_exist:cT { __fancythm_provided_theorem__#2__group_clist }
{
\clist_concat:ccc
{ l__fancythm_group_clist }
{ __fancythm_provided_theorem__#2__group_clist }
{ l__fancythm_group_clist }
}
\clist_if_in:NnF \l__fancythm_group_clist { big }
{
\clist_if_in:NnF \l__fancythm_group_clist { small }
{
\clist_if_in:NnF \l__fancythm_group_clist { tiny }
{
\clist_put_right:Nn \l__fancythm_group_clist { #3 }
}
}
}
\fancythm_provide_theorem:nVVV
{ #2 }
\l__fancythm_group_clist
\l__fancythm_name_tl
\l__fancythm_thmtools_clist
}
\cs_new:Npn \fancythm_provide_big_theorem:nn #1 #2
{
\__fancythm_provide_package_theorem:nnn { #1 } { #2 } { big }
}
\cs_new:Npn \fancythm_provide_small_theorem:nn #1 #2
{
\__fancythm_provide_package_theorem:nnn { #1 } { #2 } { small }
}
\cs_new:Npn \fancythm_provide_tiny_theorem:nn #1 #2
{
\__fancythm_provide_package_theorem:nnn { #1 } { #2 } { tiny }
}
\bool_if:NT \g__fancythm_generate_defaults_bool
{
\AddToHook { begindocument / before } [ fancythm ]
{
\fancythm_provide_big_theorem:nn { style = thmredmarginandfill } { theorem }
\fancythm_provide_big_theorem:nn { style = thmredmarginandfill } { proposition }
\fancythm_provide_big_theorem:nn { style = thmredmarginandfill } { corollary }
\fancythm_provide_big_theorem:nn { style = thmbluemarginandfill } { definition }
\fancythm_provide_big_theorem:nn { style = thmorangemarginandfill} { lemma }
\fancythm_provide_big_theorem:nn { style = thmgreenmargin } { example }
\fancythm_provide_big_theorem:nn
{
style = thmredmarginbluefill,
name = Theorem ~ and ~ Definition
} { theoremdef }
\fancythm_provide_big_theorem:nn
{
style = thmredmarginbluefill,
name = Proposition ~ and ~ Definition
} { propositiondef }
\fancythm_provide_big_theorem:nn
{
style = thmorangemarginbluefill,
name = Lemma ~ and ~ Definition
} { propositiondef }
\fancythm_provide_small_theorem:nn { style = thmvioletmargin } { notation }
\fancythm_provide_small_theorem:nn { style = thmyellowmargin } { remark }
\fancythm_provide_small_theorem:nn { style = thmgoldmargin } { praise }
\fancythm_provide_small_theorem:nn { style = thmblackmarginandfill } { question }
\fancythm_provide_small_theorem:nn { style = thmblackmargin } { orga }
\fancythm_provide_small_theorem:nn { style = thmredmargin } { fact }
\fancythm_provide_small_theorem:nn
{
style = thmyellowmargin,
name = Trivial ~ Nonsense
} { trivial }
\fancythm_provide_small_theorem:nn
{
style = thmvioletmargin,
name = Abuse ~ of ~ Notation
} { abuse }
\fancythm_provide_small_theorem:nn
{
style = thmyellowmargin,
name = Oral ~ remark
} { oral }
\fancythm_provide_tiny_theorem:nn { } { variant }
\fancythm_provide_tiny_theorem:nn { } { assumption }
\fancythm_provide_tiny_theorem:nn { } { note }
\fancythm_provide_tiny_theorem:nn { } { warning }
\fancythm_provide_tiny_theorem:nn { } { goal }
\fancythm_provide_tiny_theorem:nn { } { strategy }
\fancythm_provide_tiny_theorem:nn { } { problem }
\fancythm_provide_tiny_theorem:nn { } { info }
\fancythm_provide_tiny_theorem:nn { } { observe }
\fancythm_provide_tiny_theorem:nn { } { property }
\fancythm_provide_tiny_theorem:nn { } { intuition }
\fancythm_provide_tiny_theorem:nn { } { recall }
\fancythm_provide_tiny_theorem:nn { } { idea }
\fancythm_provide_tiny_theorem:nn { } { exercise }
\fancythm_provide_tiny_theorem:nn { } { reminder }
}
}
\DeclareHookRule { begindocument / before } { groupthm } { after } { fancythm }
\endinput
%%
%% End of file `fancythm.sty'.

View file

@ -0,0 +1,887 @@
%%
%% This is file `groupthm.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% groupthm.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from groupthm.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file groupthm.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% File: groupthm.dtx
\ProvidesExplPackage{groupthm}{2022/02/02}{0.0.2}{Grouped theorems.}
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage{l3keys2e}
\cs_new:Npn \__groupthm_thmtools_declare_theorem:nn #1 #2
{
\tl_log:n { Declaring ~ thmtools ~ theorem ~ #2 }
\declaretheorem [ #1 ] { #2 }
\__groupthm_cache:n
{
\csname __groupthm_thmtools_declare_theorem:nn \endcsname { #1 } { #2 }
}
}
\cs_generate_variant:Nn \__groupthm_thmtools_declare_theorem:nn { V n }
\cs_new:Npn \__groupthm_hook_gset_rule_foreach:nNnn #1 #2 #3 #4
{
\cs_set:Npn \__groupthm_map_aux:n ##1
{
\hook_gset_rule:nnnn { #1 } { ##1 } { #3 } { #4 }
}
\clist_map_function:NN #2 \__groupthm_map_aux:n
}
\msg_new:nnn { groupthm } { unknown ~ group }
{
Unknown ~ group ~ '#1' ~ supplied ~ \msg_line_context:
}
\msg_new:nnn { groupthm } { unknown ~ key }
{
Unknown ~ key ~ '#1' ~ supplied ~ \msg_line_context:
}
\msg_new:nnn { groupthm } { wrong ~ definition }
{
Bad ~ definition ~ of ~ #1 ~ '#2' ~ \msg_line_context:, ~ #1 ~ is ~ #3 ~ defined.
}
\msg_new:nnn { groupthm } { misuse ~ add ~ theorem ~ to ~ group }
{
Bad ~ usage ~ of ~ 'AddTheoremToGroup' ~ macro ~ outside ~ theorem ~
family ~ options ~ \msg_line_context:
}
\msg_new:nnnn { groupthm } { undefined ~ theorem ~ variant }
{
Bad ~ call ~ of ~ theorem ~ variant ~ of ~ '#1' ~ \msg_line_context:
}
{
You ~ wanted ~ to ~ call ~ the ~ variant ~ with ~ group(s) ~
'#2' ~ of ~ theorem ~ family ~ '#1', ~ but ~ it ~ has ~ not ~ been ~
generated ~ yet. ~
Probably ~ you ~ forgot ~ this. ~
\msg_see_documentation_text:n { groupthm }
}
\hook_new:n { __groupthm/prefix }
\hook_new:n { __groupthm/suffix }
\hook_new:n { __groupthm/mapname }
\hook_new:n { __groupthm/thmtools }
\hook_new:n { __groupthm/groupsort }
\cs_generate_variant:Nn \hook_gset_rule:nnnn { n n V n }
\bool_new:N \l__groupthm_key_starred_version_bool
\tl_new:N \l__groupthm_key_prefix_tl
\tl_new:N \l__groupthm_key_name_tl
\tl_new:N \l__groupthm_key_suffix_tl
\clist_new:N \l__groupthm_key_group_clist
\clist_new:N \l__groupthm_key_mapname_clist
\clist_new:N \l__groupthm_key_thmtools_clist
\tl_new:N \l__groupthm_prefix_tl
\tl_new:N \l__groupthm_name_tl
\tl_new:N \l__groupthm_suffix_tl
\clist_new:N \l__groupthm_mapname_clist
\clist_new:N \l__groupthm_thmtools_clist
\clist_new:N \l__groupthm_group_clist
\clist_new:N \g__groupthm_defined_groups_clist
\bool_new:N \l__groupthm_in_family_options_environment_bool
\int_new:N \g__groupthm_append_groups_int
\bool_new:N \g__groupthm_cache_bool
\int_new:N \g__groupthm_cache_version_aux_int
\int_new:N \g__groupthm_cache_version_document_int
\int_set:Nn \g__groupthm_cache_version_aux_int { -1 }
\tl_new:N \g__groupthm_lazy_document_tl
\tl_new:N \g__groupthm_lazy_auxfile_tl
\clist_new:N \g__groupthm_dump_auxfile_clist
\clist_new:N \g__groupthm_dump_cache_clist
\keys_define:nn { groupthm }
{
cache .bool_set:N = \g__groupthm_cache_bool,
cache .default:n = { true },
__cache version__ .int_set:N = \g__groupthm_cache_version_document_int,
cache version .meta:nn = { groupthm } { cache = true, __cache version__ = #1 },
cache version .default:n = { 0 },
}
\keys_define:nn { groupthm / theorem ~ group }
{
prefix .tl_set:N = \l__groupthm_key_prefix_tl,
prefix .default:n = \c_empty_tl,
suffix .tl_set:N = \l__groupthm_key_suffix_tl,
suffix .default:n = \c_empty_tl,
suffix .groups:n = { theoremgroup },
map ~ name .clist_set:N = \l__groupthm_mapname_clist,
map ~ name .default:n = {},
map ~ name .groups:n = { theoremgroup },
thmtools .clist_set:N = \l__groupthm_key_thmtools_clist,
thmtools .default:n = {},
unknown .code:n =
\msg_error:nnx { groupthm } { unknown ~ key } { \str_use:N \l_keys_key_str }
}
\keys_define:nn { groupthm / grouped ~ theorem }
{
name .tl_set:N = \l__groupthm_key_name_tl,
name .default:n = \c_novalue_tl,
group .clist_set:N = \l__groupthm_key_group_clist,
group .default:n = {},
thmtools .clist_set:N = \l__groupthm_key_thmtools_clist,
thmtools .default:n = {},
starred ~ version .bool_set:N = \l__groupthm_key_starred_version_bool,
starred ~ version .default:n = { true },
unknown .code:n =
\msg_error:nnx { groupthm } { unknown ~ key } { \str_use:N \l_keys_key_str }
}
\keys_define:nn { groupthm / theorem ~ family }
{
name .tl_set:N = \l__groupthm_key_name_tl,
name .default:n = \c_novalue_tl,
group .clist_set:N = \l__groupthm_key_group_clist,
group .default:n = {},
thmtools .clist_set:N = \l__groupthm_key_thmtools_clist,
thmtools .default:n = {},
starred ~ version .bool_set:N = \l__groupthm_key_starred_version_bool,
starred ~ version .default:n = { true },
unknown .code:n =
\msg_error:nnx { groupthm } { unknown ~ key } { \str_use:N \l_keys_key_str }
}
\keys_define:nn { groupthm / theorem ~ family ~ options }
{
starred ~ version .bool_set:N = \l__groupthm_key_starred_version_bool,
starred ~ version .default:n = { true },
unknown .code:n =
\msg_error:nnx { groupthm } { unknown ~ key } { \str_use:N \l_keys_key_str }
}
\ProcessKeysOptions { groupthm }
\cs_new:Npn \__groupthm_set_normalized_keys:nnn #1 #2 #3
{
\keys_set:nn { groupthm / theorem ~ group }
{ prefix, suffix, thmtools, map ~ name }
\keys_set:nn { groupthm / grouped ~ theorem }
{ name, group, thmtools, starred ~ version }
\keys_set:nn { groupthm / theorem ~ family }
{ name, group, thmtools, starred ~ version }
\keys_set:nn { groupthm / #2 } { #1 }
\tl_if_eq:NnTF \l__groupthm_key_name_tl { \c_novalue_tl }
{
\tl_set:Nx \l__groupthm_name_tl
{
\text_titlecase_first:n {#3}
}
}
{
\tl_set_eq:NN \l__groupthm_name_tl \l__groupthm_key_name_tl
}
\bool_set_eq:NN \l__groupthm_starred_version_bool \l__groupthm_key_starred_version_bool
\tl_set_eq:NN \l__groupthm_prefix_tl \l__groupthm_key_prefix_tl
\tl_set_eq:NN \l__groupthm_suffix_tl \l__groupthm_key_suffix_tl
\clist_set_eq:NN \l__groupthm_group_clist \l__groupthm_key_group_clist
\clist_set_eq:NN \l__groupthm_mapname_clist \l__groupthm_key_mapname_clist
\clist_set_eq:NN \l__groupthm_thmtools_clist \l__groupthm_key_thmtools_clist
}
\cs_new:Npn \__groupthm_add_to_group_ordering:n #1
{
\__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/groupsort }
\g__groupthm_defined_groups_clist
{ before }
{ #1 }
}
\cs_new:Npn \__groupthm_remove_from_group_ordering:n #1
{
\__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/groupsort }
\g__groupthm_defined_groups_clist
{ unrelated }
{ #1 }
}
\cs_new:Npn \__groupthm_add_to_sort_hook:n #1
{
\hook_gput_code:nnn { __groupthm/groupsort }
{ #1 }
{
\clist_put_left:Nn \l__groupthm_group_clist { #1 }
}
}
\cs_new:Npn \__groupthm_sort_group_names:
{
\hook_gremove_code:nn { __groupthm/groupsort }{*}
\clist_map_function:NN \l__groupthm_group_clist \__groupthm_add_to_sort_hook:n
\clist_clear:N \l__groupthm_group_clist
\hook_use:n { __groupthm/groupsort }
}
\cs_new:Npn \__groupthm_define_group:nnnnn #1#2#3#4#5
{
\cs_new:cpn { __groupthm_use_group__#1: }
{
\hook_gput_code:nnn { __groupthm/prefix } { #1 }
{
\tl_put_left:Nx \l__groupthm_prefix_tl { #2 }
}
\hook_gput_code:nnn { __groupthm/suffix } { #1 }
{
\tl_put_right:Nx \l__groupthm_suffix_tl { #3 }
}
\hook_gput_code:nnn { __groupthm/mapname } { #1 }
{
\clist_put_right:Nn \l__groupthm_mapname_clist { #4 }
}
\hook_gput_code:nnn { __groupthm/thmtools } { #1 }
{
\clist_put_right:Nn \l__groupthm_thmtools_clist { #5 }
}
}
\__groupthm_add_to_group_ordering:n { #1 }
\clist_new:c { g__groupthm_parents_group__#1__clist }
\hook_gset_rule:nnnn { ?? } { all } { before } { #1 }
\hook_gset_rule:nnnn { ?? } { unnumbered } { after } { #1 }
\hook_gset_rule:nnnn { ?? } { starred } { after } { #1 }
\clist_gput_left:Nn \g__groupthm_defined_groups_clist { #1 }
}
\cs_new:Npn \__groupthm_undefine_group:n #1
{
\tl_log:n { Undefining ~ theorem ~ group ~ '#1' }
\cs_undefine:c { __groupthm_use_group__#1: }
\hook_gremove_code:nn { __groupthm/prefix } { #1 }
\hook_gremove_code:nn { __groupthm/suffix } { #1 }
\hook_gremove_code:nn { __groupthm/mapname } { #1 }
\hook_gremove_code:nn { __groupthm/thmtools } { #1 }
\clist_gremove_all:Nn \g__groupthm_defined_groups_clist { #1 }
\cs_undefine:c { g__groupthm_parents_group__#1__clist }
\__groupthm_hook_gset_rule_foreach:nNnn
{ ?? }
\g__groupthm_defined_groups_clist
{ unrelated }
{ #1 }
\__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/prefix }
\g__groupthm_defined_groups_clist
{ unrelated }
{ #1 }
\__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/suffix }
\g__groupthm_defined_groups_clist
{ unrelated }
{ #1 }
\__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/mapname }
\g__groupthm_defined_groups_clist
{ unrelated }
{ #1 }
\__groupthm_hook_gset_rule_foreach:nNnn
{ __groupthm/thmtools }
\g__groupthm_defined_groups_clist
{ unrelated }
{ #1 }
\__groupthm_remove_from_group_ordering:n { #1 }
}
\cs_new:Npn \__groupthm_define:nnnNNNn #1 #2 #3 #4 #5 #6 #7
{
\bool_if:nT
{
\str_if_eq_p:nn { #1 } { new }
&&
\cs_if_exist_p:N #4
}
{
\tl_log:n { Wrong ~ 'new' ~ definition ~ of ~ #2 ~ '#3' ~ detected. }
\msg_error:nnnnn { groupthm } { wrong ~ definition }
{ #2 } { #3 } { already }
}
\bool_if:nT
{
\str_if_eq_p:nn { #1 } { renew }
&&
! \cs_if_exist_p:N #4
}
{
\tl_log:n { Wrong ~ 'renew' ~ definition ~ of ~ #2 ~ '#3' ~ detected. }
\msg_error:nnnnn { groupthm } { wrong ~ definition }
{ #2 } { #3 } { not }
}
\bool_if:nT
{
(
\str_if_eq_p:nn { #1 } { declare } ||
\str_if_eq_p:nn { #1 } { renew }
) &&
\cs_if_exist_p:N #4
}
{
\tl_log:n { Removing ~ definition ~ of ~ #2 ~ '#3'. }
\tl_log:n { Declarator ~ was ~ #1. }
#5 { #3 }
}
\bool_if:nTF
{
\cs_if_exist_p:N #4
&&
\str_if_eq_p:nn { #1 } { provide }
}
{
\tl_log:n { Providing ~ #2 ~ '#3' ~ skipped: ~ '#3' ~ already ~ defined. }
}
{
\tl_log:n { Defining ~ #2 ~ '#3'. }
#6 #7
}
}
\cs_generate_variant:Nn \__groupthm_define:nnnNNNn { n n n c N N n }
\cs_new:Npn \__groupthm_define_multiple:nnnNNnn #1 #2 #3 #4 #5 #6 #7
{
\cs_set:Npn \__groupthm_map_aux:n ##1
{
\cs_new:cn { #6 }
{
\__groupthm_lazy:n
{
\__groupthm_define:nnncNNn
{ ##1 }
{ #2 }
{ ####1 }
{ #3 }
#4
#5
{ #7 }
}
}
}
\clist_map_function:nN { #1 } \__groupthm_map_aux:n
}
\__groupthm_define_multiple:nnnNNnn
{ new, renew, provide, declare }
{ theorem group }
{ __groupthm_use_group__##1: }
\__groupthm_undefine_group:n
\__groupthm_define_group:nnnnn
{ groupthm_#1_group:nnnnn }
{ { ##1 } { ##2 } { ##3 } { ##4 } { ##5 } }
\cs_generate_variant:Nn \groupthm_new_group:nnnnn { n V V V V }
\cs_generate_variant:Nn \groupthm_renew_group:nnnnn { n V V V V }
\cs_generate_variant:Nn \groupthm_provide_group:nnnnn { n V V V V }
\cs_generate_variant:Nn \groupthm_declare_group:nnnnn { n V V V V }
\cs_new:Npn \__groupthm_wrap_multiple:nnn #1 #2 #3
{
\cs_set:Npn \__groupthm_map_aux:n ##1
{
\cs_new:cn { #2 }
{
#3
}
}
\clist_map_function:nN { #1 } \__groupthm_map_aux:n
}
\__groupthm_wrap_multiple:nnn
{ new, renew, provide, declare }
{ groupthm_#1_group:nn }
{
\__groupthm_set_normalized_keys:nnn { ##1 } { theorem ~ group } { ##2 }
\use:c { groupthm_#1_group:nVVVV }
{ ##2 }
\l__groupthm_prefix_tl
\l__groupthm_suffix_tl
\l__groupthm_mapname_clist
\l__groupthm_thmtools_clist
}
\cs_generate_variant:Nn \groupthm_new_group:nn { n x }
\cs_new:Npn \__groupthm_new_document_command:Nnn #1 #2 #3
{
\NewDocumentCommand { #1 } { #2 } { #3 }
}
\cs_generate_variant:Nn \__groupthm_new_document_command:Nnn { c n n }
\cs_new:Npn \__groupthm_wrap_multiple_document:nnnn #1 #2 #3 #4
{
\cs_set:Npn \__groupthm_map_aux:n ##1
{
\cs_set:Nn \__groupthm_Declarator: { \text_titlecase_first:n { ##1 } }
\__groupthm_new_document_command:cnn { #2 } { #3 } { #4 }
}
\clist_map_function:nN { #1 } \__groupthm_map_aux:n
}
\__groupthm_wrap_multiple_document:nnnn
{ new, renew, provide, declare }
{ \__groupthm_Declarator: TheoremGroup }
{ O{} m }
{
\__groupthm_lazy:n
{
\use:c { groupthm_#1 _group:nn } { ##1 } { ##2 }
}
}
\cs_new:Npn \groupthm_declare_group_rule:nnnn #1 #2 #3 #4
{
\__groupthm_lazy:n
{
\str_set:Nx \l_tmpa_str { \tl_trim_spaces:n { #3 } }
\str_if_eq:VnT \l_tmpa_str { higher }
{
\str_set:Nn \l_tmpa_str { after }
}
\str_if_eq:VnT \l_tmpa_str { lower }
{
\str_set:Nn \l_tmpa_str { before }
}
\str_if_eq:nnTF { #1 } { ?? }
{
\hook_gset_rule:nnVn {??} {#2} \l_tmpa_str {#4}
}
{
\hook_gset_rule:nnVn { __groupthm / #1 } {#2} \l_tmpa_str {#4}
}
}
}
\cs_generate_variant:Nn \groupthm_declare_group_rule:nnnn { n n n x }
\NewDocumentCommand { \DeclareTheoremGroupRule } { O{??} m m m }
{
\__groupthm_lazy:n
{
\groupthm_declare_group_rule:nnnn {#1} {#2} {#3} {#4}
}
}
\cs_new:Npn \groupthm_add_parent:nn #1 #2
{
\__groupthm_lazy:n
{
\__groupthm_ensure_group_exists:n { #1 }
\__groupthm_ensure_group_exists:n { #2 }
\clist_gput_left:cn { g__groupthm_parents_group__#1__clist } { #2 }
}
}
\cs_generate_variant:Nn \groupthm_add_parent:nn { n x }
\NewDocumentCommand { \AddTheoremGroupParent } { m m }
{
\__groupthmlazy:n
{
\groupthm_add_parent:nn { #1 } { #2 }
}
}
\cs_new:Npn \__groupthm_push_tmpa_seq:n #1
{
\seq_push:Nn \l_tmpa_seq { #1 }
}
\cs_new:Npn \__groupthm_flatten_groups_hierarchy:nN #1 #2
{
\clist_clear:N #2
\seq_set_from_clist:Nn \l_tmpa_seq { #1 }
\bool_until_do:nn
{
\seq_if_empty_p:N \l_tmpa_seq
}
{
\seq_pop:NN \l_tmpa_seq \l_tmpa_tl
\__groupthm_ensure_group_exists:V \l_tmpa_tl
\clist_if_in:NVF #2 \l_tmpa_tl
{
\clist_put_left:NV #2 \l_tmpa_tl
\clist_map_function:cN
{ g__groupthm_parents_group__ \l_tmpa_tl __clist }
\__groupthm_push_tmpa_seq:n
}
}
}
\cs_new:Npn \groupthm_append_to_group:nn #1 #2
{
\__groupthm_lazy:n
{
\groupthm_new_group:nx { #1 } { __append__ \int_use:N \g__groupthm_append_groups_int }
\groupthm_add_parent:nx { #2 } { __append__ \int_use:N \g__groupthm_append_groups_int }
\groupthm_declare_group_rule:nnnx
{ ?? } { #2 } { before } { __append__ \int_use:N \g__groupthm_append_groups_int }
\int_gincr:N \g__groupthm_append_groups_int
}
}
\NewDocumentCommand { \AppendToTheoremGroup } { O{} m }
{
\__groupthmlazy:n
{
\groupthm_append_to_group:nn { #1 } { #2 }
}
}
\clist_new:N \l__powerset_copied_clist
\seq_new:N \l__powerset_saved_seq
\cs_generate_variant:Nn \clist_remove_all:Nn { N V }
\cs_new:Npn \__powerset_clist_foreach_aux:Nn #1 #2
{
\clist_if_empty:NTF \l__powerset_copied_clist
{
#2
}
{
\clist_get:NN \l__powerset_copied_clist \l_tmpa_tl
\seq_push:NV \l__powerset_saved_seq \l_tmpa_tl
\clist_pop:NN \l__powerset_copied_clist { \l_tmpa_tl }
\__powerset_clist_foreach_aux:Nn #1 {#2}
\seq_get:NN \l__powerset_saved_seq \l_tmpa_tl
\clist_put_left:NV #1 \l_tmpa_tl
\__powerset_clist_foreach_aux:Nn #1 {#2}
\seq_get:NN \l__powerset_saved_seq \l_tmpa_tl
\clist_remove_all:NV #1 \l_tmpa_tl
\clist_push:NV \l__powerset_copied_clist \l_tmpa_tl
\seq_pop:NN \l__powerset_saved_seq \l_tmpa_tl
}
}
\cs_new:Npn \powerset_clist_foreach:Nn #1 #2
{
\clist_set_eq:NN \l__powerset_copied_clist #1
\clist_clear:N #1
\clist_remove_duplicates:N \l__powerset_copied_clist
\__powerset_clist_foreach_aux:Nn #1 {#2}
\clist_set_eq:NN #1 \l__powerset_copied_clist
}
\cs_new:Npn \__groupthm_ensure_group_exists:n #1
{
\cs_if_exist:cF { __groupthm_use_group__#1: }
{
\msg_error:nnn { groupthm } { unknown ~ group } { #1 }
}
}
\cs_generate_variant:Nn \__groupthm_ensure_group_exists:n { V }
\cs_new:Npn \__groupthm_use_group:n #1
{
\__groupthm_ensure_group_exists:n { #1 }
\use:c { __groupthm_use_group__#1: }
}
\cs_new:Npn \__groupthm_use_function_on_name:n #1
{
\tl_set:Nx \l__groupthm_name_tl
{
#1 { \tl_use:N \l__groupthm_name_tl }
}
}
\cs_new:Npn \__groupthm_define_theorem:nnnn #1 #2 #3 #4
{
\tl_clear:N \l__groupthm_prefix_tl
\tl_set:Nn \l__groupthm_name_tl { #3 }
\tl_clear:N \l__groupthm_suffix_tl
\clist_clear:N \l__groupthm_mapname_clist
\clist_clear:N \l__groupthm_thmtools_clist
\hook_gremove_code:nn { __groupthm/prefix }{*}
\hook_gremove_code:nn { __groupthm/suffix }{*}
\hook_gremove_code:nn { __groupthm/mapname }{*}
\hook_gremove_code:nn { __groupthm/thmtools }{*}
\__groupthm_flatten_groups_hierarchy:nN { #2, all } \l__groupthm_group_clist
\clist_map_function:NN \l__groupthm_group_clist \__groupthm_use_group:n
\tl_log:x { Flattened ~ groups ~ '#2' ~ to ~ '\clist_use:Nn \l__groupthm_group_clist {,}' ~ when ~
defining ~ theorem ~ '#1' }
\hook_use:n { __groupthm/prefix }
\hook_use:n { __groupthm/suffix }
\hook_use:n { __groupthm/mapname }
\hook_use:n { __groupthm/thmtools }
\clist_map_function:NN \l__groupthm_mapname_clist \map_use_on_name:n
\tl_set:Nn \l_tmpa_tl { name = }
\tl_put_right:NV \l_tmpa_tl \l__groupthm_prefix_tl
\tl_put_right:NV \l_tmpa_tl \l__groupthm_name_tl
\tl_put_right:NV \l_tmpa_tl \l__groupthm_suffix_tl
\clist_put_right:NV \l__groupthm_thmtools_clist \l_tmpa_tl
\clist_put_right:Nn \l__groupthm_thmtools_clist { #4 }
\__groupthm_thmtools_declare_theorem:Vn
\l__groupthm_thmtools_clist
{ #1 }
}
\__groupthm_define_multiple:nnnNNnn
{ new, provide }
{ grouped ~ theorem }
{ ##1 }
\__groupthm_error:
\__groupthm_define_theorem:nnnn
{ groupthm_#1_theorem:nnnn }
{ { ##1 } { ##2 } { ##3 } { ##4 } }
\cs_generate_variant:Nn \groupthm_new_theorem:nnnn { n V V V }
\cs_generate_variant:Nn \groupthm_provide_theorem:nnnn { n V V V }
\cs_generate_variant:Nn \groupthm_new_theorem:nnnn { x V n n }
\cs_generate_variant:Nn \groupthm_provide_theorem:nnnn { x V n n }
\__groupthm_wrap_multiple:nnn
{ new, provide }
{ groupthm_#1_theorem:nnn }
{
\__groupthm_lazy:n
{
\__groupthm_set_normalized_keys:nnn { ##1 } { grouped ~ theorem } { ##2 }
\bool_if:nT { ##3 }
{
\clist_put_left:Nn \l__groupthm_group_clist { unnumbered }
}
\use:c { groupthm_#1_theorem:nVVV }
{ ##2 }
\l__groupthm_group_clist
\l__groupthm_name_tl
\l__groupthm_thmtools_clist
\bool_if:NT \l__groupthm_starred_version_bool
{
\clist_put_left:Nn \l__groupthm_group_clist { starred }
\use:c { groupthm_#1_theorem:nVVV }
{ ##2* }
\l__groupthm_group_clist
\l__groupthm_name_tl
\l__groupthm_thmtools_clist
}
}
}
\__groupthm_wrap_multiple_document:nnnn
{ new, provide }
{ \__groupthm_Declarator: GroupedTheorem }
{ s O{} m }
{
\__groupthm_lazy:n
{
\use:c { groupthm_#1_theorem:nnn }
{ ##2 }
{ ##3 }
{ ##1 }
}
}
\cs_new:Npn \__groupthm_define_family:nnnnn #1 #2 #3 #4 #5
{
\clist_set:Nn \l_tmpa_clist { #2 }
\powerset_clist_foreach:Nn \l_tmpa_clist
{
\clist_set_eq:NN \l__groupthm_group_clist \l_tmpa_clist
\clist_put_right:Nn \l__groupthm_group_clist { #5 }
\__groupthm_sort_group_names:
\use:c{groupthm_new_theorem:xVnn}
{__#1__groups_\clist_use:Nn \l__groupthm_group_clist {_}}
\l__groupthm_group_clist
{ #3 }
{ #4 }
}
\clist_new:c { __groupthm_family__#1__group_clist }
\clist_set_eq:cN {__groupthm_family__#1__group_clist } \l_tmpa_clist
\clist_new:c { __groupthm_family__#1__always_group_clist }
\clist_set:cn {__groupthm_family__#1__always_group_clist } { #5 }
}
\__groupthm_define_multiple:nnnNNnn
{ new, provide }
{ theorem ~ family }
{ __groupthm_family__##1__group_clist }
\__groupthm_error:
\__groupthm_define_family:nnnnn
{ groupthm_#1_family:nnnnn }
{ { ##1 } { ##2 } { ##3 } { ##4 } { ##5 }}
\cs_generate_variant:Nn \groupthm_new_family:nnnnn { n V V V V }
\cs_generate_variant:Nn \groupthm_provide_family:nnnnn { n V V V V }
\__groupthm_wrap_multiple:nnn
{ new, provide }
{ groupthm_#1_family:nnn }
{
\__groupthm_lazy:n
{
\__groupthm_set_normalized_keys:nnn { ##1 } { theorem ~ family } { ##2 }
\bool_if:nTF { ##3}
{
\clist_set:Nn \l_tmpa_clist { unnumbered }
}
{
\clist_clear:N \l_tmpa_clist
}
\bool_if:NT \l__groupthm_starred_version_bool
{
\clist_put_left:Nn \l__groupthm_group_clist { starred }
}
\use:c { groupthm_#1_family:nVVVV }
{ ##2 }
\l__groupthm_group_clist
\l__groupthm_name_tl
\l__groupthm_thmtools_clist
\l_tmpa_clist
}
}
\__groupthm_wrap_multiple_document:nnnn
{ new, provide }
{ \__groupthm_Declarator: GroupedTheoremFamily }
{ s O{} m }
{
\__groupthm_lazy:n
{
\use:c { groupthm_#1_family:nnn }
{ ##2 }
{ ##3 }
{ ##1 }
}
}
\cs_new:Npn \groupthm_add_theorem_to_group:n #1
{
\__groupthm_lazy:n
{
\bool_if:NTF \l__groupthm_in_family_options_environment_bool
{
\clist_put_left:Nn \l__groupthm_group_clist { #1 }
}
{
\msg_error:nn { groupthm } { misuse ~ add ~ theorem ~ to ~ group }
}
}
}
\NewDocumentCommand { \AddTheoremToGroup } { m }
{
\groupthm_add_theorem_to_group:n { #1 }
}
\cs_new:Npn \__groupthm_define_family_options:nnnn #1 #2 #3 #4
{
\DeclareDocumentEnvironment
{ #1 }
{ #2 }
{
\clist_clear:N \l__groupthm_group_clist
\bool_set_true:N \l__groupthm_in_family_options_environment_bool
#3
\bool_set_false:N \l__groupthm_in_family_options_environment_bool
\clist_put_right:Nn \l__groupthm_group_clist { #4 }
\__groupthm_sort_group_names:
\cs_if_exist:cTF { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } }
{
\begin { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } }
}
{
\msg_error:nnxx { groupthm } { undefined ~ theorem ~ variant }
{ #1 }
{ \clist_use:Nnnn \l__groupthm_group_clist { ~ and ~ } {, ~} { , ~ and ~ } }
}
}
{
\clist_clear:N \l__groupthm_group_clist
\bool_set_true:N \l__groupthm_in_family_options_environment_bool
#3
\bool_set_false:N \l__groupthm_in_family_options_environment_bool
\clist_put_right:Nn \l__groupthm_group_clist { #4 }
\__groupthm_sort_group_names:
\end { __#1__groups_ \clist_use:Nn \l__groupthm_group_clist { _ } }
}
\__groupthm_cache_slow:n
{
\csname __groupthm_define_family_options:nnnn \endcsname { #1 } { #2 } { #3 } { #4 }
}
}
\__groupthm_define_multiple:nnnNNnn
{ new, renew, provide, declare }
{ theorem ~ family ~ options }
{ ##1 }
\use_none:n
\__groupthm_define_family_options:nnnn
{ groupthm_#1_family_options:nnnn }
{ { ##1 } { ##2 } { ##3 } { ##4 } }
\cs_generate_variant:Nn \groupthm_new_family_options:nnnn { n n n V }
\cs_generate_variant:Nn \groupthm_renew_family_options:nnnn { n n n V }
\cs_generate_variant:Nn \groupthm_provide_family_options:nnnn { n n n V }
\cs_generate_variant:Nn \groupthm_declare_family_options:nnnn { n n n V }
\__groupthm_wrap_multiple_document:nnnn
{ new, renew, provide, declare }
{ \__groupthm_Declarator: GroupedTheoremFamilyOptions }
{ s O{} m m m }
{
\__groupthm_lazy:n
{
\keys_set:nn { groupthm / theorem ~ family ~ options } { starred ~ version }
\keys_set:nn { groupthm / theorem ~ family ~ options } { ##2 }
\bool_if:nTF { ##1 }
{
\clist_set:Nn \l_tmpa_clist { unnumbered }
}
{
\clist_clear:N \l_tmpa_clist
}
\use:c { groupthm_#1_family_options:nnnV }
{ ##3 }
{ ##4 }
{ ##5 }
\l_tmpa_clist
\bool_if:NT \l__groupthm_starred_version_bool
{
\use:c { groupthm_#1_family_options:nnnV }
{ ##3* }
{ ##4 }
{
##5
\groupthm_add_theorem_to_group:n { starred }
}
\l_tmpa_clist
}
}
}
\bool_if:NTF \g__groupthm_cache_bool
{
\cs_new:Npn \__groupthm_write_auxout:n
{
\iow_now:cn { @auxout }
}
\cs_generate_variant:Nn \__groupthm_write_auxout:n { x }
\cs_new:Npn \__groupthm_dump_auxfile:n
{
\clist_gput_right:Nn \g__groupthm_dump_auxfile_clist
}
\cs_generate_variant:Nn \__groupthm_dump_auxfile:n { x }
\cs_new:Npn \__groupthm_cache_auxfile:n
{
\clist_gput_right:Nn \g__groupthm_dump_cache_clist
}
\cs_generate_variant:Nn \__groupthm_cache_auxfile:n { V }
\hook_gput_code:nnn { enddocument } { groupthm }
{
\clist_map_function:NN \g__groupthm_dump_auxfile_clist
\__groupthm_write_auxout:n
\__groupthm_write_auxout:n
{
\csname tl_gput_right:cn \endcsname
{
g__groupthm_lazy_auxfile_tl
}
}
\__groupthm_write_auxout:x { \str_use:N \c_left_brace_str }
\clist_map_function:NN \g__groupthm_dump_cache_clist
\__groupthm_write_auxout:n
\__groupthm_write_auxout:x { \str_use:N \c_right_brace_str }
}