Compare commits

..

No commits in common. "master" and "wuerzburg21" have entirely different histories.

130 changed files with 765 additions and 9711 deletions

View file

@ -1,11 +1,7 @@
This LaTeX {latex_file_type} is free software and is dual-licensed
under the LPPLv1.3c and the GPLv3 licenses.
You may use it freely for your purposes.
The latest version of the {latex_file_type} sources can be obtained
via GitLab under
https://gitlab.com/latexci/packages/LatexPackages
The latest version of the built packages can be obtained via GitLab under
https://gitlab.com/latexci/packages/LatexPackagesBuild
For further information see the urls above.
This LaTeX {latex_file_type} is free software and distributed under the MIT License. You
may use it freely for your purposes. The latest version of the {latex_file_type} can be
obtained via GitHub under
https://github.com/kesslermaximilian/LatexPackages
For further information see the url above.
Reportings of bugs, suggestions and improvements are welcome, see the README
at the Git repository for further information.

12
.ci/ci_build.sh Executable file
View file

@ -0,0 +1,12 @@
cd .ci
export COMMIT_MSG=$(python3 print_deploy_message.py)
cd ..
make ci-build
cd build
zip -r LatexPackages.zip LatexPackagesBuild/ -x '*.git*'
tree -H '.' -I "index.html" -D --charset utf-8 -T "LatexPackages" > index.html
cd LatexPackagesBuild
git add .
git commit -m "${COMMIT_MSG}" || echo "Nothing new to commit"
git push --set-upstream origin ${CI_COMMIT_REF_NAME}-build

View file

@ -1,17 +0,0 @@
set -e
# Set up ssh private key
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# Set up remote host key fingerprint
echo "git.abstractnonsen.se ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAufJTq206GOv0D8gHs2o3eDusLNWaB0U7JRhUYnux9B" >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
git config --global user.email "git@maximilian-kessler.de"
git config --global user.name "Maximilian Keßler (via gitlab runner)"
echo "Successfully added ssh deploy keys"

View file

@ -14,6 +14,6 @@ def get_deploy_message(repo):
"\n" \
"Build branch {branch} ({hexsha}) from {repo_name}" \
.format(old_msg=old_msg,
branch=os.environ['REF_NAME'],
branch=os.environ['CI_COMMIT_REF_NAME'],
hexsha=get_latest_commit(repo).hexsha[0:7],
repo_name='latex/latex-packages')
repo_name='kesslermaximilian/LatexPackages')

View file

@ -1,14 +0,0 @@
set -e
# set up deploy message
cd .ci
export COMMIT_MSG=$(python3 print_deploy_message.py)
cd ..
# push pages to build repository
cd build/packages
git add .
git commit -m "${COMMIT_MSG}" || echo "Nothing new to commit"
git remote set-url origin --push git@git.abstractnonsen.se:latex/latex-packages-build
git push --set-upstream origin ${REF_NAME}-build
cd ../..

View file

@ -1,13 +1,12 @@
# ! /bin/sh
set -e
cd build/packages
REMOTE_BRANCH=$(git branch -a | sed -n '/remotes\/origin\/.*-build/p' | sed 's/remotes\/origin\///g' | sed 's/-build//g' | sed 's/[[:space:]]//g' | sed -n "/^${REF_NAME}$/p")
ssh git@gitlab.com
git clone git@gitlab.com:latexci/packages/LatexPackagesBuild.git build/LatexPackagesBuild
cd build/LatexPackagesBuild
REMOTE_BRANCH=$(git branch -a | sed -n '/remotes\/origin\/.*-build/p' | sed 's/remotes\/origin\///g' | sed 's/-build//g' | sed 's/[[:space:]]//g' | sed -n "/^${CI_COMMIT_REF_NAME}$/p")
echo ${REMOTE_BRANCH}
if [ "$REMOTE_BRANCH" = "" ]; then
if [ "$REMOTE_BRANCH" = "" ];then
echo "This is the first build on this branch, creating new branch in build repository to push to"
git checkout --orphan ${CI_COMMIT_REF_NAME}-build
ls -ra | sed '/^\.git$/d' | sed '/^\.\.$/d' | sed '/^\.$/d' | xargs -r git rm --cached

View file

@ -1,81 +0,0 @@
name: Build LaTeX packages
on: [push]
jobs:
build:
runs-on: latex-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # We need all history to correctly parse tag names
fetch-tags: true
- name: Setup git credentials and committer
run: .ci/configure_git.sh
env:
DEPLOY_SSH_KEY: ${{ secrets.deploy_ssh_key }}
- name: Clone build repository
uses: actions/checkout@v4
with:
repository: latex/latex-packages-build
path: build/packages
ref: master
- name: Checkout correct branch in build repository
run: |
.ci/setup_build_repo_branch.sh
env:
REF_NAME: ${{ github.ref_name }}
- name: Build packages incrementally
run: make
- name: Push packages to build repo
run: |
.ci/deploy_to_build_repo.sh
env:
REF_NAME: ${{ github.ref_name }}
- name: Clean up git files from build repo
if: github.ref == 'refs/heads/master'
run: rm -rf build/packages/.git
- name: Save built packages to cache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v3
with:
path: build/packages/
key: ${{ github.ref }}-packages
pages:
runs-on: latex-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Load package cache
uses: actions/cache/restore@v3
with:
path: build/packages/
key: ${{ github.ref }}-packages
- name: Load compilation cache
uses: actions/cache/restore@v3
with:
path: .compile
key: ${{ github.ref }}-doc
- name: Compile documentation
run: make doc
env:
TEXINPUTS: '${{ github.workspace }}/build/packages//:'
- name: Prepage pages
run: |
cd build
rm -rf packages/.git # Don't deploy the git files
zip -r latex-packages.zip packages/ -x '*.git*'
zip -r latex-packages-doc.zip doc/
- name: Deploy to pages
uses: actions/pages@v1
with:
directory: build/
- name: Upload compilation cache
uses: actions/cache/save@v3
with:
path: .compile
key: ${{ github.ref }}-doc

15
.gitignore vendored
View file

@ -5,18 +5,3 @@ build/*
.idea/
*.synctex.gz
__pycache__
*.aux
*.fdb_latexmk
*.fls
*.log
*.pdf
wip/proof/.skip
*.out
*.idx
*.ilg
*.ind
*.cnt
*.glo
*.hd
*.toc
*.sty

71
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,71 @@
stages: # List of stages for jobs, and their order of execution
- get
- build
- pages
get-build-repo: # This job runs in the build stage, which runs first.
stage: get
before_script:
- apt-get update -y && apt-get install -yqqf openssh-client git unzip sshpass rsync --fix-missing
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
- eval $(ssh-agent -s)
- echo "$GITLAB_DEPLOY_KEY"
- echo "$GITLAB_DEPLOY_KEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git config --global user.email "git@maximilian-kessler.de"
- git config --global user.name "Maximilian Keßler (via gitlab runner)"
script:
- echo "Getting old Build repo..."
- .ci/get_build_repo_from_origin.sh
tags:
- latex
artifacts:
paths:
- build/*
build-packages: # This job runs in the deploy stage.
stage: build # It only runs when *both* jobs in the test stage complete successfully.
before_script:
- apt-get update -y && apt-get install -yqqf openssh-client git unzip sshpass rsync --fix-missing
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )'
- eval $(ssh-agent -s)
- echo "$GITLAB_DEPLOY_KEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- git config --global user.email "git@maximilian-kessler.de"
- git config --global user.name "Maximilian Keßler (via gitlab runner)"
script:
- echo "Building packages incrementally..."
- sh .ci/ci_build.sh
variables:
GIT_SUBMODULE_STRATEGY: recursive
artifacts:
paths:
- build/*
tags:
- latex
pages:
stage: pages
artifacts:
paths:
- public/
script:
- mv build/ public/
tags:
- latex
only:
- master

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Maximilian Keßler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -1,32 +0,0 @@
Copyright (c) 2021-2022 Maximilian Keßler
## Available Licenses
This work is dual-licensed. It may be distributed and/or modified
1. under the LaTeX Project Public License, version 1.3c or (at your opinion) any later version and/or,
2. under the GNU General Public License, Version 3 or (at your opinion) any later version
## LaTeX Project Public License
- The latest version of the LaTeX Project Public License license is in
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.
- This work consists of all source files, availabe in directory `src/`,
as well as all derived files obtained from these by formatting them
with [PyTeX](https://gitlab.com/latexci/packages/PyTeX)
- This work has the LPPL maintenance status 'maintained'.
The Current Maintainer of this work is Maximilian Keßler.
- The license is also available in `licenses/LPPL.txt`
## Gnu General Public License
- This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
- This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
- The license is also available in `licenses/GPLv3.txt`

View file

@ -1,30 +1,13 @@
# Makefile for latex-packages
.PHONY: build
BUILD_FLAGS=--recursive --git-version --pytex-version --license --author "Maximilian Keßler" --pytex-info-text --extra-header ".build/header_info.txt" --name "prepend-author"
BUILD_DIRS= --source-dir src --build-dir build
BUILD_DIR=build
DOC_SUBDIR=doc
PACKAGES_SUBDIR=packages
COMPILE_SUBDIR=.compile
BUILD_FLAGS=--recursive --git-version --pytex-version --license --author "Maximilian Keßler" --pytex-info-text --extra-header ".build/header_info.txt" --name "prepend-author" --clean-old-files
ROOT=$(shell pwd)
BUILD_ROOT=${ROOT}/${BUILD_DIR}
# Build packages
build: .initsubmodulelock
python3 build.py --source-dir src --build-dir ${BUILD_ROOT}/${PACKAGES_SUBDIR} ${BUILD_FLAGS}
@python3 build.py ${BUILD_DIRS} ${BUILD_FLAGS}
# Build packages and allow repo to be dirty (use with caution and only when developing)
dirty: .initsubmodulelock
python3 build.py --source-dir src --build-dir ${BUILD_ROOT}/${PACKAGES_SUBDIR} ${BUILD_FLAGS} --allow-dirty
@python3 build.py ${BUILD_DIRS} ${BUILD_FLAGS} --allow-dirty
# generate documentation files from /doc
doc:
@scripts/compile_doc.sh
@mkdir -p ${BUILD_ROOT}/${DOC_SUBDIR}
@cp .compile/*.pdf ${BUILD_ROOT}/${DOC_SUBDIR}
@echo Documentation files written to ${BUILD_ROOT}/${DOC_SUBDIR}
init: .initsubmodulelock .gitconfiglock
config: .gitconfiglock
@ -41,13 +24,9 @@ config: .gitconfiglock
@git config push.followTags true
@touch .gitconfiglock
all: clean build
clean:
@-rm -r build/
@-rm -r .compile/
.PHONY: build doc
#!/bin/bash
# Compiles all correspondence letters in repository
ci-build:
@python3 build.py --source-dir src --build-dir build/LatexPackagesBuild ${BUILD_FLAGS}

2
PyTeX

@ -1 +1 @@
Subproject commit c9bb0e87c91beae3e17a829603e4459cf804ec51
Subproject commit 126d420b7a6ed2d4b2a42d534ab2e12344869643

View file

@ -1,5 +1,10 @@
# Latex Packages
#### Rework in progress
I try to rework the math package in this branch, so this is wip
This is a collection of some packages I regularly use. Feel free to use them as well, if you want to.
However, some of them (especially `mkessler-math`) might be heavily customized for myself and do not form a real package in the Unix philosophy sense and are more of my preamble, that everyone gets to copy around that I bundled up in a central place. Some others (especially `mkessler-fancythm`) follow (or at least try to) this philosophy, so they should be designed to work with your documents and online provide specific functionality.
@ -10,13 +15,6 @@ Mostly, they are available as a repository so that
- I like sharing things that could help others, as I profit from others way too often
- This motivates me to keep things organized
## Usage
If you want to use these, just clone [latex-packages-build][lp-build] into your `~/texmf/tex/latex` directory, and you are ready to go.
The builds are also available as single files or as zip at the [pages][pages].
## Documentation
See the `documentation` folder (or zip file) at [pages][pages] for documentation to most of the packages.
## Bugs
As already mentioned, not all of these are intended for generic use. If you however feel like this should be the case, feel free to point out bugs or troubles when using these here at GitHub or to me directly.
@ -24,12 +22,4 @@ As already mentioned, not all of these are intended for generic use. If you howe
Feel free to send pull requests if you have suggestions for improvements.
## License
This is free software.
Prior to version 2.6 this has been MIT-licensed. Starting with version 1.6 this is licensed under the LPPL and/or the GPLv3.
See `LICENSE.md` for further details.
The `quiver.sty` package here is taken from [varkor/quiver][quiver] and licensed under the MIT License. It is redistributed unchanged for dependency reasons of my projects.
[pages]: https://latex.users.abstractnonsen.se/latex-packages
[lp-build]: https://git.abstractnonsen.se/latex/latex-packages-build
[quiver]: https://github.com/varkor/quiver
This is [MIT](https://mit-license.org/)-licensed and thus free software. You can freely share, distribute, modify and use these packages.

View file

@ -1,14 +0,0 @@
# This is the .latexmkrc file that needs to be used for compiling the documentation
# Note that the makeindex command is non-standard and follows the LaTeX3 architecture
# Without this, generating the indexes properly will not work and leads to compiling
# errors.
# When adding new packages, this should be symlinked to in each new directory,
# so that a call to latexmk will automatically use these options
$makeindex = 'makeindex -s gind.ist %O -o %D %S';
$clean_ext .= ' glo';
$clean_ext .= ' hd';
$clean_ext .= ' ins';
$pdf_mode = 1;
$print='pdf';
$pdflatex = 'pdflatex --shell-escape %O %S';

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,5 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-todo}
\begin{document}
\DocInput{../../../src/environments/fancythm/fancythm.dtx}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,5 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-todo}
\begin{document}
\DocInput{../../../src/environments/groupthm/groupthm.dtx}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,165 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{refproof} package}
\author{Maximilian Keßler}
\begin{document}
\maketitle
\begin{abstract}
This package aims to at consistently numbering claims within proofs.
For this purpose, take a valid \meta{label} when starting a proof,
associating it with a theorem/lemma etc.~and enabling us to subnumber
claims within this proof.
We also provide some customizations for proofs.
\end{abstract}
\tableofcontents
\begin{documentation}
\section{Proofs}
\subsection{Old proofs}
\begin{environment}{oldproof}
Behaves like \env{proof} from \pkg{amsmath}.
\end{environment}
\begin{environment}{oldsubproof}
Behaves like \env{subproof} from \pkg{mkessler-subproof}.
That is, behaves like the \pkg{amsmath} proof environment except that
the shown keyword is \enquote{subproof} and we end the proof
with a black instead of a white square.
\end{environment}
It is not recommended to use \env{oldproof} or \env{oldsubproof},
since these have no support for the \texttt{claim} management this
package provides.
They only exist for legacy reasons.
\subsection{Basic proofs}
Both of these have \texttt{claim} support,
which is explained later in \autoref{sec:claim-support}.
\begin{environment}{proof}
\begin{syntax}
\cs{begin}\{proof\}*\oarg{description}
\end{syntax}
The old \env{proof} environment has been modified slightly.
We still accept a \meta{description}, but this will be given
in parantheses after the usual \enquote{proof} keyword.
Additionally, we accept an optional \enquote{star}, that will be visually
displayed behind the \enquote{proof} keyword.
When nested, that is, when inside a \env{proof} or \env{subproof} environment,
the name will automatically change to \enquote{subproof}.
Nesting works to an arbitrary depth.
\end{environment}
\begin{environment}{subproof}
\begin{syntax}
\cs{begin}\{subproof\}*\oarg{description}
\end{syntax}
Works like the \env{proof} environment, but will always be named
\enquote{subproof} and finish with a black square.
You will probably rarely need this.
\end{environment}
\subsection{Refproofs}
\begin{environment}{refproof}
\begin{syntax}
\cs{begin}\{refproof\}*\marg{label}\oarg{description}
\end{syntax}
For the optional \enquote{*} or the \meta{description}
see the \env{proof} environment.
The \meta{label} has to be a valid \LaTeX-known label that \cs{ref} would
accept.
This \env{refproof} is then associated with the corresponding
theorem that \meta{label} refers to.
It will state \enquote{Proof of \meta{reference}} at the beginning of
the environment to indicate that this proof is associated with some
specific environment.
When the \pkg{hyperref} package is loaded, this is automatically
detected and an \cs{autoref} command is used to also indicate
the environment name in the reference.
When \env{refproof} has been called with the same label before,
the name will be adjusted to
\enquote{Continuation of proof of \meta{reference}}
automatically.
Claim support is explained in \autoref{sec:claim-support}.
\end{environment}
\section{Claim support}
\label{sec:claim-support}
\begin{environment}{claim}
\begin{environment}{claim*}
\begin{syntax}
\cs{begin}\{claim*\}
\end{syntax}
The star in the environment name makes the claim not to be numbered.
\end{environment}
\end{environment}
The \env{proof}, \env{subproof} and \env{refproof} environment alter the
behavior of the claim numbering as follows:
\begin{itemize}
\item The \env{proof} and \env{subproof} environment will reset the
\texttt{claim} counter at their beginning.
Claims will appear as \enquote{Claim 1}, \enquote{Claim 2},\ldots
At the end of the environment, the previous counter is restored.
\item The \env{refproof} environment will number claims within the
proof and \emph{all of its continuations}.
Additionally, claims will be numbered as
\enquote{\meta{reference}.C1}, \enquote{\meta{reference}.C2}
where \meta{reference} is the numbering style of the \meta{label}
that this proof is associated to.
At the end of the environment, the previous counter is restored.
\end{itemize}
\section{Language support}
This package makes use of the \pkg{translator} package to provide
\pkg{babel}-sensitive translations dynamically throughout the document.
You need the
\texttt{%
translator\allowbreak-proof\allowbreak-dictionary%
\allowbreak-\meta{language}.dict
}
dictionary somewhere where \LaTeX can find it.
It should have shipped with this documentation and the package source.
Currently, only German and English are supported.
\end{documentation}
\section{\pkg{groupthm} integration}
This has not been implemented yet, but future features include:
\begin{itemize}
\item Integrate the claim environment into the \texttt{star} and \texttt{starred}
groups of \pkg{groupthm}.
\item Integrate the optional stars of the \env{proof} etc into \pkg{groupthm},
i.e.~let them behave like \texttt{star} environments to toggle
these in a unified way.
\end{itemize}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,5 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-todo}
\begin{document}
\DocInput{../../../src/environments/thmstyle/thmstyle.dtx}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,105 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-symbindex} package}
\author{Maximilian Keßler}
\usepackage{mkessler-symbindex}
\begin{document}
\maketitle
\begin{abstract}
This package aims at indexing mathematical symbols properly.
It provides a key-value interface for declaring such symbols
and indexes them automatically when used.
\end{abstract}
\begin{documentation}
We base our index on the \pkg{imakeidx} package.
We will also only index each symbol only for its first appearance in the
document, not congesting the index unnecessarily.
\begin{function}{\DeclareSymbol}
\begin{syntax}
\cs{DeclareSymbol}\oarg{key=value list}\marg{symbol name}
\end{syntax}
This declares the command \cs{\meta{symbol name}}.
The behavior is controlled by the key-value list,
which accepts the following keys:
\begin{description}
\item[group = \meta{index name}]
Declares that this symbol will appear
in the \meta{index name} given.
If not present, the default index of the document will be used.
The index is assumed to exist.
\item[formula = \meta{formula}]
Controls to what formula the control sequence expands in the document
when called.
This can be any valid macro that is callable in math mode.
It is allowed that this macro captures additional arguments following
the command invocation, this will not interfere with indexing.
When not given, the \meta{formula} will just be the \meta{symbol name}
itself.
\item[ordered = \meta{word}]
Denotes that the symbol will be ordered alphabetically like \meta{word}
in the index.
When not given, the \meta{symbol name} will be used.
\item[description = \meta{text}]
Sets the description that appears in the index behind the symbol.
If not given, no description is present.
\item[operator = \meta{function}]
When \cs{\meta{symbol name}} is called,
this expands to the control sequence
\enquote{\meta{function}\{\meta{formula}\}}
so that the \meta{function} receives the \meta{formula}
as its first argument.
This can e.g.~be set to \cs{operatorname}, \cs{textbf}
or similar, adjusting the spacing or layouting of
the formula, while not influencing the ordering in the index.
When \meta{ordered = } is given yet, this is equivalent to
not using the \meta{operator = } and just putting this in the
\meta{formula = } key together.
When no \meta{operator} is given, \cs{use:n} is inserted,
which strips the braces around \meta{formula} and just
leaves formula in the input stream,
resulting in no effect.
\item[defaultargs = \meta{token list}]
This sets a list of tokens that will be inserted directly
after the invocation of \cs{\meta{symbol name}} when listing
the symbol in the index.
This makes it possible e.g.~to define \cs{Mod} as a formula
that stands for \enquote{$R$-modules} and is used as
\enquote{\texttt{\cs{Mod}\_R}} in the document
(or any other symbol that \texttt{R}, of course)
and list it as $\text{Mod}_R$ in the index,
by setting \enquote{defaultargs = \_R}.
\end{description}
\end{function}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,55 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-vocab} package}
\author{Maximilian Keßler}
\usepackage{mkessler-vocab}
\begin{document}
\maketitle
\begin{abstract}
When defining lots of new notions in a document,
it is useful to index these at the point of their definition,
to let users easily look up the spots where notions are
introduced in a document.
Also, one often wants to highlight these when defining a new notion.
We combined both approaches.
\end{abstract}
\begin{documentation}
\section{Macros}
\begin{function}{\vocab}
\begin{syntax}
\cs{vocab}\oarg{index entry}\marg{vocab}
\end{syntax}
Highlights \meta{vocab} in the text (bold blue).
Also indexes this under \oarg{index entry}.
If \oarg{index entry} is empty, \meta{vocab} itself will appear in the index.
\end{function}
\begin{function}{\printvocabindex, \PrintVocabIndex}
Prints the index of vocabs.
The \cs{printvocabindex} is deprecated,
use the better named \cs{PrintVocabIndex}.
\end{function}
\section{Package options}
You can specify the two options \texttt{index} and \texttt{noindex}.
The default is \texttt{noindex}.
Index entries are only generated if \texttt{index} has been specified.
Of course, \cs{PrintVocabIndex} results in an error if the package
has been loaded with \texttt{noindex}.
\end{documentation}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,119 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-categories} package}
\author{Maximilian Ke\ss ler}
\usepackage{mkessler-categories}
\NewDocumentCommand{\ShowCategory}{m}
{
\cs{#1} & $\csname #1\endcsname$ \\
}
\begin{document}
\maketitle
\begin{abstract}
This is a ready-to-use package providing symbols of mathematical
categories with automatic indexing.
It is certainly plausible that you prefer to name your categories slightly
differently that the author.
\end{abstract}
\begin{documentation}
\section{General notice}
This package is based on the \pkg{mkessler-symbindex} package.
We thus use \pkg{imakeindex} to generate the index file.
\section{Functionality}
\begin{function}{\category}
\begin{syntax}
\cs{category}\marg{category}
\end{syntax}
Makes the given argument \meta{category} behave like a math operator
and prints its name in bold.
This is just to ensure a unified style for printing categories,
if you don't like it, redefine this macro.
\end{function}
\begin{function}{\DeclareCategory}
\begin{syntax}
\cs{DeclareCategory}\oarg{key=value list}\marg{category}
\end{syntax}
Has the same syntax as \cs{DeclareSymbol} from the \pkg{mkessler-symbindex} package,
but adds the key \texttt{group = categories}.
\end{function}
\begin{function}{\DeclareSimpleCategory}
\begin{syntax}
\cs{DeclareSimpleCategory}\oarg{key=value list}\marg{category}\oarg{description}
\end{syntax}
Declares a \enquote{simple} category, i.e.~the category \cs{\meta{category}}
is declared and will expand to \enquote{\cs{category}\marg{category}}
when expanded.
The optional \meta{description} is shown in the index when present.
\end{function}
\begin{function}{\MakeCategoryIndex}
Prints the index of categories.
\end{function}
\section{Language integration}
This package uses \pkg{translator} to translate the package descriptions.
Currently, only English and German are supported.
\section{Default categories}
The package also provides default categories.
These are shown in \autoref{tab:provided-categories}.
You can view their appearance in the index and their descriptions in the
index of this documentation.
Unfortunately, the index is not (yet) compatible with the \texttt{l3doc} class
which is used for this documentation, so ignore everything before the
\enquote{@} characters.
\begin{table}[htpb]
\centering
\begin{tabular}{c | c}
Macro & Result \\
\hline
\ShowCategory{Top}
\ShowCategory{hTop}
\ShowCategory{Set}
\ShowCategory{CHaus}
\ShowCategory{Grp}
\ShowCategory{Ab}
\ShowCategory{CRing}
\ShowCategory{Ring}
\ShowCategory{Vect}
\ShowCategory{Cat}
\ShowCategory{Mod}
\ShowCategory{Alg}
\ShowCategory{Field}
\ShowCategory{AffVar}
\ShowCategory{Sch}
\ShowCategory{GrAb}
\ShowCategory{OrdCat}
\end{tabular}
\caption{caption}
\label{tab:provided-categories}
\end{table}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,59 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-faktor} package}
\author{Maximilian Keßler}
\usepackage{mkessler-faktor}
\begin{document}
\maketitle
\begin{abstract}
The \pkg{faktor} package provides a mechanism to produce fractions
for mathematical factors.
Its mechanism is, however, quite limited.
Inspired by the
\href{https://tex.stackexchange.com/}{Tex StackExchange}
answer of user
\href{https://tex.stackexchange.com/users/5764/werner}{Werner},
that was given on
\href{https://tex.stackexchange.com/questions/27591/extending-the-faktor-package}
{https://tex.stackexchange.com/\allowbreak questions/\allowbreak 27591/extending-the-faktor-package}
we provide a simple package that wraps (and slightly modifies)
the given answer into a more general \cs{faktor} command.
\end{abstract}
\begin{function}{\faktor}
\begin{function}{\faktor*}
\begin{syntax}
\cs{faktor}*\oarg{shift enumerator}\marg{enumerator}\oarg{shift denominator}\marg{denominator}
\end{syntax}
Produces a fraction with tilted \enquote{$\diagup$} symbol and the corresponding
\meta{enumerator} and \meta{denominator}.
The \enquote{$\diagup$} symbol is automatically scaled.
The \meta{shift} parameters can be controlled to fine tune the vertical
placement of \meta{enumerator} and \meta{denominator}.
Their default values when not given are \texttt{0.5} and \texttt{-0.5},
respectively.
The \enquote{*} can be optionally given. This will make the \cs{faktor}
behave like the old \cs{faktor} command from the \cs{faktor} package,
that is, the \enquote{$\diagup$} won't scale.
\end{function}
\end{function}
\begin{function}{\cofaktor}
\begin{function}{\cofaktor*}
\begin{syntax}
\cs{faktor}*\oarg{shift denominator}\marg{denominator}\oarg{shift enumerator}\marg{enumerator}
\end{syntax}
Behaves the same as \cs{faktor}, but produces a \cs{cofaktor}.
\end{function}
\end{function}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,102 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-mathalias} package}
\author{Maximilian Keßler}
\usepackage{mkessler-mathalias}
\begin{document}
\maketitle
\begin{abstract}
Lazy people prefer to write stuff like \cs{Z}, \cs{Q} to get the integers
$\mathbb{Z}$ and rationals $\mathbb{Q}$.
They also often use shortcuts like \cs{bA} for \cs{mathbb}\{A\} to get $\mathbb{A}$.
While the author does not encourage such usage,
this package provide a general syntax to generate such aliases.
\end{abstract}
\begin{documentation}
\section{(Don't) be lazy}
You actually should \emph{not} use this package.
This is poor \LaTeX style.
In case you don't care, or you must, because your co-workers do so,
this package is for you.
The author personally uses
\href{https://www.vim.org/}{Vim}
and the
\href{https://github.com/sirver/UltiSnips}{UltiSnips}
plugin to facilitate \LaTeX writing whilst producing a clean document
without those poor shortcut styles.
So in fact, \emph{be} lazy, but do it the proper way.
If you are, however, lazy, then put
\begin{verbatim}
\usepackage[extended]{mkessler-mathalias}
\end{verbatim}
in your preamble.
\section{Aliases}
\begin{function}{\MakeAliasesForWith}
\begin{syntax}
\cs{MakeAliasesForwith}\marg{macro}\marg{shortcut}\marg{token list}
\end{syntax}
For each \meta{token} in the \meta{token list},
this declares
\enquote{\cs{shortcut\meta{token}}}
as an abbreviation for
\enquote{\meta{macro}\marg{token}}.
\begin{texnote}
In \LaTeX3 syntax, this function would have signature \texttt{Nnn},
so give the \meta{macro} as a single token directly.
\end{texnote}
\begin{texnote}
Technically, the \meta{token list} can contain any tokens that
are fully expandable and thus accepted by \cs{csname} \ldots \cs{endcsname}.
However, as you want \emph{shortcuts}, you would typically invoke this
with tokens of category code 12.
\end{texnote}
\end{function}
As an example,
\begin{verbatim}
\MakeAliasesForWith\mathcal{c}{ABC}
\end{verbatim}
would define the three macros \cs{cA}, \cs{cB} and \cs{cC} to expand to
\cs{mathcal}\{A\},
\cs{mathcal}\{B\}
and
\cs{mathcal}\{c\},
respectively.
\section{Options for default aliases}
There are two options:
\begin{description}
\item[basic]
This declares \cs{C}, \cs{F}, \cs{K}, \cs{N}, \cs{Q}, \cs{R} and \cs{Z}
to expand to the \cs{mathbb} variants of these letters.
\item[extended]
Implies option \textbf{basic}.
Also defines shortcuts for \cs{mathbb}, \cs{mathfrak} and \cs{mathcal}
for each capital arabic letter with the prefixes \enquote{b},
\enquote{f} and \enquote{c}, respectively.
\end{description}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,70 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-mathfig} package}
\author{Maximilian Ke\ss ler}
\usepackage{mkessler-mathfig}
\begin{document}
\maketitle
\begin{abstract}
This is just some small wrapper package for drawing mathematical figures.
\end{abstract}
\begin{documentation}
\section{Loaded packages}
We load \pkg{pgfplots}, \pkg{tikz}, \pkg{tikz-cd} and \pkg{xy}.
\section{Additional macros}
\begin{function}{\pushoutsymbol}
Denotes a pushoutsymbol used in category theory diagrams.
\end{function}
\begin{function}{\pullbacksymbol}
Denotes a pullbacksymbol used in category theory diagrams.
\end{function}
\begin{function}{\pushout}
\begin{syntax}
\cs{pushout}\oarg{path to bottom right corner}
\end{syntax}
Invoked inside a \env{tikzcd} environment.
This assumes being called in the top left corner of some
commutative square and marks this square as a pushout.
The \meta{path} consists of symbols \texttt{d}, \texttt{u}, \texttt{r}
and \texttt{l}, as in \pkg{tikz-cd}.
By default, it is \texttt{dr}, being usable for default squares.
A phantom arrow is drawn in the given direction that
gets a \cs{pushoutsymbol}.
\end{function}
\begin{function}{\pullback}
\begin{syntax}
\cs{pullback}\oarg{path to bottom right corner}
\end{syntax}
Invoked inside a \env{tikzcd} environment.
This assumes being called in the top left corner of some
commutative square and marks this square as a pullback.
The \meta{path} consists of symbols \texttt{d}, \texttt{u}, \texttt{r}
and \texttt{l}, as in \pkg{tikz-cd}.
By default, it is \texttt{dr}, being usable for default squares.
A phantom arrow is drawn in the given direction that
gets a \cs{pullbacksymbol}.
\end{function}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,93 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-mathfixes}
\title{The \pkg{mkessler-mathfixes} package}
\author{Maximilian Ke\ss ler}
\NewDocumentCommand{\ShowMacro}{m}
{
\cs{#1} & $ \csname #1\endcsname $
\\
}
\begin{document}
\maketitle
\begin{documentation}
\begin{abstract}
This package includes some hacky \LaTeX (re)-definitions to fix common
misbehavior of built-in macros.
For sure, this is personal view-dependent.
If you don't like these definitions, don't use this package.
\end{abstract}
\section{Provided macros}
\autoref{tab:label} shows the behavior of macros with the
\pkg{mkessler-mathfixes} behavior.
\begin{function}{\degree}
Prints a visual degree symbol, as in $37\degree$.
\end{function}
\begin{function}{\oldlim}
Behaves like the built-in \cs{lim} from \LaTeX.
\end{function}
\begin{function}{\lim}
Defined as \cs{oldlim}\cs{limits}, always puts the limits below the symbol,
also in inline math mode.
\end{function}
\begin{function}{\subset, \supset}
Redefined to \cs{subseteq} and \cs{supseteq} to avoid ambiguities.
\end{function}
\begin{function}{\oldphi, \uglyphi, \goldenratio}
Synonyms for the built-in \cs{phi} symbol.
\end{function}
\begin{function}{\phi, \varphi}
Synonyms for the built-in \cs{varphi} symbol.
\end{function}
\begin{function}{\oldespilon, \uglyepsilon}
Synonyms for the built-in \cs{epsilon} symbol.
\end{function}
\begin{function}{\epsilon, \varepsilon}
Synonyms for the built-in \cs{varepsilon} symbol.
\end{function}
\begin{table}[htpb]
\centering
\begin{tabular}{c | c}
Command & Shown by \LaTeX \\
\ShowMacro{degree}
\ShowMacro{subset}
\ShowMacro{supset}
\ShowMacro{oldphi}
\ShowMacro{uglyphi}
\ShowMacro{goldenratio}
\ShowMacro{phi}
\ShowMacro{varphi}
\ShowMacro{oldepsilon}
\ShowMacro{uglyepsilon}
\ShowMacro{epsilon}
\ShowMacro{varepsilon}
\texttt{\$\cs{oldlim}\_\{n \cs{to} \cs{infty}\}\$} & $\oldlim_{n \to \infty}$ \\
\texttt{\$\cs{lim}\_\{n \cs{to} \cs{infty}\}\$} & $\lim_{n \to \infty}$ \\
\end{tabular}
\caption{Symbols when loaded with the \pkg{mkessler-mathfixes} package.}
\label{tab:label}
\end{table}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,60 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-mathfont}
\title{The \pkg{mkessler-mathfont} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{abstract}
There are various math alphabets available by different packages.
We load several of these and make these available in a consistent way.
\end{abstract}
\section{Usage}
Load this package before \pkg{eucal}, \pkg{amsfonts} and \pkg{mathrsfs}
to ensure proper font loading.
\section{Loaded alphabets}
\begin{function}{\mathcal,\mathfrak,\mathscr,\mathcat,\mathcalo}
\autoref{tab:provided-fonts} shows the fonts loaded from different packages.
\autoref{tab:font-samples} shows samples of these fonts when the
\pkg{mkessler-mathfont} packages has been loaded.
\end{function}
\begin{table}[htpb]
\centering
\caption{Fonts provided}
\label{tab:provided-fonts}
\begin{tabular}{c | c | c }
Command & Font \\
\hline
\cs{mathcal} & default \cs{mathcal} \\
\cs{mathfrak} & \cs{mathfrak} from \pkg{amsfonts} \\
\cs{mathscr} & \cs{mathscr} from \pkg{mathrsfs} \\
\cs{mathcat} & \cs{mathscr} from \pkg{mathrsfs} \\
\cs{mathcalo} & \cs{mathscr} from \pkg{eucal} with \texttt{mathscr} option \\
\end{tabular}
\end{table}
\begin{table}[htpb]
\centering
\caption{Font samples}
\label{tab:font-samples}
\begin{tabular}{c | c }
Command & sample \\
\hline
\cs{mathcal} & $\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ \\
\cs{mathfrak} & $\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ \\
\cs{mathscr} & $\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ \\
\cs{mathcalo} & $\mathcalo{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ \\
\end{tabular}
\end{table}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,140 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-mathop} package}
\author{Maximilian Keßler}
\usepackage{mkessler-mathop}
\begin{document}
\maketitle
\begin{abstract}
This package provides common math operators.
It is certainly based on the authors opinion and use cases and might not
fulfill your personal needs.
It is, however, still aimed to be reasonably general to a broader userbase.
\end{abstract}
\begin{documentation}
\section{General macros}
\begin{function}{\DeclareSimpleMathOperator}
\begin{syntax}
\cs{DeclareSimpleMathOperator}\marg{operator}
\end{syntax}
This is similar to the \cs{DeclareMathOperator} macro of \pkg{mathtools},
but only accepts one argument.
The operator expansion is the operator name itself.
\end{function}
\begin{function}{\DeclareDistribution}
Currently same as \cs{DeclareSimpleMathOperator},
existent for semantical reasons and possible future change of
layouting of stochastical distributions.
\end{function}
\section{Special symbols}
In this section we describe all math operators that are not of textual nature.
\begin{function}{\tensor}
Alias for \cs{otimes}.
\end{function}
\begin{function}{\twedge, \tsmash}
The \enquote{t} stands for \enquote{topological}.
These are to avoid confusion between the standard latex \cs{wedge},
which gives $\wedge$,
although in topology,
the symbol $\twedge$ is called a \enquote{wedge}
and $\tsmash$ denotes the \enquote{smash product}.
\end{function}
\begin{function}{\cfun, \One}
Characteristic function symbol.
Comes from \pkg{bbm} and denotes \enquote{\cs{mathbbm}\{1\}}.
\end{function}
\begin{function}{\suchthat}
gives a scaling \enquote{$\left.\suchthat\right.$} symbol used in set-definitions.
Has to be in a \enquote{\cs{left} \ldots\cs{right}} block to
scale properly.
\end{function}
\begin{function}{\ceil, \floor}
\begin{syntax}
\cs{ceil}\marg{args}
\end{syntax}
Denotes the standard mathematical ceil and floor functions.
\end{function}
\begin{function}{\abs, \abs*}
\begin{syntax}
\cs{abs}*\marg{args}
\end{syntax}
Denotes the absolute value of an expression.
The bars scale by default, the starred variant does not scale.
\end{function}
\begin{function}{\norm}
\begin{syntax}
\cs{norm}*\marg{args}
\end{syntax}
Norm of an expression. The starred variant does not scale.
\end{function}
\begin{function}{\amalgprod}
Denotes an amalgamatic product.
\end{function}
\begin{function}{\ab, \op}
Give a textual representation of themselves.
\end{function}
\begin{function}{\opposite}
\begin{syntax}
\meta{structure}\cs{opposite}
\end{syntax}
Denotes the opposite of some mathematical object.
\end{function}
\begin{function}{\abelianization}
Denotes the abelianization of a group object.
\end{function}
\begin{function}{\directlimit, \inverselimit}
Semantical synonyms for \cs{varinjlim} and \cs{varprojlim}.
\end{function}
\begin{function}{\frestriction}
\begin{syntax}
\cs{frestriction}\marg{function}\marg{domain}
\end{syntax}
Properly denotes function restriction with adequate spacing.
\end{function}
\section{Simple operators}
The vast majority of this package is simple operators such as \cs{id},
which expands to $\id$.
These are for now not documented, search the source code for
\cs{DeclareSimpleMath\allowbreak Operator} if you need to know.
\section{TODO}
proper language support with \pkg{translator}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,76 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-mathsymb} package}
\author{Maximilian Keßler}
\usepackage{mkessler-mathsymb}
\begin{document}
\maketitle
\begin{abstract}
Provides some selected symbols related to mathematics.
This is certainly a very specific, non-generic package,
heavily based on the authors use-cases.
Feel free to use this as well if you like the symbols.
\end{abstract}
\begin{documentation}
\begin{function}{\noloc}
An inverse \cs{colon} with the correct spacing.
The implementation is by user
\href{https://tex.stackexchange.com/users/4427/egreg}
on
\href{https://tex.stackexchange.com/}{Tex StackExchange}
question
\href{https://tex.stackexchange.com/questions/546713/spacing-in-colon}
{https://\allowbreak tex\allowbreak .stack\allowbreak exchange\allowbreak .com/\allowbreak questions/546713/spacing-in-colon}
\end{function}
\begin{function}{\contra}
Prints a contradiction symbol
\end{function}
\begin{function}{\Warning}
Prints a warning symbol
\end{function}
\begin{function}{\circled}
\begin{syntax}
\cs{circled}\marg{stuff}
\end{syntax}
Dynamically circles the \meta{stuff}.
The circle is adjusted in size.
\end{function}
\begin{function}{\chainbullet}
Synonym for \cs{bullet}.
Only existent for semantic reasons.
\end{function}
\begin{table}[htpb]
\centering
\caption{Symbol table}
\label{tab:symbols}
\begin{tabular}{c | c}
Macro & Result \\
\texttt{Y \cs{leftarrow} X \cs{noloc} f} & $Y \leftarrow X \noloc f$ \\
\cs{contra} & \contra \\
\cs{Warning} & \Warning \\
\cs{circled}\{1\} & \circled{1} \\
\cs{chainbullet} & $\chainbullet$
\end{tabular}
\end{table}
\end{documentation}
\PrintIndex
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,69 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-enumerate} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{documentation}
\begin{abstract}
This is some small wrapper around the package \pkg{enumerate}
that provides some additional tweaks.
\end{abstract}
We load \pkg{enumitem} with the \texttt{shortlabels} option.
\begin{function}{\setItemnumber, \SetItemNumber}
\begin{syntax}
\cs{SetItemNumber}\marg{numeric expression}
\end{syntax}
Sets the item number in the current enumeration.
The \cs{setItemnumber} is deprecated, use \cs{SetItemNumber}
instead if you can.
\end{function}
We now provide for standard variants for enumerations:
\begin{function}{circled, propery, equivalent, holds}
\begin{description}
\item[circled]
This circles the (arabic) item numbers
\item[property]
This numbers as \enquote{(\cs{roman}*)},
i.e.~\enquote{i)}, \enquote{ii)},\ldots
\item[equivalent]
This numbers as \enquote{(\cs{arabic}*)},
i.e.~\enquote{(1)},\enquote{(2)},\ldots
\item[holds]
This numbers as \enquote{\cs{arabic}*)}.,
i.e.~\enquote{1)},\enquote{2)},\ldots
\end{description}
\end{function}
All of these are available as
\begin{description}
\item[ShortLabel]
Specify \texttt{c}, \texttt{p}, \texttt{e} or \texttt{h}
as the first option to \env{enumerate}.
\item[Label Value]
Specify \texttt{label = circled } and similar.
\item[Key]
Just specify \texttt{circled} as an option directly and similar.
\end{description}
\end{documentation}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,52 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-hypersetup}
\title{The \pkg{mkessler-hypersetup} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{abstract}
This is just a quick wrapper around the \pkg{hyperref} package
and - optionally - the cleveref package.
\end{abstract}
\begin{documentation}
\section{Usage}
The package provides one option: \texttt{cleveref}.
When given, \pkg{cleveref} is also loaded.
The package loads \pkg{hyperref} at the end of the preamble,
and (optionally), \pkg{cleveref} afterwards.
This ensures proper loading order of these packages.
Additionally, we provide some default settings
that are shown in \autoref{tab:hyperref-values}.
\begin{table}[htpb]
\centering
\begin{tabular}{c | c}
Key & Value \\
\hline
colorlinks & none \\
citecolor & violet \\
urlcolor & blue!80!black \\
linkcolor & red!50!black \\
pdftitle & \cs{@course} if defined, else \cs{@title} \\
pdfauthor & \cs{@author}
\end{tabular}
\caption{Hyperref values set by \pkg{mkessler-hypersetup}}
\label{tab:hyperref-values}
\end{table}
\end{documentation}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,31 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-incfig} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{documentation}
\begin{abstract}
This is some small wrapper around incfigures,
based on
\href{https://castel.dev/post/lecture-notes-2/}
{https://castel.dev/\allowbreak post/\allowbreak lecture-notes-2/}
\end{abstract}
\begin{function}{\incfig}
\begin{syntax}
\cs{incfig}{filename}
\end{syntax}
Inserts an incfigure.
The figures is assumed to be in the \texttt{figures/} folder.
The extension \texttt{pdf_tex} has \emph{not} to be given.
\end{function}
\end{documentation}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,46 +0,0 @@
\documentclass[full]{l3doc}
\title{The \pkg{mkessler-math} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{documentation}
\begin{abstract}
A ready-to-use math package that just glues lots of other packages together.
\end{abstract}
\section{Usage}
\begin{verbatim}
\usepackage{mkessler-math}
\end{verbatim}
\section{Loaded packages}
We load the following:
\pkg{IEEEtrantools},
\pkg{algorithm2e},
\pkg{amsmath},
\pkg{amssymb},
\pkg{amsthm},
\pkg{esint},
\pkg{latexsym},
\pkg{mathabx},
\pkg{mathtools},
\pkg{mkessler-categories},
\pkg{mkessler-faktor},
\pkg{mkessler-mathalias},
\pkg{mkessler-mathfig},
\pkg{mkessler-mathfixes}
\pkg{mkessler-mathfont},
\pkg{mkessler-mathop},
\pkg{mkessler-mathsymb},
\pkg{mkessler-unicodechar},
\end{documentation}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,54 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-todo}
\title{The \pkg{mkessler-todo} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{documentation}
\begin{abstract}
A simple wrapper around the \pkg{todonotes} package
with some shortcut todos that the author uses often.
\end{abstract}
\section{Usage}
We load the \pkg{todonotes} package and the \pkg{marginnote} package.
By redefining \cs{marginpar} to \cs{marginnote} we ensure
that the \cs{todo} macro will also be usable inside minipages properly.
\begin{function}{\todoref}
Marks a missing reference.
Does \emph{not} require additional arguments.
\todoref
\end{function}
\begin{function}{\todoquestion}
Used for questions that arise during lectures.
Same syntax as \cs{todo}.
\todoquestion{Is this useful?}
\end{function}
\begin{function}{\todotex}
Used for marking tex-related todos.
Same syntax as \cs{todo}.
\todotex{Fix spacing}
\end{function}
\begin{function}{\todotypo}
Used for marking (possible) typos of the lecturer for later inspection.
Same syntax as \cs{todo}.
\todotypo{Was this misspelled?}
\end{function}
\end{documentation}
\end{document}

View file

@ -1 +0,0 @@
../../LATEXMKRC

View file

@ -1,48 +0,0 @@
\documentclass[full]{l3doc}
\usepackage{mkessler-unicodechar}
\title{The \pkg{mkessler-unicodechar} package}
\author{Maximilian Ke\ss ler}
\begin{document}
\maketitle
\begin{abstract}
This is just a quick wrapper around the \pkg{unicodechar} package
that defines the Unicode symbols for greek letters to be available
in \LaTeX directly.
\end{abstract}
\section{Provided symbols}
We just provide the greek (lowercase) alphabet:
\[
α
β
γ
δ
ε
ζ
η
θ
ι
κ
λ
μ
ν
ξ
ο
π
ρ
σ
τ
υ
φ
χ
ψ
ω
\]
\end{document}

View file

@ -1,415 +0,0 @@
The LaTeX Project Public License
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
LPPL Version 1.3c 2008-05-04
Copyright 1999 2002-2008 LaTeX3 Project
Everyone is allowed to distribute verbatim copies of this
license document, but modification of it is not allowed.
PREAMBLE
========
The LaTeX Project Public License (LPPL) is the primary license under
which the LaTeX kernel and the base LaTeX packages are distributed.
You may use this license for any work of which you hold the copyright
and which you wish to distribute. This license may be particularly
suitable if your work is TeX-related (such as a LaTeX package), but
it is written in such a way that you can use it even if your work is
unrelated to TeX.
The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
below, gives instructions, examples, and recommendations for authors
who are considering distributing their works under this license.
This license gives conditions under which a work may be distributed
and modified, as well as conditions under which modified versions of
that work may be distributed.
We, the LaTeX3 Project, believe that the conditions below give you
the freedom to make and distribute modified versions of your work
that conform with whatever technical specifications you wish while
maintaining the availability, integrity, and reliability of
that work. If you do not see how to achieve your goal while
meeting these conditions, then read the document `cfgguide.tex'
and `modguide.tex' in the base LaTeX distribution for suggestions.
DEFINITIONS
===========
In this license document the following terms are used:
`Work'
Any work being distributed under this License.
`Derived Work'
Any work that under any applicable law is derived from the Work.
`Modification'
Any procedure that produces a Derived Work under any applicable
law -- for example, the production of a file containing an
original file associated with the Work or a significant portion of
such a file, either verbatim or with modifications and/or
translated into another language.
`Modify'
To apply any procedure that produces a Derived Work under any
applicable law.
`Distribution'
Making copies of the Work available from one person to another, in
whole or in part. Distribution includes (but is not limited to)
making any electronic components of the Work accessible by
file transfer protocols such as FTP or HTTP or by shared file
systems such as Sun's Network File System (NFS).
`Compiled Work'
A version of the Work that has been processed into a form where it
is directly usable on a computer system. This processing may
include using installation facilities provided by the Work,
transformations of the Work, copying of components of the Work, or
other activities. Note that modification of any installation
facilities provided by the Work constitutes modification of the Work.
`Current Maintainer'
A person or persons nominated as such within the Work. If there is
no such explicit nomination then it is the `Copyright Holder' under
any applicable law.
`Base Interpreter'
A program or process that is normally needed for running or
interpreting a part or the whole of the Work.
A Base Interpreter may depend on external components but these
are not considered part of the Base Interpreter provided that each
external component clearly identifies itself whenever it is used
interactively. Unless explicitly specified when applying the
license to the Work, the only applicable Base Interpreter is a
`LaTeX-Format' or in the case of files belonging to the
`LaTeX-format' a program implementing the `TeX language'.
CONDITIONS ON DISTRIBUTION AND MODIFICATION
===========================================
1. Activities other than distribution and/or modification of the Work
are not covered by this license; they are outside its scope. In
particular, the act of running the Work is not restricted and no
requirements are made concerning any offers of support for the Work.
2. You may distribute a complete, unmodified copy of the Work as you
received it. Distribution of only part of the Work is considered
modification of the Work, and no right to distribute such a Derived
Work may be assumed under the terms of this clause.
3. You may distribute a Compiled Work that has been generated from a
complete, unmodified copy of the Work as distributed under Clause 2
above, as long as that Compiled Work is distributed in such a way that
the recipients may install the Compiled Work on their system exactly
as it would have been installed if they generated a Compiled Work
directly from the Work.
4. If you are the Current Maintainer of the Work, you may, without
restriction, modify the Work, thus creating a Derived Work. You may
also distribute the Derived Work without restriction, including
Compiled Works generated from the Derived Work. Derived Works
distributed in this manner by the Current Maintainer are considered to
be updated versions of the Work.
5. If you are not the Current Maintainer of the Work, you may modify
your copy of the Work, thus creating a Derived Work based on the Work,
and compile this Derived Work, thus creating a Compiled Work based on
the Derived Work.
6. If you are not the Current Maintainer of the Work, you may
distribute a Derived Work provided the following conditions are met
for every component of the Work unless that component clearly states
in the copyright notice that it is exempt from that condition. Only
the Current Maintainer is allowed to add such statements of exemption
to a component of the Work.
a. If a component of this Derived Work can be a direct replacement
for a component of the Work when that component is used with the
Base Interpreter, then, wherever this component of the Work
identifies itself to the user when used interactively with that
Base Interpreter, the replacement component of this Derived Work
clearly and unambiguously identifies itself as a modified version
of this component to the user when used interactively with that
Base Interpreter.
b. Every component of the Derived Work contains prominent notices
detailing the nature of the changes to that component, or a
prominent reference to another file that is distributed as part
of the Derived Work and that contains a complete and accurate log
of the changes.
c. No information in the Derived Work implies that any persons,
including (but not limited to) the authors of the original version
of the Work, provide any support, including (but not limited to)
the reporting and handling of errors, to recipients of the
Derived Work unless those persons have stated explicitly that
they do provide such support for the Derived Work.
d. You distribute at least one of the following with the Derived Work:
1. A complete, unmodified copy of the Work;
if your distribution of a modified component is made by
offering access to copy the modified component from a
designated place, then offering equivalent access to copy
the Work from the same or some similar place meets this
condition, even though third parties are not compelled to
copy the Work along with the modified component;
2. Information that is sufficient to obtain a complete,
unmodified copy of the Work.
7. If you are not the Current Maintainer of the Work, you may
distribute a Compiled Work generated from a Derived Work, as long as
the Derived Work is distributed to all recipients of the Compiled
Work, and as long as the conditions of Clause 6, above, are met with
regard to the Derived Work.
8. The conditions above are not intended to prohibit, and hence do not
apply to, the modification, by any method, of any component so that it
becomes identical to an updated version of that component of the Work as
it is distributed by the Current Maintainer under Clause 4, above.
9. Distribution of the Work or any Derived Work in an alternative
format, where the Work or that Derived Work (in whole or in part) is
then produced by applying some process to that format, does not relax or
nullify any sections of this license as they pertain to the results of
applying that process.
10. a. A Derived Work may be distributed under a different license
provided that license itself honors the conditions listed in
Clause 6 above, in regard to the Work, though it does not have
to honor the rest of the conditions in this license.
b. If a Derived Work is distributed under a different license, that
Derived Work must provide sufficient documentation as part of
itself to allow each recipient of that Derived Work to honor the
restrictions in Clause 6 above, concerning changes from the Work.
11. This license places no restrictions on works that are unrelated to
the Work, nor does this license place any restrictions on aggregating
such works with the Work by any means.
12. Nothing in this license is intended to, or may be used to, prevent
complete compliance by all parties with all applicable laws.
NO WARRANTY
===========
There is no warranty for the Work. Except when otherwise stated in
writing, the Copyright Holder provides the Work `as is', without
warranty of any kind, either expressed or implied, including, but not
limited to, the implied warranties of merchantability and fitness for a
particular purpose. The entire risk as to the quality and performance
of the Work is with you. Should the Work prove defective, you assume
the cost of all necessary servicing, repair, or correction.
In no event unless required by applicable law or agreed to in writing
will The Copyright Holder, or any author named in the components of the
Work, or any other party who may distribute and/or modify the Work as
permitted above, be liable to you for damages, including any general,
special, incidental or consequential damages arising out of any use of
the Work or out of inability to use the Work (including, but not limited
to, loss of data, data being rendered inaccurate, or losses sustained by
anyone as a result of any failure of the Work to operate with any other
programs), even if the Copyright Holder or said author or said other
party has been advised of the possibility of such damages.
MAINTENANCE OF THE WORK
=======================
The Work has the status `author-maintained' if the Copyright Holder
explicitly and prominently states near the primary copyright notice in
the Work that the Work can only be maintained by the Copyright Holder
or simply that it is `author-maintained'.
The Work has the status `maintained' if there is a Current Maintainer
who has indicated in the Work that they are willing to receive error
reports for the Work (for example, by supplying a valid e-mail
address). It is not required for the Current Maintainer to acknowledge
or act upon these error reports.
The Work changes from status `maintained' to `unmaintained' if there
is no Current Maintainer, or the person stated to be Current
Maintainer of the work cannot be reached through the indicated means
of communication for a period of six months, and there are no other
significant signs of active maintenance.
You can become the Current Maintainer of the Work by agreement with
any existing Current Maintainer to take over this role.
If the Work is unmaintained, you can become the Current Maintainer of
the Work through the following steps:
1. Make a reasonable attempt to trace the Current Maintainer (and
the Copyright Holder, if the two differ) through the means of
an Internet or similar search.
2. If this search is successful, then enquire whether the Work
is still maintained.
a. If it is being maintained, then ask the Current Maintainer
to update their communication data within one month.
b. If the search is unsuccessful or no action to resume active
maintenance is taken by the Current Maintainer, then announce
within the pertinent community your intention to take over
maintenance. (If the Work is a LaTeX work, this could be
done, for example, by posting to comp.text.tex.)
3a. If the Current Maintainer is reachable and agrees to pass
maintenance of the Work to you, then this takes effect
immediately upon announcement.
b. If the Current Maintainer is not reachable and the Copyright
Holder agrees that maintenance of the Work be passed to you,
then this takes effect immediately upon announcement.
4. If you make an `intention announcement' as described in 2b. above
and after three months your intention is challenged neither by
the Current Maintainer nor by the Copyright Holder nor by other
people, then you may arrange for the Work to be changed so as
to name you as the (new) Current Maintainer.
5. If the previously unreachable Current Maintainer becomes
reachable once more within three months of a change completed
under the terms of 3b) or 4), then that Current Maintainer must
become or remain the Current Maintainer upon request provided
they then update their communication data within one month.
A change in the Current Maintainer does not, of itself, alter the fact
that the Work is distributed under the LPPL license.
If you become the Current Maintainer of the Work, you should
immediately provide, within the Work, a prominent and unambiguous
statement of your status as Current Maintainer. You should also
announce your new status to the same pertinent community as
in 2b) above.
WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
======================================================
This section contains important instructions, examples, and
recommendations for authors who are considering distributing their
works under this license. These authors are addressed as `you' in
this section.
Choosing This License or Another License
----------------------------------------
If for any part of your work you want or need to use *distribution*
conditions that differ significantly from those in this license, then
do not refer to this license anywhere in your work but, instead,
distribute your work under a different license. You may use the text
of this license as a model for your own license, but your license
should not refer to the LPPL or otherwise give the impression that
your work is distributed under the LPPL.
The document `modguide.tex' in the base LaTeX distribution explains
the motivation behind the conditions of this license. It explains,
for example, why distributing LaTeX under the GNU General Public
License (GPL) was considered inappropriate. Even if your work is
unrelated to LaTeX, the discussion in `modguide.tex' may still be
relevant, and authors intending to distribute their works under any
license are encouraged to read it.
A Recommendation on Modification Without Distribution
-----------------------------------------------------
It is wise never to modify a component of the Work, even for your own
personal use, without also meeting the above conditions for
distributing the modified component. While you might intend that such
modifications will never be distributed, often this will happen by
accident -- you may forget that you have modified that component; or
it may not occur to you when allowing others to access the modified
version that you are thus distributing it and violating the conditions
of this license in ways that could have legal implications and, worse,
cause problems for the community. It is therefore usually in your
best interest to keep your copy of the Work identical with the public
one. Many works provide ways to control the behavior of that work
without altering any of its licensed components.
How to Use This License
-----------------------
To use this license, place in each of the components of your work both
an explicit copyright notice including your name and the year the work
was authored and/or last substantially modified. Include also a
statement that the distribution and/or modification of that
component is constrained by the conditions in this license.
Here is an example of such a notice and statement:
%% pig.dtx
%% Copyright 2005 M. Y. Name
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is M. Y. Name.
%
% This work consists of the files pig.dtx and pig.ins
% and the derived file pig.sty.
Given such a notice and statement in a file, the conditions
given in this license document would apply, with the `Work' referring
to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
referring to any `LaTeX-Format', and both `Copyright Holder' and
`Current Maintainer' referring to the person `M. Y. Name'.
If you do not want the Maintenance section of LPPL to apply to your
Work, change `maintained' above into `author-maintained'.
However, we recommend that you use `maintained', as the Maintenance
section was added in order to ensure that your Work remains useful to
the community even when you can no longer maintain and support it
yourself.
Derived Works That Are Not Replacements
---------------------------------------
Several clauses of the LPPL specify means to provide reliability and
stability for the user community. They therefore concern themselves
with the case that a Derived Work is intended to be used as a
(compatible or incompatible) replacement of the original Work. If
this is not the case (e.g., if a few lines of code are reused for a
completely different task), then clauses 6b and 6d shall not apply.
Important Recommendations
-------------------------
Defining What Constitutes the Work
The LPPL requires that distributions of the Work contain all the
files of the Work. It is therefore important that you provide a
way for the licensee to determine which files constitute the Work.
This could, for example, be achieved by explicitly listing all the
files of the Work near the copyright notice of each file or by
using a line such as:
% This work consists of all files listed in manifest.txt.
in that place. In the absence of an unequivocal list it might be
impossible for the licensee to determine what is considered by you
to comprise the Work and, in such a case, the licensee would be
entitled to make reasonable conjectures as to which files comprise
the Work.

View file

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View file

@ -1,8 +0,0 @@
#! /bin/bash
# Compiles all documentation files in repository
set -e
BUILD_COMMAND="latexmk -output-directory=$(pwd)/.compile $1"
find doc -type f -name "*.tex" -execdir sh -c "$BUILD_COMMAND" -- {} \;

View file

@ -0,0 +1,267 @@
__HEADER__(Theorem-Environment Package)
%Provides fancy theorem-like-environments used in the write-ups of my lecture notes
\RequirePackage{xkeyval}
__NEW_IF__(showstars,true)
__NEW_IF__(showdaggers,true)
__NEW_IF__(includestars,true)
__NEW_IF__(includeoral,true)
__NEW_IF__(markoral,true)
__NEW_IF__(lecturenumbers,true)
__NEW_IF__(numbersmallenvironmentswiththeorem,false)
__NEW_IF__(numbersmallenvironments,false)
__NEW_IF__(defaulttheorems,true)
\define@choicekey*{__PACKAGE_NAME__}{__PACKAGE_PREFIX__numbersmallenvironments}[\val\nr]{no,section,theorem}{%
\ifcase\nr\relax
__SET_IF__(numbersmallenvironments,false)
\or
__SET_IF__(numbersmallenvironments,true)
%numbering small environments within sections is forbidden whilst using lecturenumbes
__IF__(lecturenumbers)
__SET_IF__(numbersmallenvironmentswiththeorem,true)
\else
__SET_IF__(numbersmallenvironmentswiththeorem,false)
\fi
\or
__SET_IF__(numbersmallenvironments,true)
__SET_IF__(numbersmallenvironmentswiththeorem,true)
\fi
}
\define@choicekey*{__PACKAGE_NAME__}{__PACKAGE_PREFIX__lecturenumbers}[\val\nr]{true,false}{%
\ifcase\nr\relax
__SET_IF__(lecturenumbers,true)
\else
__SET_IF__(lecturenumbers,false)
\fi
}
\define@choicekey*{__PACKAGE_NAME__}{__PACKAGE_PREFIX__defaulttheorems}[\val\nr]{true,false}{%
\ifcase\nr\relax
__SET_IF__(defaulttheorems,true)
\else
__SET_IF__(defaulttheorems,false)
\fi
}
\define@choicekey*{__PACKAGE_NAME__}{__PACKAGE_PREFIX__showdaggers}[\val\nr]{true,false}{%
\ifcase\nr\relax
__SET_IF__(showdaggers,true)
\else
__SET_IF__(showdaggers,false)
\fi
}
\define@choicekey*{__PACKAGE_NAME__}{ownenvironments}[\val\nr]{on, natural, off}{%
\ifcase\nr\relax
__SET_IF__(includestars,true)
__SET_IF__(showstars,true)
\or
__SET_IF__(includestars,true)
__SET_IF__(showstars,false)
\or
__SET_IF__(includestars,false)
__SET_IF__(showstars,false)
\fi
}
\define@choicekey*{__PACKAGE_NAME__}{oralremarks}[\val\nr]{on,natural,off}{%
\ifcase\nr\relax
__SET_IF__(includeoral,true)
__SET_IF__(markoral,true)
\or
__SET_IF__(includeoral,true)
__SET_IF__(markoral,true)
\or
__SET_IF__(includeoral,false)
\fi
}
%%%%% Option section
__LANGUAGE_OPTIONS_X__
\DeclareOptionX{showdaggers}{\setkeys{__PACKAGE_NAME__}{__PACKAGE_PREFIX__showdaggers=#1}}
\DeclareOptionX{ownenvironments}{\setkeys{__PACKAGE_NAME__}{ownenvironments=#1}}
\DeclareOptionX{oralremarks}{\setkeys{__PACKAGE_NAME__}{oralremarks=#1}}
\DeclareOptionX{lecturenumbers}{\setkeys{__PACKAGE_NAME__}{__PACKAGE_PREFIX__lecturenumbers=#1}}
\DeclareOptionX{numbersmallenvironments}{\setkeys{__PACKAGE_NAME__}{__PACKAGE_PREFIX__numbersmallenvironments=#1}}
\DeclareOptionX{defaulttheorems}{\setkeys{__PACKAGE_NAME__}{__PACKAGE_PREFIX__defaulttheorems=#1}}
__END_OPTIONS_X__
%%%%%%%% Implementation section
%Required Packages and setup
\RequirePackage{amsmath}
\RequirePackage{amsthm}
\RequirePackage{mdframed}
\RequirePackage{thmtools}
\RequirePackage[skins]{tcolorbox}
\RequirePackage{mfirstuc}
\RequirePackage{xifthen}
\RequirePackage{xparse}
\tcbuselibrary{breakable}
% Dummy counters
\declaretheorem[numberwithin=section]{__PACKAGE_PREFIX__dummy}
\declaretheorem[numberwithin=__PACKAGE_PREFIX__dummy]{__PACKAGE_PREFIX__smalldummy}
%%%%% Main part, i.e. providing macros for defining new theorems
%%Environments that are numbered by default have 3 versions:
% - the standard one, for numbering
% - one asterisk, to exclude them from numbering (because they were not numbered in the lecture) -> they will be numbered if 'truenmubers' option is set
% - two asterisks, for marking them as self-added, so they will not be numbered, but will receive a visual asterisk. -> They will be numbered if 'truenumbers' option is set
\NewDocumentCommand{\declarebigtheorem}{O{} O{} m m O{}}{
%First, store the name of the theorem in \theoremname
\if__PACKAGE_PREFIX__english
\ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}}
\else
\ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}}
\fi
%Define the mane version of the theorem
\ifthenelse{\isempty{#5}}{\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling = __PACKAGE_PREFIX__dummy]{#4}}{}
%Define the versions theorem*, theorem**, dtheorem
\if__PACKAGE_PREFIX__lecturenumbers
\if__PACKAGE_PREFIX__numbersmallenvironments
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=__PACKAGE_PREFIX__smalldummy]{#4*}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showstars *\else\fi, sibling=__PACKAGE_PREFIX__smalldummy]{#4**}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showdaggers $^{\dagger}$\else\fi, sibling=__PACKAGE_PREFIX__smalldummy]{d#4}
\else
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, numbered=no]{#4*}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showstars *\else\fi, numbered = no]{#4**}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showdaggers $^{\dagger}$\else\fi, numbered = no]{d#4}
\fi
\else
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=__PACKAGE_PREFIX__dummy]{#4*}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showstars *\else\fi, sibling=__PACKAGE_PREFIX__dummy]{#4**}
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showdaggers $^{\dagger}$\else\fi, sibling=__PACKAGE_PREFIX__dummy]{d#4}
\fi
\if__PACKAGE_PREFIX__includestars\else\renewenvironment{#4**}{\comment}{\endcomment}\fi
}
\NewDocumentCommand{\declaresmalltheorem}{O{} O{} m m}{
%Get the name of the theorem and store it in \theoremname
\if__PACKAGE_PREFIX__english
\ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}}
\else
\ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}}
\fi
\if__PACKAGE_PREFIX__numbersmallenvironments
\if__PACKAGE_PREFIX__numbersmallenvironmentswiththeorem
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling = __PACKAGE_PREFIX__smalldummy]{#4}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showstars *\else\fi, sibling=__PACKAGE_PREFIX__smalldummy]{#4*}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showdaggers $^{\dagger}$\else\fi, sibling=__PACKAGE_PREFIX__smalldummy]{d#4}
\else
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling=__PACKAGE_PREFIX__dummy]{#4}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showstars *\else\fi, sibling=__PACKAGE_PREFIX__dummy]{#4*}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showdaggers $^{\dagger}$\else\fi, sibling=__PACKAGE_PREFIX__dummy]{d#4}
\fi
\else
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, numbered = no]{#4}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showstars *\else\fi, numbered = no]{#4*}
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\if__PACKAGE_PREFIX__showdaggers $^{\dagger}$\else\fi, numbered = no]{d#4}
\fi
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling=__PACKAGE_PREFIX__dummy]{n#4}
\if__PACKAGE_PREFIX__includestars\else\renewenvironment{#4*}{\comment}{\endcomment}\fi
}
%%%% If requested, now define some default theoremstyles
\if__PACKAGE_PREFIX__defaulttheorems
\RequirePackage[default styles]{mkessler-thmstyle} % Easy setup of mdframed styles
\declarebigtheorem[Satz][Theorem]{thmredmarginandfill}{theorem} \if__PACKAGE_PREFIX__english\else\AtBeginDocument{\def\theoremautorefname{Satz}}\fi
\declarebigtheorem{thmredmarginandfill}{proposition}
\declarebigtheorem[Korollar]{thmredmarginandfill}{corollary}
\declarebigtheorem{thmorangemarginandfill}{lemma}
\declarebigtheorem[Lemma und Definition][Lemma and Definition]{thmorangemarginbluefill}{lemmadef}
\declarebigtheorem{thmbluemarginandfill}{definition}
\declarebigtheorem[Satz und Definition][Theorem and Definition]{thmredmarginbluefill}{theoremdef}
\declarebigtheorem[Proposition und Definition][Proposition and Definition]{thmredmarginbluefill}{propositiondef}
\declarebigtheorem{thmvioletmarginandfill}{notation}
\declarebigtheorem[zuSatz][Addition to Theorem]{thmredmarginandfill}{additiontheorem}
%%%Environments that are not numbered by default (notation, question, example, remark etc) have two forms:
% - normal form: won't be numbered unless '__PACKAGE_PREFIX__numbersmallenvironments' is set
% - having an asterisk: will be displayed with an asterisk, will be numbered if 'numbersmallenvironments' is set
%Notation
\declaresmalltheorem[Notationsmissbrauch][Abuse of Notation]{thmvioletmargin}{abuse}
\declaresmalltheorem[Beispiel]{thmgreenmargin}{example}
\declaresmalltheorem[Bemerkung]{thmyellowmargin}{remark}
\declaresmalltheorem[Lob]{thmgoldmargin}{praise}
\declaresmalltheorem[Trivial Nonsense][Trivial Nonsense]{thmyellowmargin}{trivial}
\declaresmalltheorem[Frage]{thmblackmarginandfill}{question}
\declaresmalltheorem[Organisatorisches][Organisational stuff]{thmblackmargin}{orga}
\declaresmalltheorem[Fakt]{thmredmargin}{fact}
%%%% Specially treated stuff
\declaresmalltheorem[\if__PACKAGE_PREFIX__markoral Mündliche Anmerkung\else Bemerkung\fi][\if__PACKAGE_PREFIX__markoral Oral remark\else remark\fi]{thmyellowmargin}{oral}
% Option to remove oral remarks when needed
\if__PACKAGE_PREFIX__includeoral\else
\renewenvironment{oral}{\comment}{\endcomment}
\renewenvironment{oral*}{\comment}{\endcomment}
\renewenvironment{doral}{\comment}{\endcomment}
\fi
%%%%%%%% Other mdframed style boxes
\newtcolorbox{recap}{before skip = 0.5cm, after skip = 0.5cm, enhanced, sharp corners = all, colback = white, colframe = gray, toprule=0pt, bottomrule=0pt, leftrule=0pt,rightrule=0pt, overlay = {
\draw[gray, line width = 2pt] (frame.north west) -- ++(0.5cm, 0pt);
\draw[gray, line width=2pt] (frame.south east) -- ++(-0.5cm, 0pt);
\draw[gray, line width=2pt] (frame.north west) -- ++ (0pt, -0.5cm);
\draw[gray, line width=2pt] (frame.south east) -- ++(0pt, 0.5cm);
}}
\newenvironment{moral}{%
\begin{mdframed}[linecolor=green!70!black]%
\bfseries\color{green!50!black}}%
{\end{mdframed}}
\newenvironment{antimoral}{%
\begin{mdframed}[linecolor=red!70!black]%
\bfseries\color{red!50!black}}%
{\end{mdframed}}
%%%%%%%%%%%% Non-mdframed theorems
\theoremstyle{plain}
\newtheorem{variant}{\if__PACKAGE_PREFIX__english Variant\else Variante\fi}
\newtheorem{assumption}{\if__PACKAGE_PREFIX__english Assumption\else Annahme\fi}
\theoremstyle{definition}
\newtheorem*{note}{\if__PACKAGE_PREFIX__english Note\else Anmerkung\fi}
\newtheorem*{warning}{\color{red}\if__PACKAGE_PREFIX__english Warning \else Warnung\fi}
\newtheorem*{goal}{\if__PACKAGE_PREFIX__english Goal \else Ziel\fi}
\newtheorem*{strategy}{\if__PACKAGE_PREFIX__english Proof Strategy \else Beweisstrategie\fi}
\newtheorem*{goal*}{\if__PACKAGE_PREFIX__english Goal* \else Ziel*\fi}
\newtheorem*{problem}{Problem}
\newtheorem*{info}{Information}
\newtheorem*{answer}{\if__PACKAGE_PREFIX__english Answer\else Antwort\fi}
\newtheorem{observe}[theorem]{\if__PACKAGE_PREFIX__english Observe\else Beobachte\fi}
\newtheorem*{property}{\if__PACKAGE_PREFIX__english Property\else Eigenschaft\fi}
\newtheorem*{intuition}{Intuition}
\newtheorem*{recall}{\if__PACKAGE_PREFIX__english Recall\else Erinnerung\fi}
\newtheorem*{idea}{\if__PACKAGE_PREFIX__english Idea\else Idee\fi}
\newtheorem{exercise}{\if__PACKAGE_PREFIX__english Exercise\else Aufgabe\fi}[section]
\newtheorem{reminder}{\if__PACKAGE_PREFIX__english Reminder\else Erinnerung\fi}
\fi % end of default theorems

View file

@ -1,7 +0,0 @@
@default_files = ("fancythm.dtx");
$makeindex = "makeindex -s gind.ist %O -o %D %S";
$clean_ext .= ' glo';
$clean_ext .= ' hd';
$clean_ext .= ' ins';
$clean_full_ext .= ' sty';
$emulate_aux = 1;

View file

@ -1,922 +0,0 @@
% \iffalse meta-comment
%<*internal>
\begingroup
\input docstrip.tex
\keepsilent
\usedir{tex/latex/mkessler/fancythm}
\askforoverwritefalse
\generate{\file{fancythm.sty}{\from{fancythm.dtx}{package}}}
\def\tmpa{plain}
\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
\endgroup
%</internal>
%% File: fancytm.dtx
%
% Copyright (C) 2022 Maximilian Keßler
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
%
% https://www.latex-project.org/lppl.txt
%
% -----------------------------------------------------------------------
%<package>\ProvidesExplPackage{fancythm}{2022/01/30}{0.0.2}{Grouped theorems.}
%
%<*driver>
\documentclass[full,kernel]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{^^A
% The \pkg{fancythm} package^^A
% }
%
% \author{^^A
% Maximilian Keßler
% }
%
% \date{Released 2022-01-12}
%
% \maketitle
%
% \begin{documentation}
% \end{documentation}
%
%
% \begin{implementation}
%
% \section{\pkg{fancythm} implementation}
%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
% \begin{macrocode}
%<@@=fancythm>
% \end{macrocode}
%
%
% \subsection{Dependencies}
% \begin{macrocode}
\RequirePackage{l3keys2e}
\RequirePackage[default styles]{thmstyle}
% \end{macrocode}
%
% \subsection{Counter management}
%
%
% Wrappers for \LaTeX2e counter manipulation
%
%
% \begin{macro}{\arabic:n, \counter_new:n, \counter_within:nn,\counter_new:nn}
%
% Obvious meanings.
%
% \begin{macrocode}
\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 }
}
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macro}
% {
% \counter_if_exist_p:n,
% \counter_if_exist:nT,
% \counter_if_exist:F,
% \counter_if_exist:nTF,
% }
%
%
%
% \begin{macrocode}
\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 }
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\counter_undefined_error:n}
%
% Standard counter error message.
%
% \begin{macrocode}
\cs_set_eq:Nc \counter_undefined_error:n { @nocounterr }
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macro}{\counter_ensure_exist:n}
%
%
%
% \begin{macrocode}
\cs_new:Npn \counter_ensure_exist:n #1
{
\counter_if_exist:nF { #1 }
{
\counter_undefined_error:n { #1 }
}
}
% \end{macrocode}
% \end{macro}
%
%
%
%
%
% \begin{macro}{\counter_the:n, \counter_set_the:nn}
%
%
% \begin{macrocode}
\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 }
}
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macro}{\counter_sub:nn}
% \begin{syntax}
% \cs{counter_sub:nn}\marg{counter_1}\marg{counter_2}
% \end{syntax}
%
%
%
% \begin{macrocode}
\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 }
}
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\counter_new_sub:nn #1 #2}
%
%
%
% \begin{macrocode}
\cs_new:Npn \counter_new_sub:nn #1 #2
{
\counter_new:n { #1 }
\counter_sub:nn { #1 } { #2 }
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Counter management}
%
%
%
% \begin{macro}{\@@_counter_sub_if_exist:n}
%
%
%
% \begin{macrocode}
\cs_new:Npn \@@_counter_sub_if_exist:n #1
{
\counter_if_exist:nT { #1 }
{
\counter_new_sub:nn { in #1 } { #1 }
}
}
% \end{macrocode}
% \end{macro}
%
%
%
%
%
%
% \begin{macro}{\counter_alias:nn, \counter_alias:nx}
% \begin{syntax}
% \cs{counter_alias:nn}\marg{counter_1}\marg{counter_2}
% \end{syntax}
%
% Note that since 2022-06-02, the implementation of \cs{@counteralias}
% in \pkg{thmtools} has changed.
% Before, aliasing an already existing counter did not throw an error,
% which is considered a bug now
% (\href{https://github.com/muzimuzhi/thmtools/issues/28}{https://github.com/muzimuzhi/thmtools/issues/28}).
% Since \pkg{!!} relies on the old functionality,
% we adapt this here by undefining \cs{c@\meta{countername}} before calling
% \cs{@counteralias}.
%
% \begin{macrocode}
\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 }
% \end{macrocode}
% \end{macro}
%
%
%
%
%
%
% \subsection{Initialization}
%
%
%
% \begin{variable}{indocument, insection, insubsection, inchapter, inpart}
%
%
%
% \begin{macrocode}
\counter_new:n { indocument }
\@@_counter_sub_if_exist:n { section }
\@@_counter_sub_if_exist:n { subsection }
\@@_counter_sub_if_exist:n { chapter }
\@@_counter_sub_if_exist:n { part }
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{toplevel, sublevel, subsublevel, subsubsublevel}
%
% Note that the \texttt{toplevel} counter will be potentially redefined
% by the given package options.
%
% \begin{macrocode}
\counter_alias:nn { toplevel } { indocument }
\counter_new_sub:nn { sublevel } { toplevel }
\counter_new_sub:nn { subsublevel } { sublevel }
\counter_new_sub:nn { subsubsublevel } { subsublevel }
% \end{macrocode}
% \end{variable}
%
%
% \begin{variable}{\g_@@_style_str}
%
% This will hold the style information of the package.
%
% \begin{macrocode}
\str_new:N \g_@@_style_str
% \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_translator_bool}
%
%
%
% \begin{macrocode}
\bool_new:N \g_@@_translator_bool
% \end{macrocode}
% \end{variable}
%
%
% \begin{variable}{\g_@@_generate_defaults_bool}
%
%
%
% \begin{macrocode}
\bool_new:N \g_@@_generate_defaults_bool
% \end{macrocode}
% \end{variable}
%
%
%
%
% \begin{variable}
% {
% \l_@@_key_name_tl,
% \l_@@_key_mdframed_tl,
% \l_@@_key_style_tl,
% \l_@@_key_group_clist,
% \l_@@_key_thmtools_clist,
% }
%
%
% \begin{macrocode}
\tl_new:N \l_@@_key_name_tl
\tl_new:N \l_@@_key_mdframed_tl
\tl_new:N \l_@@_key_style_tl
\clist_new:N \l_@@_key_group_clist
\clist_new:N \l_@@_key_thmtools_clist
% \end{macrocode}
% \end{variable}
%
%
%
% \begin{variable}
% {
% \l_@@_name_tl,
% \l_@@_thmtools_clist,
% \l_@@_group_clist,
% }
%
%
% \begin{macrocode}
\tl_new:N \l_@@_name_tl
\clist_new:N \l_@@_thmtools_clist
\clist_new:N \l_@@_group_clist
% \end{macrocode}
% \end{variable}
%
%
%
% \begin{variable}{\g_@@_groupthm_option_clist}
%
%
%
% \begin{macrocode}
\clist_new:N \g_@@_groupthm_option_clist
% \end{macrocode}
% \end{variable}
%
%
%
%
%
%
% \subsection{Key interface}
%
% \begin{texnote}
% Note that unfortunately, none of the keynames really containes a space.
% \LaTeX2e strips spaces before loading a package, so introducing them here
% would make them inaccessible.
% Here they are ignored by \LaTeX3 and are present for readability.
% \end{texnote}
%
%
% \begin{macrocode}
\keys_define:nn { fancythm }
{
translator .bool_set:N = \g_@@_translator_bool ,
translator .default:n = { true } ,
generate defaults .bool_set:N = \g_@@_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_@@_style_str { \tl_use:N \l_keys_choice_tl }
} ,
style .default:n = { fancy } ,
cache .code:n =
{
\clist_put_right:Nn \g_@@_groupthm_option_clist { cache = #1 }
} ,
cache .default:n = { true } ,
cache version .code:n =
{
\clist_put_right:Nn \g_@@_groupthm_option_clist { cache version = #1 }
} ,
cache version .default:n = { 0 } ,
}
% \end{macrocode}
%
%
%
%
% \begin{macrocode}
\keys_define:nn { fancythm / fancytheorem }
{
name .tl_set:N = \l_@@_key_name_tl ,
name .default:n = \c_novalue_tl ,
mdframed .tl_set:N = \l_@@_key_mdframed_tl ,
mdframed .default:n = \c_novalue_tl ,
style .tl_set:N = \l_@@_key_style_tl ,
style .default:n = \c_novalue_tl ,
group .clist_set:N = \l_@@_key_group_clist ,
group .default:n = {} ,
thmtools .clist_set:N = \l_@@_key_thmtools_clist ,
thmtools .default:n = {} ,
}
% \end{macrocode}
%
%
% Process the given keys:
%
% \begin{macrocode}
\keys_set:nn { fancythm } { translator, generate defaults, number in, style }
\ProcessKeysOptions{ fancythm }
% \end{macrocode}
%
% \begin{macro}{\@@_require_package:nn}
%
%
% \begin{macrocode}
\cs_new:Npn \@@_require_package:nn #1
{
\RequirePackage [ #1 ]
}
\cs_generate_variant:Nn \@@_require_package:nn { V n }
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macrocode}
\@@_require_package:Vn \g_@@_groupthm_option_clist { groupthm }
% \end{macrocode}
%
%
%
% This sets up translation if requested.
% Throughout implementation, we can just use \cs{@@_translate:n}
% and will (or not) have translation according to the specified options.
%
% \begin{macrocode}
\bool_if:NTF \g_@@_translator_bool
{
\RequirePackage{translator}
\usedictionary{translator-environment-names}
\cs_set_eq:NN \@@_translate:n \translate
}
{
\cs_set_eq:NN \@@_translate:n \use:n
}
% \end{macrocode}
%
%
%
%
% \begin{macro}{\@@_set_normalized_keys:nn}
%
% \begin{syntax}
% \cs{@@_set_normalized_keys:nn}\marg{keys}\marg{fallback name}
% \end{syntax}
%
%
% \begin{macrocode}
\cs_new:Npn \@@_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_@@_group_clist \l_@@_key_group_clist
\clist_set_eq:NN \l_@@_thmtools_clist \l_@@_key_thmtools_clist
\tl_if_eq:NnF \l_@@_key_mdframed_tl { \c_novalue_tl }
{
\clist_put_right:Nx \l_@@_thmtools_clist
{
mdframed = { style = \tl_use:N \l_@@_key_mdframed_tl }
}
}
\tl_if_eq:NnF \l_@@_key_style_tl { \c_novalue_tl }
{
\clist_put_right:Nx \l_@@_thmtools_clist
{
style = \tl_use:N \l_@@_key_style_tl
}
}
\tl_if_eq:NnTF \l_@@_key_name_tl { \c_novalue_tl }
{
\tl_set:Nx \l_@@_name_tl
{
\text_titlecase_first:n { \tl_trim_spaces:n { #2 } }
}
}
{
\tl_set_eq:NN \l_@@_name_tl \l_@@_key_name_tl
}
\tl_set:Nx \l_@@_name_tl
{
\exp_not:N \csname @@_translate:n \exp_not:N \endcsname { \tl_use:N \l_@@_name_tl }
}
}
% \end{macrocode}
% \end{macro}
%
%
%
%
%
% \subsection{Fancy theorems}
%
%
%
% \begin{macro}{\@@_wrap_multiple:nnn}
% \begin{syntax}
% \cs{@@_wrap_multiple:nnn}\marg{declarator list}\marg{function name}\marg{code}
% \end{syntax}
%
% Defines \meta{function name}, which is assumed to contain \cs{declarator}
% by \meta{code} for each declarator in \meta{declarator list}.
%
% \begin{macrocode}
\cs_new:Npn \@@_wrap_multiple:nnn #1 #2 #3
{
\cs_set:Npn \@@_map_aux:n ##1
{
\cs_new:cn { #2 }
{
#3
}
}
\clist_map_function:nN { #1 } \@@_map_aux:n
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\fancythm_new_theorem:nnnn, \fancythm_provide_theorem:nnnn}
% \begin{syntax}
% \cs{fancythm_new_theorem:nnnn}\marg{fancy theorem}\marg{groups}
% \marg{name}\marg{thmtools keys}
% \end{syntax}
%
%
%
% \begin{macrocode}
\@@_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 }
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\fancythm_new_theorem:nn}
% \begin{syntax}
% \cs{fanythm_new_theorem:nn}\marg{key=value list}\marg{fancy theorem}
% \end{syntax}
%
%
%
% \begin{macrocode}
\@@_wrap_multiple:nnn
{ new, provide }
{ fancythm_#1_theorem:nn }
{
\@@_set_normalized_keys:nn { ##1 } { ##2 }
\use:c { fancythm_#1_theorem:nVVV }
{ ##2 }
\l_@@_group_clist
\l_@@_name_tl
\l_@@_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_new_document_command:Nnn, \@@_new_document_command:cnn}
%
% Private wrappers around \cs{NewDocumentCommand}.
%
% \begin{macrocode}
\cs_new:Npn \@@_new_document_command:Nnn #1 #2 #3
{
\NewDocumentCommand { #1 } { #2 } { #3 }
}
\cs_generate_variant:Nn \@@_new_document_command:Nnn { c n n }
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\@@_wrap_multiple_document:nnnn}
% \begin{syntax}
% \cs{@@_wrap_multiple_document:nnnn}\marg{declarator list}\marg{function name}\marg{arg spec}\marg{code}
% \end{syntax}
%
% This is very similar to \cs{@@_wrap_multiple:nnn}, except that it produces document commands.
% For this reason, \cs{declarator} and \cs{Declarator} are available to refer to the lower
% and upper-case versions of the current declarator.
%
% \begin{macrocode}
\cs_new:Npn \@@_wrap_multiple_document:nnnn #1 #2 #3 #4
{
\cs_set:Npn \@@_map_aux:n ##1
{
\cs_set:Nn \@@_Declarator: { \text_titlecase_first:n { ##1 } }
\@@_new_document_command:cnn { #2 } { #3 } { #4 }
}
\clist_map_function:nN { #1 } \@@_map_aux:n
}
% \end{macrocode}
% \end{macro}
%
%
%
%
%
%
% \begin{macro}{\NewFancyTheorem, \ProvideFancyTheorem}
% \begin{syntax}
% \cs{NewFancyTheorem}\marg{key=value list}\marg{fancy theorem}
% \end{syntax}
%
%
%
% \begin{macrocode}
\@@_wrap_multiple_document:nnnn
{ new, provide }
{ \@@_Declarator: FancyTheorem }
{ O{} m }
{
\use:c { fancythm_#1_theorem:nn } { ##1 } { ##2 }
}
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Provided resources}
%
%
%
%
% We introduce various new 0theorem groups that help us to organize the document
% in a flexible way.
%
% \begin{variable}{star, dagger, big, small, tiny, custom}
%
%
% \begin{macrocode}
\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 }
% \end{macrocode}
% \end{variable}
%
%
% \begin{macrocode}
\groupthm_add_parent:nn { star } { custom }
\groupthm_add_parent:nn { dagger } { custom }
% \end{macrocode}
% \begin{macrocode}
\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 }
% \end{macrocode}
%
%
% It remains to provide a list of theorems at the beginning of the document.
%
%
% \begin{macro}{\fancythm_add_provided_theorem_to_group:nn}
%
% \begin{macrocode}
\cs_new:Npn \fancythm_add_provided_theorem_to_group:nn #1 #2
{
\cs_if_exist:cF { @@_provided_theorem__#1__group_clist }
{
\clist_new:c { @@_provided_theorem__#1__group_clist }
}
\clist_put_left:cn { @@_provided_theorem__#1__group_clist } { #2 }
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\AddProvidedFancyTheoremToGroup}
%
%
%
% \begin{macrocode}
\NewDocumentCommand { \AddProvidedFancyTheoremToGroup } { m m }
{
\fancythm_add_provided_theorem_to_group:nn { #1 } { #2 }
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\@@_provide_package_theorem:nnn}
% \begin{syntax}
% \cs{@@_provide_package_theorem:nnn}\marg{key=value list}\marg{fancy theorem}
% \marg{group}
% \end{syntax}
%
% Group can be one of \texttt{big}, \texttt{small}, \texttt{tiny},
% and the provided theorem will have this group, unless it conflicts
% with a user-provided group, in which case this is ignored.
%
%
% \begin{macrocode}
\cs_new:Npn \@@_provide_package_theorem:nnn #1 #2 #3
{
\@@_set_normalized_keys:nn { #1 } { #2 }
\cs_if_exist:cT { @@_provided_theorem__#2__group_clist }
{
\clist_concat:ccc
{ l_@@_group_clist }
{ @@_provided_theorem__#2__group_clist }
{ l_@@_group_clist }
}
\clist_if_in:NnF \l_@@_group_clist { big }
{
\clist_if_in:NnF \l_@@_group_clist { small }
{
\clist_if_in:NnF \l_@@_group_clist { tiny }
{
\clist_put_right:Nn \l_@@_group_clist { #3 }
}
}
}
\fancythm_provide_theorem:nVVV
{ #2 }
\l_@@_group_clist
\l_@@_name_tl
\l_@@_thmtools_clist
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\fancythm_provide_big_theorem:nn}
% \begin{macrocode}
\cs_new:Npn \fancythm_provide_big_theorem:nn #1 #2
{
\@@_provide_package_theorem:nnn { #1 } { #2 } { big }
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\fancythm_provide_small_theorem:nn}
% \begin{macrocode}
\cs_new:Npn \fancythm_provide_small_theorem:nn #1 #2
{
\@@_provide_package_theorem:nnn { #1 } { #2 } { small }
}
% \end{macrocode}
% \end{macro}
%
%
%
% \begin{macro}{\fancythm_provide_tiny_theorem:nn}
% \begin{macrocode}
\cs_new:Npn \fancythm_provide_tiny_theorem:nn #1 #2
{
\@@_provide_package_theorem:nnn { #1 } { #2 } { tiny }
}
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macrocode}
\bool_if:NT \g_@@_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 }
% \end{macrocode}
% \begin{macrocode}
\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 }
% \end{macrocode}
% \begin{macrocode}
\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 }
% \end{macrocode}
%
%
%
% \begin{macrocode}
%</package>
% \end{macrocode}
%
% \end{implementation}
%
%
%
% \newpage
% \PrintIndex

View file

@ -1,6 +0,0 @@
@default_files = ("groupthm.dtx");
$makeindex = "makeindex -s gind.ist %O -o %D %S";
$clean_ext .= ' glo';
$clean_ext .= ' hd';
$clean_full_ext .= ' sty';
$emulate_aux = 1;

File diff suppressed because it is too large Load diff

View file

@ -1,25 +0,0 @@
key,English,German
Claim,Claim,Behauptung
claim,claim,Behauptung
Claim*,Claim*,Behauptung*
claim*,claim*,Behauptung*
Proof,Proof,Beweis
proof,proof,Beweis
Proof*,Proof*,Beweis*
proof*,proof*,Beweis*
Proof of,Proof of,Beweis von
proof of,proof of,Beweis von
Proof* of,Proof* of,Beweis* von
proof* of,proof* of,Beweis* von
Continuation of proof,Continuation of proof,Fortsetzung des Beweises
continuation of proof,continuation of proof,Fortsetzung des Beweises
Continuation of proof of,Continuation of proof of,Fortsetzung des Beweises zu
continuation of proof of,continuation of proof of,Fortsetzung des Beweises zu
Continuation of proof*,Continuation of proof*,Fortsetzung des Beweises*
continuation of proof*,continuation of proof*,Fortsetzung des Beweises*
Continuation of proof* of,Continuation of proof* of,Fortsetzung des Beweises* zu
continuation of proof* of,continuation of proof* of,Fortsetzung des Beweises* zu
Subproof,Subproof,Unterbeweis
subproof,subproof,Unterbeweis
Subproof*,Subproof*,Unterbeweis*
subproof*,subproof*,Unterbeweis*

View file

@ -1,240 +0,0 @@
__HEADER__(Automatic references to theorems in proofs. Claim counters within proofs)
\ExplSyntaxOn
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{xparse}
\RequirePackage{refcount}
\RequirePackage{translator}
\RequirePackage{mkessler-subproof} % TODO: let PyTeX format the mkessler- prefix
%%%% Hook management
\cs_new:Npn__PACKAGE_MACRO__(autoref:n)
{
\ref
}
\AddToHook{package/hyperref/after}
{
\cs_set:Npn__PACKAGE_MACRO__(autoref:n)
{
\autoref
}
}
%%% Saving old definitions
\cs_new_eq:NN __PACKAGE_MACRO__(saved_proof:w) \proof
\cs_new_eq:NN __PACKAGE_MACRO__(saved_endproof:) \endproof
\cs_new_eq:NN __PACKAGE_MACRO__(saved_subproof:n) \rawsubproof
\cs_new_eq:NN __PACKAGE_MACRO__(saved_endsubproof:) \rawendsubproof
%%% Internal variables
\int_new:N __PACKAGE_MACRO__(proofdepth_int)
\seq_new:N __PACKAGE_MACRO__(nested_claim_counter_values_seq)
\prop_new:N __PACKAGE_MACRO__(refproof_claim_counters_prop)
\cs_generate_variant:Nn \seq_push:Nn { N x }
%%% Language translations
\usedictionary{translator-proof-dictionary}
%%%Now, we internally got a proof and a subproof environment
%%%Make them available as 'old' variants, with their defautl behaviour
\NewDocumentEnvironment{oldproof} { }
{
__PACKAGE_MACRO__(saved_proof:w)
}
{
__PACKAGE_MACRO__(saved_endproof:)
}
\NewDocumentEnvironment{oldsubproof} { o }
{
\IfValueTF { #1 }
{
__PACKAGE_MACRO__(saved_subproof:n) { #1 }
}
{
__PACKAGE_MACRO__(saved_subproof:n) { \translate { Subproof } }
}
}
{
__PACKAGE_MACRO__(saved_endsubproof:)
}
%%% Main implementation
%Introduce claim environment
\newtheorem{claim}{\translate{Claim}}
\newtheorem*{claim*}{\translate{Claim}}
\AtBeginDocument{\def\claimautorefname{\translate{Claim}}}
\cs_new:Nn __PACKAGE_MACRO__(enter_proof:)
{
\int_gincr:N __PACKAGE_MACRO__(proofdepth_int)
\seq_gpush:Nx __PACKAGE_MACRO__(nested_claim_counter_values_seq)
{
\arabic { claim }
}
\group_begin:
}
\cs_new:Nn __PACKAGE_MACRO__(leave_proof:)
{
\group_end:
\seq_gpop:NN __PACKAGE_MACRO__(nested_claim_counter_values_seq) \l_tmpa_tl
\setcounter { claim } { \tl_use:N \l_tmpa_tl }
\int_gdecr:N __PACKAGE_MACRO__(proofdepth_int)
}
% Usage:
% #1 = \BooleanTrue or \BooleanFalse indicating presence of star
% #2 = star version of translation
% #3 = nonstar version of translation
\cs_new:Nn __PACKAGE_MACRO__(set_proof_prefix:nnn)
{
\IfBooleanTF { #1 }
{
\cs_set:Nn __PACKAGE_MACRO__(proof_prefix:)
{
\translate { #2 }
}
}
{
\cs_set:Nn __PACKAGE_MACRO__(proof_prefix:)
{
\translate { #3 }
}
}
}
\cs_new:Nn __PACKAGE_MACRO__(proof_comment:n)
{
\IfValueT { #1 }
{
\c_space_tl ( #1 )
}
}
\NewDocumentEnvironment{refproof}{s m !o}
{
__PACKAGE_MACRO__(enter_proof:)
\prop_get:NnN
__PACKAGE_MACRO__(refproof_claim_counters_prop)
{ #2 }
\l_tmpa_tl
\quark_if_no_value:NTF \l_tmpa_tl
{
\setcounter { claim } { 0 }
__PACKAGE_MACRO__(set_proof_prefix:nnn) { #1 }
{ Proof* ~ of }
{ Proof ~ of }
}
{
\setcounter { claim } { \tl_use:N \l_tmpa_tl }
__PACKAGE_MACRO__(set_proof_prefix:nnn) { #1 }
{ Continuation ~ of ~ proof* ~ of }
{ Continuation ~ of ~ proof ~ of }
}
% Set up counter number printing as subindexed by numbering of the reference
\renewcommand \theclaim
{
\getrefnumber { #2 } . \arabic { claim }
}
__PACKAGE_MACRO__(saved_proof:w)
[
__PACKAGE_MACRO__(proof_prefix:)
\c_space_tl
__PACKAGE_MACRO__(autoref:n) { #2 }
__PACKAGE_MACRO__(proof_comment:n) { #3 }
]
}
{
__PACKAGE_MACRO__(saved_endproof:)
\prop_gput:Nnx __PACKAGE_MACRO__(refproof_claim_counters_prop)
{ #2 }
{
\value{claim}
}
__PACKAGE_MACRO__(leave_proof:)
}
%%% A 'smart' proof environment
\AtBeginDocument{
\RenewDocumentEnvironment{proof}{!s !o}
{
__PACKAGE_MACRO__(enter_proof:)
\setcounter{claim}{0}
\renewcommand \theclaim
{
\arabic { claim }
}
\int_compare:nNnTF __PACKAGE_MACRO__(proofdepth_int) > 1
{
__PACKAGE_MACRO__(set_proof_prefix:nnn) { #1 }
{ Subproof* }
{ Subproof }
__PACKAGE_MACRO__(saved_subproof:n)
{
__PACKAGE_MACRO__(proof_prefix:)
__PACKAGE_MACRO__(proof_comment:n) { #2 }
}
}
{
__PACKAGE_MACRO__(set_proof_prefix:nnn) { #1 }
{ Proof* }
{ Proof }
__PACKAGE_MACRO__(saved_proof:w)
[
__PACKAGE_MACRO__(proof_prefix:)
__PACKAGE_MACRO__(proof_comment:n) { #2 }
]
}
}
{
__PACKAGE_MACRO__(saved_endproof:)
__PACKAGE_MACRO__(leave_proof:)
}
}
\RenewDocumentEnvironment{subproof}{!s !o}
{
__PACKAGE_MACRO__(enter_proof:)
\setcounter { claim } { 0 }
\renewcommand \theclaim
{
\arabic { claim }
}
__PACKAGE_MACRO__(set_proof_prefix:nnn) { #1 }
{ Subproof* }
{ Subproof }
__PACKAGE_MACRO__(saved_subproof:n)
{
__PACKAGE_MACRO__(proof_prefix:)
__PACKAGE_MACRO__(proof_comment:n) { #2 }
}
}
{
__PACKAGE_MACRO__(saved_endsubproof:)
__PACKAGE_MACRO__(leave_proof:)
}
\DeclareDocumentCommand { \proofdepth } { }
{
\int_to_arabic:n __PACKAGE_MACRO__(proofdepth_int)
}

View file

@ -0,0 +1,92 @@
__HEADER__(Mdframed Styles used for fancythm package)
%%%%% This provides easy-to-use styles, especially for use with the
\RequirePackage{xkeyval}
% A simple option wether to define some default styles
__NEW_IF__(defaultstyles,false)
\DeclareOptionX{defaultstyles}{__SET_IF__(defaultstyles,true)}
__END_OPTIONS_X__
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage{mdframed}
\RequirePackage{xcolor}
\RequirePackage{xparse}
\definecolor{gold}{RGB}{218,165,32}
\mdfsetup{skipabove=8pt,skipbelow=\topskip}
\NewDocumentCommand{\declarefancymdfstyle}{O{} m O{} }{
\if\relax\detokenize{#1}\relax
\mdfdefinestyle{\if\relax\detokenize{#3}\relax md#2margin\else #3\fi}{%
linecolor=#2,
linewidth = 2pt,
leftmargin = 0cm,
rightmargin=0cm,
rightline=false,
topline=false,
bottomline=false
}
\else
\mdfdefinestyle{\if\relax\detokenize{#3}\relax md#2marginand#1fill\else #3\fi}{%
linecolor=#2,
linewidth = 2pt,
leftmargin = 0cm,
rightmargin=0cm,
backgroundcolor=#1,
rightline=false,
topline=false,
bottomline=false
}
\fi
}
\NewDocumentCommand{\declarefancythmstyle}{O{} m O{} }{
\declarefancymdfstyle[#1]{#2}
\if\relax\detokenize{#3}\relax
\if\relax\detokenize{#1}\relax
\declaretheoremstyle[
mdframed={style=
\if\relax\detokenize{#1}\relax md#2margin\else md#2marginand#1fill\fi
},
postheadspace={0.3em},
notefont=\mdseries
]{thm#2margin}
\else
\declaretheoremstyle[
mdframed={style=
\if\relax\detokenize{#1}\relax md#2margin\else md#2marginand#1fill\fi
},
postheadspace={0.3em},
notefont=\mdseries
]{thm#2marginand#1fill}
\fi
\else
\declaretheoremstyle[
mdframed={style=
\if\relax\detokenize{#1}\relax md#2margin\else md#2marginand#1fill\fi
},
postheadspace={0.3em},
notefont=\mdseries
]{#3}
\fi
}
__IF__(defaultstyles)
\declarefancythmstyle[red!8]{red}[thmredmarginandfill]
\declarefancythmstyle[orange!10]{orange}[thmorangemarginandfill]
\declarefancythmstyle[blue!7]{blue}[thmbluemarginandfill]
\declarefancythmstyle{green!70!black}[thmgreenmargin]
\declarefancythmstyle{gold}[thmgoldmargin]
\declarefancythmstyle{yellow!80!orange}[thmyellowmargin]
\declarefancythmstyle{gray}[thmgraymargin]
\declarefancythmstyle[violet!7]{violet}[thmvioletmarginandfill]
\declarefancythmstyle{violet}[thmvioletmargin]
\declarefancythmstyle[blue!7]{red}[thmredmarginbluefill]
\declarefancythmstyle{red}[thmredmargin]
\declarefancythmstyle[blue!7]{orange}[thmorangemarginbluefill]
\declarefancythmstyle[violet!20!gray!20]{black}[thmblackmarginandfill]
\declarefancythmstyle{black}[thmblackmargin]
\fi

View file

@ -1,6 +0,0 @@
@default_files = ("thmstyle.dtx");
$makeindex = "makeindex -s gind.ist %O -o %D %S";
$clean_ext .= ' glo';
$clean_ext .= ' hd';
$clean_full_ext .= ' sty';
$emulate_aux = 1;

View file

@ -1,412 +0,0 @@
% \iffalse meta-comment
%<*internal>
\begingroup
\input docstrip.tex
\keepsilent
\usedir{tex/latex/mkessler/thmstyle}
\askforoverwritefalse
\generate{\file{thmstyle.sty}{\from{thmstyle.dtx}{package}}}
\def\tmpa{plain}
\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
\endgroup
%</internal>
%
%% File: thmstyle.dtx
%
% Copyright (C) 2022 Maximilian Keßler
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
%
% https://www.latex-project.org/lppl.txt
%
% -----------------------------------------------------------------------
%<package>\ProvidesExplPackage{thmstyle}{2022/01/17}{0.0.1}{Styles for thmtools theorems.}
%
%<*driver>
\documentclass[full,kernel]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{^^A
% The \pkg{thmstyle} package^^A
% }
%
% \author{^^A
% Maximilian Ke\ss ler
% }
%
% \date{Released 2022-01-12}
%
% \maketitle
%
% \begin{documentation}
%
% \begin{abstract}
% Just a convenience package that provides easy-to-use interface
% for creating \pkg{mdframed} and \pkg{thmtools} styles.
% Also provides some defaults.
% \end{abstract}
%
% \section{User macros}
%
% \begin{function}{\DeclareFancyMdfStyle}
% \begin{syntax}
% \cs{DeclareFancyMdfStyle}\oarg{background color}\marg{left margin color}\oarg{name}
% \end{syntax}
% Makes \meta{name} a \pkg{mdframed} style with given background and
% left margin color.
%
% If \meta{name} is not given, it is defaulted to
% \enquote{md\meta{left margin color}margin}
% or
% \enquote{md\meta{left margin color}and\meta{background color}fill}
% corresponding to whether the \meta{background color} has been given.
% \end{function}
%
% \begin{function}{\DeclareFancyThmStyle}
% \begin{syntax}
% \cs{DeclareFancyThmStyle}\oarg{background color}\marg{left margin color}\oarg{name}
% \end{syntax}
%
% Same as \cs{DeclareFancyMdfStyle}, but directly declares a
% style for \pkg{thmtools}.
% The naming behaves the same except \texttt{md} is replaced with \texttt{thm}
% \end{function}
%
% \section{Default styles}
%
%
% The package has the option to provide some default styles.
% These can be loaded with the |default styles| (the space is optional)
% option, when loading the package.
%
%
% \subsection{colors}
%
% \begin{variable}{gold}
%
% Golden color.
%
%
% \end{variable}
%
% We use the \pkg{xcolor package}.
%
% You can load this package with the \texttt{default styles} option.
% This will make the \pkg{thmtools} styles available given in
% \autoref{tab:default-styles}.
%
% \begin{table}[htpb]
% \centering
% \begin{tabular}{c | c | c}
% Name & Left margin color & Background color \\
% \hline
% thmredmarginandfill & red & red!8 \\
% thmorangemarginandfill & orange & orange!10 \\
% thmbluemarginandfill & blue & blue!7 \\
% thmgreenmargin & green!70!black & none \\
% thmgoldmargin & gold & none \\
% thmyellowmargin & yellow!80!orange & none \\
% thmgraymargin & gray & none \\
% thmvioletmarginandfill & violet & violet!7 \\
% thmvioletmargin & violet & none \\
% thmredmarginandbuliefill & red & blue!7 \\
% thmredmargin & red & none \\
% thmorangemarginbluefill & orange & blue!7 \\
% thmblackmargindandfill & black & violet!20!gray!20 \\
% thmblackmargin & black & none \\
% \end{tabular}
% \caption{Default styles provided by \pkg{thmstyle}}
% \label{tab:default-styles}
% \end{table}
%
% \end{documentation}
%
%
%
%
% \begin{implementation}
%
% \section{\pkg{thmstyle} implementation}
%
%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
% \begin{macrocode}
%<@@=thmstyle>
% \end{macrocode}
%
%
%
%
%
%
%
%
%
%
% \subsection{Dependencies}
%
%
%
% \begin{macrocode}
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage{mdframed}
\RequirePackage{xcolor}
\RequirePackage{l3keys2e}
% \end{macrocode}
%
%
% \subsection{Initialization}
% \begin{variable}{\g_@@_default_styles_bool}
%
% Indicates whether the package will provide default styles.
%
% \begin{macrocode}
\bool_new:N \g_@@_default_styles_bool
% \end{macrocode}
% \end{variable}
%
%
%
%
% \begin{variable}{gold}
% New color
% \begin{macrocode}
\definecolor{gold}{RGB}{218,165,32}
% \end{macrocode}
% \end{variable}
%
%
%
%
%
%
%
% \subsection{Package options}
%
%
%
% \begin{macrocode}
\keys_define:nn { thmstyle }
{
default styles .bool_set:N = \g_@@_default_styles_bool,
default styles .default:n = { true },
}
% \end{macrocode}
%
%
% \begin{macrocode}
\ProcessKeysOptions { thmstyle }
% \end{macrocode}
%
%
%
%
% \subsection{Private Wrappers}
%
%
% \begin{macro}{\@@_mdframed_define_style:nn, \@@_mdframed_define_style:nx}
% \begin{syntax}
% \cs{@@_mdframed_define_style:nn}\marg{key=value list}\marg{style}
% \end{syntax}
%
%
%
% \begin{macrocode}
\cs_new:Npn \@@_mdframed_define_style:nn #1 #2
{
\mdfdefinestyle{#2}{#1}
}
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\@@_thmtools_declare_style:nn, \@@_thmtools_declare_style:xx}
% \begin{syntax}
% \cs{@@_thmtools_declare_style:nn}\marg{key=value list}\marg{style}
% \end{syntax}
%
%
%
% \begin{macrocode}
\cs_new:Npn \@@_thmtools_declare_style:nn #1 #2
{
\declaretheoremstyle[#1]{#2}
}
\cs_generate_variant:Nn \@@_thmtools_declare_style:nn { x x }
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Generation of styles}
%
% \begin{macro}{\thmstyle_declare_mdf_style:nnn}
% \begin{syntax}
% \cs{thmstyle_declare_mdf_style:nnn}\marg{style}\marg{margin color}\marg{background color}
% \end{syntax}
%
%
% \begin{macrocode}
\cs_new:Npn \thmstyle_declare_mdf_style:nnn #1 #2 #3
{
\@@_mdframed_define_style:nn
{
linecolor = #2,
linewidth = 2pt,
leftmargin = 0pt,
rightmargin = 0pt,
rightline = false,
topline = false,
bottomline = false,
backgroundcolor = #3,
skipabove = 0.7\baselineskip,
skipbelow = 0pt,
innerrightmargin = 10pt,
innerbottommargin = 5pt
}
{
#1
}
}
\cs_generate_variant:Nn \thmstyle_declare_mdf_style:nnn { x n x }
% \end{macrocode}
% \end{macro}
%
%
%
%
% \begin{macro}{\DeclareFancyMdfStyle}
% \begin{syntax}
% \cs{DeclareFancyMdfStyle}\oarg{background color}\marg{line color}\oarg{style}
% \end{syntax}
%
%
%
% \begin{macrocode}
\NewDocumentCommand { \DeclareFancyMdfStyle } { o m o }
{
\thmstyle_declare_mdf_style:xnx
{
\IfValueTF { #3 }
{
#3
}
{
md #2 margin
\IfValueT { #1 }
{
and #1 fill
}
}
}
{
#2
}
{
\IfValueTF { #1 }
{
#1
}
{
white
}
}
}
% \end{macrocode}
% \end{macro}
%
%
%
%
%
%
%
%
%
% \begin{macro}{\DeclareFancyThmStyle}
% \begin{syntax}
% \cs{DeclareFancyThmStyle}\oarg{background color}\marg{line color}\oarg{style}
% \end{syntax}
%
%
%
% \begin{macrocode}
\NewDocumentCommand { \DeclareFancyThmStyle } { o m o }
{
\DeclareFancyMdfStyle [ #1 ] { #2 }
\@@_thmtools_declare_style:xx
{
mdframed =
{
style = md #2 margin \IfValueT { #1 } { and #1 fill }
},
postheadspace = { 0.3em },
notefont = \noexpand\mdseries,
}
{
\IfValueTF { #3 }
{ #3 }
{
thm #2 margin
\IfBooleanT { #1 }
{
and #1 fill
}
}
}
}
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Default styles}
%
%
% Here, we provide the default styles:
%
%
% \begin{macrocode}
\bool_if:NT \g_@@_default_styles_bool
{
\DeclareFancyThmStyle[red!8]{red}[thmredmarginandfill]
\DeclareFancyThmStyle[orange!10]{orange}[thmorangemarginandfill]
\DeclareFancyThmStyle[blue!7]{blue}[thmbluemarginandfill]
\DeclareFancyThmStyle{green!70!black}[thmgreenmargin]
\DeclareFancyThmStyle[green!10]{green!70!black}[thmgreenmarginandfill]
\DeclareFancyThmStyle{gold}[thmgoldmargin]
\DeclareFancyThmStyle{yellow!80!orange}[thmyellowmargin]
\DeclareFancyThmStyle{gray}[thmgraymargin]
\DeclareFancyThmStyle[violet!7]{violet}[thmvioletmarginandfill]
\DeclareFancyThmStyle{violet}[thmvioletmargin]
\DeclareFancyThmStyle[blue!7]{red}[thmredmarginbluefill]
\DeclareFancyThmStyle{red}[thmredmargin]
\DeclareFancyThmStyle[blue!7]{orange}[thmorangemarginbluefill]
\DeclareFancyThmStyle[violet!20!gray!20]{black}[thmblackmarginandfill]
\DeclareFancyThmStyle{black}[thmblackmargin]
}
% \end{macrocode}
%
%
%
%
%
% \begin{macrocode}
%</package>
% \end{macrocode}
%
% \end{implementation}
%
%
%
% \newpage
% \PrintIndex

View file

@ -1,103 +0,0 @@
__HEADER__(Declaring of math symbols with automatic indexing)
\@ifclassloaded{beamer}{}{
\RequirePackage{imakeidx}
}
\RequirePackage{xparse}
% Keys used for declaring symbols
\keys_define:nn { symbol }
{
operator .tl_set:N = \l_symbol_operator_tl,
operator .default:n = \use:n,
formula .tl_set:N = \l_symbol_formula_tl,
formula .default:n = \c_novalue_tl,
ordered .tl_set:N = \l_symbol_ordered_tl,
ordered .default:n = \c_novalue_tl,
description .tl_set:N = \l_symbol_description_tl,
description .default:n = \c_novalue_tl,
group .tl_set:N = \l_symbol_group_tl,
group .default:n = \c_novalue_tl,
defaultargs .tl_set:N = \l_symbol_defaultargs_tl,
defaultargs .default:n = \c_novalue_tl
}
% Core macro not to be used publicly directly. Usage:
% #1 = indexname / group
% #2 = symbolname,
% #3 = description
% #4 = operator to apply (one argument) - can be \use:n for identity
% #5 = substitution when called
% #6 = default appendices to macro in index (e.g. _R)
% #7 = ordering in index
\cs_new_protected:Nn\symbol_define:nnnnnnn
{
\bool_new:c { used_#2 }
\cs_new_protected:cn { symbol_#2: }
{
\bool_if:cF { used_#2 }
{
\@ifclassloaded{beamer}{}{
\index[#1]
{
#7
@
$#4{#5}#6$
#3
}
}
\bool_gset_true:c { used_#2 }
}
#4{#5}
}
\expandafter\protected\expandafter\gdef\csname#2\endcsname
{
\use:c { symbol_#2: }
}
}
\cs_generate_variant:Nn\symbol_define:nnnnnnn { V n V V V V V}
% Main package interface
\NewDocumentCommand{\DeclareSymbol}{ O{} m}
{
\keys_set:nn{ symbol }
{
operator,
formula,
ordered,
description,
group,
defaultargs
}
\keys_set:nn{ symbol }{#1}
\tl_if_eq:NnTF\l_symbol_description_tl{\c_novalue_tl}
{
\tl_set:Nn\l_symbol_description_tl { \c_empty_tl }
}
{
\tl_put_left:Nn\l_symbol_description_tl { ,\c_space_tl }
}
\tl_if_eq:NnT\l_symbol_formula_tl{\c_novalue_tl}
{
\tl_set:Nn\l_symbol_formula_tl {#2}
}
\tl_if_eq:NnT\l_symbol_ordered_tl{\c_novalue_tl}
{
\tl_set:Nn\l_symbol_ordered_tl {#2}
}
\tl_if_eq:NnT\l_symbol_defaultargs_tl{\c_novalue_tl}
{
\tl_clear:N\l_symbol_defaultargs_tl
}
\symbol_define:VnVVVVV
\l_symbol_group_tl
{
#2
}
\l_symbol_description_tl
\l_symbol_operator_tl
\l_symbol_formula_tl
\l_symbol_defaultargs_tl
\l_symbol_ordered_tl
}

View file

@ -1,21 +1,19 @@
__HEADER__(Write up lecture notes as script)
\RequirePackage{xkeyval}
__LANGUAGE_OPTIONS_X__
__LANGUAGE_OPTIONS__
__NEW_IF__(showversion,true)
\DeclareOptionX{show version}{__SET_IF__(showversion,true)}
\DeclareOptionX{hideversion}{__SET_IF__(showversion,false)}
\DeclareOption{show version}{__SET_IF__(showversion,true)}
\DeclareOption{hideversion}{__SET_IF__(showversion,false)}
__NEW_IF__(fancyfoot,false)
\DeclareOptionX{fancyfoot}{__SET_IF__(fancyfoot,true)}
\DeclareOption{fancyfoot}{__SET_IF__(fancyfoot,true)}
__NEW_IF__(gitversion,false)
\DeclareOptionX{git}{__SET_IF__(gitversion,true)}
\DeclareOption{git}{__SET_IF__(gitversion,true)}
__END_OPTIONS_X__
__END_OPTIONS__
\RequirePackage{xifthen}

View file

@ -1,171 +0,0 @@
__HEADER__(Definitions of categories with automatic indexing)%% Wrapper commands specific for defining categories
\RequirePackage{__AUTHOR_ACRONYM__-symbindex}
\RequirePackage{translator}
\RequirePackage{amsmath}
\usedictionary{translator-mathematical-categories-dictionary}
\NewDocumentCommand{\category}{ m }
{
\operatorname{\textup{\textbf{#1}}}
}
\NewDocumentCommand{\DeclareCategory}{ O{} m }
{
\DeclareSymbol[group = categories, #1]{#2}
}
\NewDocumentCommand{\DeclareSimpleCategory}{ o m o}
{
\IfValueTF{#1}
{
\IfValueTF{#3}
{
\DeclareCategory[operator = \category, description = #3, #1]{#2}
}
{
\DeclareCategory[operator = \category, #1]{#2}
}
}
{
\IfValueTF{#3}
{
\DeclareCategory[operator = \category, description = #3]{#2}
}
{
\DeclareCategory[operator = \category]{#2}
}
}
}
\NewDocumentCommand{\MakeCategoryIndex}{ }
{
\printindex[categories]
}
\makeindex
[
name = categories,
title = \translate{Index~of~categories}
]
%%%% Categories
\DeclareSimpleCategory
{ Top }
[
\translate{Top~(Category~description)}
]
\DeclareSimpleCategory
{ hTop }
[
\translate{hTop~(Category~description)}
]
\DeclareSimpleCategory
{ Set }
[
\translate{Set~(Category~description)}
]
\DeclareSimpleCategory
{ CHaus }
[
\translate{CHaus~(Category~description)}
]
\DeclareSimpleCategory
{ Grp }
[
\translate{Grp~(Category~description)}
]
\DeclareSimpleCategory
{ Ab }
[
\translate{Ab~(Category~description)}
]
\DeclareSimpleCategory
{ CRing }
[
\translate{CRing~(Category~description)}
]
\DeclareSimpleCategory
{ Ring }
[
\translate{Ring~(Category~description)}
]
\DeclareSimpleCategory
[
defaultargs = _k
]
{ Vect }
[
\translate{Vect~(Category~description)}
]
\DeclareSimpleCategory
{ Cat }
[
\translate{Cat~(Category~description)}
]
\DeclareSimpleCategory
[
defaultargs = _R
]
{ Mod }
[
\translate{Mod~(Category~description)}
]
\DeclareSimpleCategory
[
defaultargs = _k
]
{ Alg }
[
\translate{Alg~(Category~description)}
]
\DeclareSimpleCategory
{ Field }
[
\translate{Field~(Category~description)}
]
\DeclareSimpleCategory
[
defaultargs = _k
]
{ AffVar }
[
\translate{AffVar~(Category~description)}
]
\DeclareSimpleCategory
{ Sch }
[
\translate{Sch~(Category~description)}
]
\DeclareSimpleCategory
{ GrAb }
[
\translate{GrAb~(Category~description)}
]
\DeclareSimpleCategory
{ CGHaus }
[
\translate{CGHaus~(Category~description)}
]
\DeclareSimpleCategory
[
formula = S
]
{ SimplicialSet }
[
\translate{SimplicialSet~(Category~description)}
]
\DeclareCategory
[
operator = \operatorname,
formula = \Delta,
ordered = Ordinal,
description = \translate{Ordinal ~ number ~ category ~ (Category ~ description)}
]
{OrdCat}

View file

@ -1,21 +0,0 @@
key,English,German
Index of categories,Index of categories,Kategorienverzeichnis
Top (Category description), spaces and continuous maps, Räume und stetige Abbildungen
Set (Category description),Sets and functions,Mengen und Funktionen
hTop (Category description),Spaces and homotopy classes of continuous maps,Räume und Homotopieklassen von stetigen Abbildungen
CHaus (Category description),Compact hausdorff spaces and continuous maps,Kompakte Hausdorffräume und stetige Abbildungen
Grp (Category description),Groups and homomorphisms,Gruppen und Homomorphismen
Ab (Category description),Abelian groups and homomorphisms,Abelsche Gruppen und Homomoorphismen
CRing (Category description),Commutative rings and homomorphisms,Kommutative Ringe und Homomorphismen
Ring (Category description),Rings and homomorphisms,Ringe und Homomorphismen
Vect (Category description),$k$-vector spaces and linear maps,Vektorräume und lineare Abbildungen
Cat (Category description),Small categories and functors,Kleine Kategorien und Funktoren
Mod (Category description),Left $R$-modules and homomorphisms,$R$-Linksmodule und Homomorphismen
Alg (Category description),$k$-algebras and homomorphisms,$k$-Algebren und Homomorphismen
Field (Category description),Fields and field extensions,Körper und Körpererweiterungen
AffVar (Category description),Affine Varieties over $k$,Affine Varietäten über $k$
Sch (Category description),Schemes and homomorphisms,Schemata und Homomorphismen
GrAb (Category description),Graded abelian groups and homomorphisms,Graduierte Gruppen und Homomorphismen
Ordinal number category (Category description),Finite ordinal numbers and order-preserving maps,Endliche Ordinalzahlen und ordnungserhaltende Abbildungen
CGHaus (Category description), Compactly generated Hausdorff spaces and continuous maps, Kompakt erzeugte Hausdorffräume und stetige Abbildungen
SimplicialSet (Category description),|Functor category $[\OrdCat, \Set]$|,|Funktorkategorie $[\OrdCat, \Set]$|

View file

@ -18,26 +18,26 @@ __HEADER__(Faktor package that also handles cofaktors)
\RequirePackage{mathtools}
\DeclareDocumentCommand{\faktor}{s O{0.5} m O{-0.5} m}{% \newfaktor[*][#2]{#3}[#4]{#5} -> #3/#5
\setbox0=\hbox{\ensuremath{#3}}% Store numerator
\DeclareDocumentCommand{\faktor}{s m O{0.5} m O{-0.5}}{% \newfaktor[*]{#2}[#3]{#4}[#5] -> #2/#4
\setbox0=\hbox{\ensuremath{#2}}% Store numerator
\setbox1=\hbox{\ensuremath{\diagup}}% Store slash /
\setbox2=\hbox{\ensuremath{#5}}% Store denominator
\raisebox{#2\ht1}{\usebox0}% Numerator
\setbox2=\hbox{\ensuremath{#4}}% Store denominator
\raisebox{#3\ht1}{\usebox0}% Numerator
\mkern-5mu\ifthenelse{\equal{#1}{\BooleanTrue}}% Slash /
{\diagup}% regular \faktor slash
{\rotatebox{-44}{\rule[#4\ht2]{0.4pt}{-#4\ht2+#2\ht0+\ht0}}}% tilted rule as a slash
{\rotatebox{-44}{\rule[#5\ht2]{0.4pt}{-#5\ht2+#3\ht0+\ht0}}}% tilted rule as a slash
\mkern-4mu%
\raisebox{#4\ht2}{\usebox2}% Denominator
\raisebox{#5\ht2}{\usebox2}% Denominator
}
\DeclareDocumentCommand{\cofaktor}{s O{-0.5} m O{0.5} m}{% \newfaktor[*][#2]{#3}[#4]{#5} -> #2\#4
\setbox0=\hbox{\ensuremath{#3}}% Store numerator
\DeclareDocumentCommand{\cofaktor}{s m O{-0.5} m O{0.5}}{% \newfaktor[*]{#2}[#3]{#4}[#5] -> #2/#4
\setbox0=\hbox{\ensuremath{#2}}% Store numerator
\setbox1=\hbox{\ensuremath{\diagdown}}% Store slash /
\setbox2=\hbox{\ensuremath{#5}}% Store denominator
\raisebox{#2\ht1}{\usebox0}% Numerator
\setbox2=\hbox{\ensuremath{#4}}% Store denominator
\raisebox{#3\ht1}{\usebox0}% Numerator
\mkern-5mu\ifthenelse{\equal{#1}{\BooleanTrue}}% Slash /
{\diagdown}% regular \faktor slash
{\rotatebox{44}{\rule[-#4\ht2]{0.4pt}{#4\ht2-#2\ht0+\ht0}}}% tilted rule as a slash
{\rotatebox{44}{\rule[-#5\ht2]{0.4pt}{#5\ht2-#3\ht0+\ht0}}}% tilted rule as a slash
\mkern-4mu%
\raisebox{#4\ht2}{\usebox2}% Denominator
\raisebox{#5\ht2}{\usebox2}% Denominator
}

View file

@ -11,7 +11,7 @@ __LANGUAGE_OPTIONS_X__
__END_OPTIONS_X__
%%%% Import the other custom math packages
\RequirePackage{__AUTHOR_ACRONYM__-mathfont} % Load this first to ensure untouched fonts
\RequirePackage{mkessler-mathfont} % Load this first to ensure untouched fonts
\RequirePackage{amsmath}
\RequirePackage{mathtools}
@ -29,12 +29,11 @@ __END_OPTIONS_X__
%%% Importing other custom packages
\RequirePackage{__AUTHOR_ACRONYM__-faktor}
\RequirePackage{__AUTHOR_ACRONYM__-mathsymb}
\RequirePackage[basic]{__AUTHOR_ACRONYM__-mathalias}
% __AUTHOR_ACRONYM__-mathfont has already been imported
\RequirePackage[__IF__(english) english\else german\fi]{__AUTHOR_ACRONYM__-mathop}
\RequirePackage{__AUTHOR_ACRONYM__-categories}
\RequirePackage{__AUTHOR_ACRONYM__-mathfig}
\RequirePackage{__AUTHOR_ACRONYM__-unicodechar}
\RequirePackage{__AUTHOR_ACRONYM__-mathfixes} % Load this last since it renews behaviour
\RequirePackage{mkessler-faktor}
\RequirePackage{mkessler-mathsymb}
\RequirePackage[basic]{mkessler-mathalias}
% mkessler-mathfont has already been imported
\RequirePackage[__IF__(english) english\else german\fi]{mkessler-mathop}
\RequirePackage{mkessler-mathfig}
\RequirePackage{mkessler-unicodechar}
\RequirePackage{mkessler-mathfixes} % Load this last since it renews behaviour

View file

@ -10,17 +10,16 @@ __NEW_IF__(extended,false)
__END_OPTIONS_X__
%Usage: \MakeAliasesForwith\<mathcommand>{<prefix>}{<Set of letters>}
%Usage: \makealiasesforwith\<mathcommand>{<prefix>}{<Set of letters>}
% to declare commands of form \<prefix><Letter> as \<mathcommand>{<Letter>} for each
% of the specfied letters
%
% E.g. \MakeAliasesForwith\mathcal{c}{ABC} will declare
% E.g. \makealiasesforwith\mathcal{c}{ABC} will declare
% \cA \cB \cC \cD as \mathcal{A}, \mathcal{B}, \mathcal{C}
% This is also ensuring math context, so that
% \cA will be valid even in normal text.
\NewDocumentCommand{\MakeAliasesForwith}{m m m}
{
\def\makealiasesforwith#1#2#3{
\def__PACKAGE_MACRO__(makealias)##1{
\expandafter\def\csname #2##1\endcsname{\ensuremath{#1{##1}}}
}
@ -35,11 +34,10 @@ __END_OPTIONS_X__
__IF__(basic)
\RequirePackage{amsfonts}
\MakeAliasesForwith\mathbb{}{CFKNQRZ}
\makealiasesforwith\mathbb{}{CFKNQRZ}
\fi
__IF__(extended)
\expandafter\MakeAliasesForwith\expandafter\mathcal\expandafter{\expandafter c\expandafter}\expandafter{__PACKAGE_MACRO__(all)}
\expandafter\MakeAliasesForwith\expandafter\mathfrak\expandafter{\expandafter f\expandafter}\expandafter{__PACKAGE_MACRO__(all)}
\expandafter\MakeAliasesForwith\expandafter\mathbb\expandafter{\expandafter b\expandafter}\expandafter{__PACKAGE_MACRO__(all)}
\expandafter\makealiasesforwith\expandafter\mathcal\expandafter{\expandafter c\expandafter}\expandafter{__PACKAGE_MACRO__(all)}
\expandafter\makealiasesforwith\expandafter\mathfrak\expandafter{\expandafter f\expandafter}\expandafter{__PACKAGE_MACRO__(all)}
\fi

22
src/math/mathfig.pysty Normal file
View file

@ -0,0 +1,22 @@
__HEADER__(Math figures with TikZ / pgfplots / xy)
% This is just a collection of the packages I use to typeset mathematical figures
% most commonly plots, commutative diagrams or geometry
\RequirePackage{pgfplots} % Plots
\pgfplotsset{compat=1.7}
\RequirePackage{tikz} % Plots / drawings
\usetikzlibrary{calc, intersections, through, quotes, angles, babel, positioning, snakes}
\RequirePackage{tikz-cd} %Commutative diagrams
%%for small diagrams, similar to tikz-cd
\RequirePackage[all]{xy} % for small diagrams, e.g. arrows
%%% In older versions, you found
% \RequirePackage{xy}
% \xyoption{all}
% here, but this messes with the catcode of the @ sign (which no package should do!)
% so that further parts in this package would get broken

View file

@ -1,72 +0,0 @@
__HEADER__(Math figures with TikZ / pgfplots / xy)
% This is just a collection of the packages I use to typeset mathematical figures
% most commonly plots, commutative diagrams or geometry
\RequirePackage{pgfplots} % Plots
\pgfplotsset{compat=1.7}
\RequirePackage{tikz} % Plots / drawings
\usetikzlibrary{calc, intersections, through, quotes, angles, babel, positioning, snakes, decorations.markings}
\RequirePackage{tikz-cd} %Commutative diagrams
\RequirePackage{xparse}
%%for small diagrams, similar to tikz-cd
\RequirePackage[all]{xy} % for small diagrams, e.g. arrows
%%% In older versions, you found
% \RequirePackage{xy}
% \xyoption{all}
% here, but this messes with the catcode of the @ sign (which no package should do!)
% so that further parts in this package would get broken
\newcommand\pushoutsymbol{\tikz[baseline=0.5,scale=0.2]{
\draw[-] (0,0) --(0,1) -- (1,1);
\draw (1,0) circle (1.5pt);}
}
\newcommand\pullbacksymbol{\tikz[baseline=0.5,scale=0.2]{
\draw[-] (0,0) --(1,0) -- (1,1);
\draw (0,1) circle (1.5pt);}
}
% This is used in a tikzcd
\NewDocumentCommand\pushout{ O{dr} }{
\arrow[phantom, pos=0.45]{#1}{\pushoutsymbol}
}
% This is used in a tikzcd
\NewDocumentCommand\pullback{ O{dr} }{
\arrow[phantom, pos=0.45]{#1}{\pullbacksymbol}
}
%% Fix for equal arrows in tikz, see
% https://tex.stackexchange.com/questions/443017/equal-arrows-without-transparent-ends-possible-in-tikzcd
\tikzset {
double line with arrow/.style args =
{#1,#2}%
{
decorate, decoration =
{
markings,
mark = at position 0 with
{
\coordinate (ta-base-1) at (0,1pt);
\coordinate (ta-base-2) at (0,-1pt);
}
,
mark = at position 1 with
{
\draw[#1] (ta-base-1) -- (0,1pt);
\draw[#2] (ta-base-2) -- (0,-1pt);
}
}
}
}
\tikzset{Equal/.style={-,double line with arrow={-,-}}}

View file

@ -24,10 +24,8 @@ __HEADER__(Hacky math packages for some (custom@) fixes)
\let__PACKAGE_MACRO__(stored@varphi)\varphi
\AtBeginDocument{
\let\phi__PACKAGE_MACRO__(stored@varphi)
\let\varphi__PACKAGE_MACRO__(stored@varphi)
\let\uglyphi__PACKAGE_MACRO__(stored@phi)
\let\oldphi__PACKAGE_MACRO__(stored@phi)
\let\goldenratio__PACKAGE_MACRO__(stored@phi)
}
\let__PACKAGE_MACRO__(stored@epsilon)\epsilon
@ -35,5 +33,4 @@ __HEADER__(Hacky math packages for some (custom@) fixes)
\AtBeginDocument{
\let\epsilon__PACKAGE_MACRO__(stored@varepsilon)
\let\uglyepsilon__PACKAGE_MACRO__(stored@epsilon)
\let\oldepsilon__PACKAGE_MACRO__(stored@epsilon)
}

View file

@ -25,6 +25,13 @@ __END_OPTIONS_X__
%Easily declare new distributions
\newcommand\DeclareDistribution[1]{\expandafter\def\csname #1\endcsname{__PACKAGE_MACRO__(distribution){#1}}}
%%%For categories
%Introduce synonym for \operatorname
\newcommand__PACKAGE_MACRO__(category)[1]{\operatorname{\textbf{#1}}}
%Easily declare new categories
\newcommand\DeclareCategory[1]{\expandafter\def\csname #1\endcsname{__PACKAGE_MACRO__(category){#1}}}
%%%%%%%%%%% Operators
%Basic commands
\DeclareSimpleMathOperator{id}
@ -43,19 +50,19 @@ __END_OPTIONS_X__
% The starred versions of the four commands will ignore the language option and print their
% exact names (without the *, of course)
\DeclareMathOperator{\@__PACKAGE_PREFIX__ggT}{ggT}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__ggT}{__IF__(english) gcd\else ggT\fi}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__ggT}{\if@__PACKAGE_PREFIX__english gcd\else ggT\fi}
\def\ggT{\@ifstar\@__PACKAGE_PREFIX__ggT\@@__PACKAGE_PREFIX__ggT}
\DeclareMathOperator{\@__PACKAGE_PREFIX__gcd}{gcd}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__gcd}{__IF__(english) gcd\else ggT\fi}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__gcd}{\if@__PACKAGE_PREFIX__english gcd\else ggT\fi}
\def\gcd{\@ifstar\@__PACKAGE_PREFIX__gcd\@@__PACKAGE_PREFIX__gcd}
\DeclareMathOperator{\@__PACKAGE_PREFIX__kgV}{kgV}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__kgV}{__IF__(english) lcm\else kgV\fi}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__kgV}{\if@__PACKAGE_PREFIX__english lcm\else kgV\fi}
\def\kgV{\@ifstar\@__PACKAGE_PREFIX__kgV\@@__PACKAGE_PREFIX__kgV}
\DeclareMathOperator{\@__PACKAGE_PREFIX__lcm}{lcm}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__lcm}{__IF__(english) lcm\else kgV\fi}
\DeclareMathOperator{\@@__PACKAGE_PREFIX__lcm}{\if@__PACKAGE_PREFIX__english lcm\else kgV\fi}
\def\lcm{\@ifstar\@__PACKAGE_PREFIX__lcm\@@__PACKAGE_PREFIX__lcm}
%Complex numbers
@ -70,30 +77,22 @@ __END_OPTIONS_X__
\DeclareSimpleMathOperator{sgn}
\DeclareSimpleMathOperator{coker}
\DeclareSimpleMathOperator{rank}
\DeclareSimpleMathOperator{rk}
\DeclareSimpleMathOperator{Mat}
\DeclareSimpleMathOperator{ev}
\DeclareSimpleMathOperator{tr}
\DeclareSimpleMathOperator{GL}
\DeclareSimpleMathOperator{PGL}
%Algebra
\DeclareSimpleMathOperator{Quot}
\DeclareSimpleMathOperator{rad}
\DeclareSimpleMathOperator{Spec}
\DeclareSimpleMathOperator{Frac}
\DeclareSimpleMathOperator{Gal}
\DeclareSimpleMathOperator{Ext}
\DeclareSimpleMathOperator{Tor}
\DeclareSimpleMathOperator{MaxSpec}
\DeclareSimpleMathOperator{Sh}
\DeclareSimpleMathOperator{PSh}
\DeclareSimpleMathOperator{Proj}
\DeclareSimpleMathOperator{QCoh}
\DeclareSimpleMathOperator{MaxSpec}
\DeclareSimpleMathOperator{Fun}
\DeclareSimpleMathOperator{ord}
\DeclareMathOperator{\Nil}{\mathcal{N}il}
\DeclareMathOperator{\Ouv}{\mathcal{O}uv}
\DeclareMathOperator{\PreSh}{Pre-Sh}
\newcommand{\tensor}{\otimes} %Synonym for tensoring
@ -121,8 +120,6 @@ __END_OPTIONS_X__
\DeclareSimpleMathOperator{pr}
\def\twedge{\vee} % Semantically correct macros for wedge product
\def\tsmash{\wedge} % Semantically correct macro for smash product
\DeclareSimpleMathOperator{sing}
\DeclareSimpleMathOperator{cell}
%Category Theory
\DeclareSimpleMathOperator{Ob}
@ -131,6 +128,19 @@ __END_OPTIONS_X__
\DeclareSimpleMathOperator{End}
\DeclareSimpleMathOperator{colim}
%Categories
\DeclareCategory{Top}
\DeclareCategory{hTop}
\DeclareCategory{Set}
\DeclareCategory{CHaus}
\DeclareCategory{Grp}
\DeclareCategory{Ab}
\DeclareCategory{CRing}
\DeclareCategory{Vect}
\DeclareCategory{Fin}
\DeclareCategory{Ab}
\DeclareCategory{Cat}
%Set theory
\DeclareSimpleMathOperator{card}
\DeclareSimpleMathOperator{Cd}
@ -142,33 +152,16 @@ __END_OPTIONS_X__
\DeclareSimpleMathOperator{Br}
\DeclareSimpleMathOperator{EXT}
\DeclareSimpleMathOperator{Ind}
\DeclareSimpleMathOperator{Char}
\DeclareSimpleMathOperator{char}
\DeclareSimpleMathOperator{res}
\DeclareSimpleMathOperator{inf}
\DeclareSimpleMathOperator{cov}
\newcommand{\del}{\partial} % Semantically correct operator for boundary maps
%% Algebraic geometry
\DeclareSimpleMathOperator{eq}
\DeclareSimpleMathOperator{Idem}
\DeclareSimpleMathOperator{Supp}
\DeclareSimpleMathOperator{Ann}
\DeclareSimpleMathOperator{OC}
\DeclareSimpleMathOperator{red}
\DeclareSimpleMathOperator{can}
\DeclareSimpleMathOperator{Pic}
\newcommand\leftadjoint\vdash
\newcommand\rightadjoint\dashv
% Characteristic function
\newcommand*{\cfun}{\ensuremath{\mathbbm{1}}}
\newcommand*{\One}{\cfun}
%% such that in set declarations
\newcommand{\suchthat}{\;\middle|\;}
%Paired Delimiters
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
@ -184,32 +177,3 @@ __END_OPTIONS_X__
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\DeclareMathOperator{\amalgprod}{\star}
\newcommand\op{\text{op}}
\newcommand\opposite{^{\op}}
\newcommand\ab{\text{ab}}
\newcommand\abelianization{^{\ab}}
\NewDocumentCommand\set{m}
{
\left\{ #1 \right\}
}
%Taken from user egreg on
% https://tex.stackexchange.com/a/22255
\newcommand\frestriction[2]{{% we make the whole thing an ordinary symbol
\left.\kern-\nulldelimiterspace % automatically resize the bar with \right
#1 % the function
\vphantom{\big|} % pretend it's a little taller at normal size
\right|_{#2} % this is the delimiter
}}
\newcommand\directlimit{\varinjlim}
\newcommand\inverselimit{\varprojlim}
\DeclareMathOperator*{\freeproduct}{\raisebox{-0.5ex}{\scalebox{2}{$\ast$}}}

View file

@ -42,4 +42,6 @@ __HEADER__(Some extra math-related symbols.)
% When dealing with chain complexes, one often uses a bullet as placeholder for the index to mean the whole chain:
\newcommand\chainbullet{\bullet}
\newcommand{\blank}{\text{--}}

View file

@ -21,25 +21,21 @@ __IF__(index)
%Emphasize \vocabulary
\RequirePackage{expl3}
\ExplSyntaxOn
\NewDocumentCommand{\vocab}{O{} m}{%
\NewDocumentCommand{\vocab}{O{} m}{
\textbf{\color{blue} #2}%
\if\relax\detokenize{#1}\relax%
\index[vocabindex]{\text_titlecase_first:n{#2}} % true branch: #1 was empty
\else%
\else
\index[vocabindex]{#1} % false branch: #1 was supplied
\fi%
\fi
}
\ExplSyntaxOff
\newcommand\printvocabindex{%
\printindex[vocabindex]%
}
\NewDocumentCommand{\PrintVocabIndex}{ }
{%
\printindex[vocabindex]%
\newcommand\printvocabindex{
\printindex[vocabindex]
}
\else
\NewDocumentCommand{\vocab}{O{} m }{%
\textbf{\color{blue} #2}%
}%
\NewDocumentCommand{\vocab}{O{} m }{
\textbf{\color{blue} #2}
}
\fi

View file

@ -1,62 +0,0 @@
%MIT License
%
% Copyright (c) 2018 varkor
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all
% copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE. *** quiver ***
%
%
% A package for drawing commutative diagrams exported from https://q.uiver.app.
%
% This package is currently a wrapper around the `tikz-cd` package, importing necessary TikZ
% libraries, and defining a new TikZ style for curves of a fixed height.
%
% Version: 1.2.1
% Authors:
% - varkor (https://github.com/varkor)
% - AndréC (https://tex.stackexchange.com/users/138900/andr%C3%A9c)
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{quiver}[2021/01/11 quiver]
% `tikz-cd` is necessary to draw commutative diagrams.
\RequirePackage{tikz-cd}
% `amssymb` is necessary for `\lrcorner` and `\ulcorner`.
\RequirePackage{amssymb}
% `calc` is necessary to draw curved arrows.
\usetikzlibrary{calc}
% `pathmorphing` is necessary to draw squiggly arrows.
\usetikzlibrary{decorations.pathmorphing}
% A TikZ style for curved arrows of a fixed height, due to AndréC.
\tikzset{curve/.style={settings={#1},to path={(\tikztostart)
.. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$)
.. (\tikztotarget)\tikztonodes}},
settings/.code={\tikzset{quiver/.cd,#1}
\def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}},
quiver/.cd,pos/.initial=0.35,height/.initial=0}
% TikZ arrowhead/tail styles.
\tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}}
\tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}}
\tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}}
% TikZ arrow styles.
\tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}}
\endinput

View file

@ -1,62 +0,0 @@
__HEADER__(Iterate over powerset of clist)
\ExplSyntaxOn
%%% Iterate over powerset of claist
\clist_new:N \l_powerset_copied_clist
\seq_new:N \l_powerset_saved_seq
\cs_generate_variant:Nn \clist_remove_all:Nn { N V }
% Pseudocode of this macro
% remove left -> push on stack
% call recursive
% add left to 'extra'
% call recursive
% remove left from 'extra'
% add from stack to left
\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
}
}
% Usage:
% \clist_use_powerset:Nn {clist variable name}{code for each subset}
% This will execute #2 for each subset of the listname given as #1
% In #2, the name given as #1 can be used for the current subset
% After execution, the value of #1 is restored
\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
}

View file

@ -1,148 +0,0 @@
__HEADER__(Cache definitions of previous LaTeX runs to avoid computations)
%%%% This is just a proof of concept package,
%%%% there is possibly more room for clean-up
%%%% and / or speed-up etc.
%%% Also, the provided
%%% \DeclareCachedDocumentCommand
%%% is of course not really
%%% useful and just for demonstration
%%% purposes
\bool_new:N \g__cache_cache_bool
\int_new:N \g__cache_cache_version_document_int
\int_new:N \g__cache_cache_version_aux_int
\int_gset:Nn \g__cache_cache_version_aux_int { -1 }
\clist_new:N \g__cache_dump_auxfile_clist %% usual dump
\clist_new:N \g__cache_dump_cache_clist %% will be dumped such that it is restored as \g__cache_lazy_auxfile_tl on next run.
\tl_new:N \g__cache_lazy_document_tl
\tl_new:N \g__cache_lazy_auxfile_tl
\keys_define:nn { cache }
{
cache .bool_set:N = \g__cache_cache_bool,
cache .default:n = { true },
__cache version__ .int_set:N = \g__cache_cache_version_document_int,
cache version .meta:nn = { cache } { cache = true, __cache version__ = #1 },
cache version .default:n = { 0 },
}
\RequirePackage{l3keys2e}
\ProcessKeysOptions{cache}
% Setting up lazy execution and
% selecting of executing after reading of aux file
% if cache option has been used
\bool_if:NTF \g__cache_cache_bool
{
%% Writing things (at one go) to aux file at end of document:
\cs_new:Npn \__cache_dump_auxfile:n
{
\clist_gput_right:Nn \g__cache_dump_auxfile_clist
}
\cs_generate_variant:Nn \__cache_dump_auxfile:n { x }
\cs_new:Npn \__cache_dump_cache:n
{
\clist_gput_right:Nn \g__cache_dump_cache_clist
}
\cs_generate_variant:Nn \__cache_dump_cache:n { V }
\cs_new:Npn \__cache_write_auxout:n
{
\iow_now:cn { @auxout }
}
\cs_generate_variant:Nn \__cache_write_auxout:n { x }
%%% Handles dumping data to aux file at end of document
\hook_gput_code:nnn { enddocument } { cache }
{
\clist_map_function:NN \g__cache_dump_auxfile_clist
\__cache_write_auxout:n
\__cache_write_auxout:n
{
\csname tl_gput_right:cn \endcsname
{
g__cache_lazy_auxfile_tl
}
}
\__cache_write_auxout:x { \str_use:N \c_left_brace_str }
\clist_map_function:NN \g__cache_dump_cache_clist
\__cache_write_auxout:n
\__cache_write_auxout:x { \str_use:N \c_right_brace_str }
}
%%% Writes the current cache version into aux file
\__cache_dump_auxfile:x
{
\ExplSyntaxOn
\int_gset:Nn \exp_not:N \g__cache_cache_version_aux_int
{
\int_use:N \g__cache_cache_version_document_int
}
\ExplSyntaxOff
}
%%% Executing something lazily at beginning of document
%%% Lazy code only gets executed if auxfile version is older than document
\cs_new:Npn \__cache_lazy:n
{
\tl_gput_right:Nn \g__cache_lazy_document_tl
}
%%% Caching things. Handles writing and reading to aux file
%%% and makes code available in the next run of LaTeX
\cs_new:Npn \__cache_cache:n #1
{
\tl_set:Nn \l_tmpa_tl
{
{ #1 }
}
\regex_replace_all:nnN { \cP\# } { \cO\# } \l_tmpa_tl
\__cache_dump_cache:V \l_tmpa_tl
}
%%% This handles loading either the cached definitions
%%% from last run or executing the lazy definitions from the current run
%%% after loading the aux file
\hook_gput_code:nnn { begindocument } { cache }
{
\int_compare:nNnTF
\g__cache_cache_version_aux_int < \g__cache_cache_version_document_int
{
\tl_use:N \g__cache_lazy_document_tl
}
{
\tl_use:N \g__cache_lazy_auxfile_tl
}
}
}
{
\cs_set_eq:NN \__cache_lazy:n \use:n
\cs_set_eq:NN \__cache_cache:n \use_none:n
}
\cs_new:Npn \__cached_new_document_command:nnn #1 #2 #3
{
\NewDocumentCommand{#1}{#2}{#3}
\__cache_cache:n
{
\csname __cached_new_document_command:nnn \endcsname { #1 } { #2 } { #3 }
}
}
\NewDocumentCommand{\DeclareCachedDocumentCommand}{mmm}
{
\__cache_lazy:n
{
\__cached_new_document_command:nnn{#1}{#2}{#3}
}
}

View file

@ -1,34 +0,0 @@
__HEADER__(Hacky code setup for verbatim code)
__NEW_IF__(pipe,false)
\DeclareOption{pipe}{__SET_IF__(pipe,true)}
\ProcessOptions
% This is needed in general: when _ is active, we want it to expand to
% an actual _ character
\catcode`_=13
\let_\_
\catcode`_=8
\ExplSyntaxOn
\NewDocumentCommand{\code}{m}
{
\tl_set_rescan:Nnn \l_tmpa_tl
{
\char_set_catcode_active:N _
}
{ #1 }
\texttt{ \tl_use:N \l_tmpa_tl }
}
\ExplSyntaxOff
__IF__(pipe)
\catcode`|=\active
\def|#1|{
\code{#1}
}
% Do not make | active inside tables
\AddToHook{env/tabular/before}[code]{\catcode`|=12}
\AddToHook{env/tabular/after}[code]{\catcode`|=13}
\fi

6
src/wip/enumerate.pysty Normal file
View file

@ -0,0 +1,6 @@
__HEADER__(Simple enumeration package wrapper. Handles custom number setting and beamer class.)
\@ifclassloaded{beamer}{}{
\usepackage[shortlabels]{enumitem}
\newcommand\setItemnumber[1]{\setcounter{enum\romannumeral\@enumdepth}{\numexpr#1-1\relax}}
}

96
src/wip/proof.pysty Normal file
View file

@ -0,0 +1,96 @@
__HEADER__(Automatic references to theorems in proofs. Claim counters within proofs)
\RequirePackage{xkeyval}
__LANGUAGE_OPTIONS_X__
__END_OPTIONS_X__
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{etoolbox}
\RequirePackage{xparse}
%%Give claim an own counter and let it reset at each proof
%See also at:
%https://tex.stackexchange.com/questions/283502/reset-counter-at-beginning-of-proof
\newtheorem{claim}{__IF__(english) Claim\else Behauptung\fi}
\newtheorem*{claim*}{__IF__(english) Claim\else Behauptung\fi}
\AtBeginDocument{\def\claimautorefname{__IF__(english) Claim\else Behauptung\fi}}
__NEW_IF__(hyperref,false)
\AtBeginDocument{
\@ifpackageloaded{hyperref}{
__SET_IF__(hyperref,true)
\def\grab#1{\expandafter\@firstoffive#1}
\def__PACKAGE_MACRO__(blankref)#1{\expandafter\grab\csname r@#1\endcsname}
\let__PACKAGE_MACRO__(autoref)\autoref
}{
__SET_IF__(hyperref,true)
\let__PACKAGE_MACRO__(blankref)\ref
\let__PACKAGE_MACRO__(autoref)\ref
}
}
\NewDocumentEnvironment{rproof}{m O{}}{\def__PACKAGE_MACRO__(aster){\relax}\begin{__PACKAGE_PREFIX__rproof@impl}{#1}[#2]}{\end{__PACKAGE_PREFIX__rproof@impl}}
\NewDocumentEnvironment{rproof*}{m O{}}{\def__PACKAGE_MACRO__(aster){*}\begin{__PACKAGE_PREFIX__rproof@impl}{#1}[#2]}{\end{__PACKAGE_PREFIX__rproof@impl}}
\NewDocumentEnvironment{__PACKAGE_PREFIX__rproof@impl}{m O{}}
{
% Restore correct counter for claim
\ifcsdef{the__PACKAGE_PREFIX__#1@save@claim}{
\setcounter{claim}{\value{__PACKAGE_PREFIX__#1@save@claim}}
\def__PACKAGE_MACRO__(proofprefix){__IF__(english) Continuation of proof__PACKAGE_MACRO__(aster)\space of\else Fortsetzung des Beweises__PACKAGE_MACRO__(aster)\space zu\fi}
\edef\haha{\value{__PACKAGE_PREFIX__#1@part}}
}{
\newcounter{__PACKAGE_PREFIX__#1@save@claim}
\setcounter{claim}{0}
\def__PACKAGE_MACRO__(proofprefix){__IF__(english) Proof__PACKAGE_MACRO__(aster)\space of\else Beweis__PACKAGE_MACRO__(aster)\space von\fi}
}
% Set up counter number printing as subindexed by numbering of the reference
\let__PACKAGE_MACRO__(theoldclaim)\theclaim
\def\theclaim{__PACKAGE_MACRO__(blankref){#1}.__PACKAGE_MACRO__(theoldclaim)}
% Now, start the actual proof
\begin{proof}[__PACKAGE_MACRO__(proofprefix)\space__PACKAGE_MACRO__(autoref){#1}\if\relax\detokenize{#2}\relax\else\space(#2)\fi]
}
{
\end{proof} % End proof
% Save current claim counter for later restoration
\setcounter{__PACKAGE_PREFIX__#1@save@claim}{\value{claim}}
}
% Proof (with asterisk)
\NewDocumentEnvironment{proof*}{O{}}
{
\if\relax\detokenize{#1}\relax\begin{proof}[__IF__(english) Proof\emph{*}\else Beweis\emph{*}\fi]\else\begin{proof}[#1\emph{*}]\fi
}
{
\end{proof}
}
%%subproof environment - essentially copied proof environment from amsthm and modified its name + symbol
\DeclareRobustCommand{\blackqed}{%
\ifmmode \mathqed
\else
\leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill
\quad\hbox{$\blacksquare$}%
\fi
}
\newenvironment{subproof}[1][__IF__(english) Subproof\else Unterbeweis\fi]{\par
\pushQED{\blackqed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\itshape
#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
%%%% This might be dropped, but for now is collected here
%%Solution (for exercises)
\newenvironment{solution}[1][]{\begin{proof}[__IF__(english){}Solution\else{}Lösung\fi{}#1]}{\end{proof}}

Some files were not shown because too many files have changed in this diff Show more