Merge pull request #2 from kesslermaximilian/pysty
Package building with python
This commit is contained in:
commit
c48403215a
93 changed files with 1224 additions and 661 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1 +1,6 @@
|
|||
*.swp
|
||||
build/*
|
||||
.gitconfiglock
|
||||
.initsubmodulelock
|
||||
.idea/
|
||||
__pycache__
|
||||
|
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
[submodule "PyTeX"]
|
||||
path = PyTeX
|
||||
url = https://github.com/kesslermaximilian/PyTeX.git
|
||||
branch= latex-packages
|
20
Makefile
Normal file
20
Makefile
Normal file
|
@ -0,0 +1,20 @@
|
|||
.PHONY: build
|
||||
|
||||
build: .initsubmodulelock
|
||||
@python3 build.py
|
||||
|
||||
init: .initsubmodulelock .gitconfiglock
|
||||
|
||||
config: .gitconfiglock
|
||||
|
||||
.initsubmodulelock:
|
||||
@git submodule update --init
|
||||
@touch .initsubmodulelock
|
||||
|
||||
.gitconfiglock:
|
||||
@echo "[Make config] Setting git configs to prevent wrong pushes"
|
||||
@git config push.recurseSubmodules check
|
||||
@git config status.submodulesummary 1
|
||||
@echo "[Push annotated tags by default]"
|
||||
@git config push.followTags true
|
||||
@touch .gitconfiglock
|
1
PyTeX
Submodule
1
PyTeX
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit dbdd99cc3d6e02b0cfadb1d337f6b85c5f52a9b5
|
53
build.py
Normal file
53
build.py
Normal file
|
@ -0,0 +1,53 @@
|
|||
from pathlib import *
|
||||
import sys
|
||||
import git
|
||||
from datetime import *
|
||||
sys.path.insert(0, 'PyTeX/')
|
||||
|
||||
from package_formatter import PackageFormatter
|
||||
from replacements import make_default_commands
|
||||
from git_version import git_describe
|
||||
|
||||
BUILD_DETAILS = [
|
||||
"Build details:",
|
||||
" Build time: {build_time}",
|
||||
" PyTeX version: {pytex_version} (commit {pytex_commit_hash})",
|
||||
" LatexPackages version: {packages_version} (commit {packages_commit_hash})"
|
||||
]
|
||||
|
||||
|
||||
def build_details():
|
||||
repo = git.Repo()
|
||||
repo_description = git_describe(repo.head.ref.commit)
|
||||
pytex_repo = repo.submodule('PyTeX').module()
|
||||
pytex_repo_description = git_describe(pytex_repo.head.ref.commit)
|
||||
return list(map(lambda line: line.format(
|
||||
build_time=datetime.now().strftime('%Y/%m/%d %H:%M'),
|
||||
pytex_version=pytex_repo_description,
|
||||
pytex_commit_hash=pytex_repo.head.ref.commit.hexsha[0:7],
|
||||
packages_version=repo_description,
|
||||
packages_commit_hash=repo.head.ref.commit.hexsha[0:7]
|
||||
),BUILD_DETAILS))
|
||||
|
||||
|
||||
def build(build_dir: str):
|
||||
input_root = Path('./packages').resolve()
|
||||
output = input_root / build_dir
|
||||
print('[PyTeX] Getting git repository information...')
|
||||
extra_header = build_details()
|
||||
print('[PyTeX] ..done.')
|
||||
if git.Repo().is_dirty():
|
||||
extra_header += ['WARNING: Local changes to git repository detected.',
|
||||
' The build will not be reproducible (!)']
|
||||
num_files = 0
|
||||
for file in input_root.rglob('*.pysty'):
|
||||
num_files+=1
|
||||
formatter = PackageFormatter(package_name=file.with_suffix('').name, extra_header=extra_header)
|
||||
print('[PyTeX] Writing file {}'.format(formatter.file_name))
|
||||
make_default_commands(formatter)
|
||||
formatter.format_package(file, Path('./').resolve() / build_dir / str(file.parent.relative_to(input_root)))
|
||||
print(f'[PyTeX] Successfully built {num_files} packages in {build_dir}/')
|
||||
|
||||
if __name__ == "__main__":
|
||||
build('build')
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-fancythmoptions}
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
%%%%% This is an internal base class, do not import this yourself
|
||||
%% This will just be imported by fancythm for easy options use
|
||||
\newif\ifmkessler@fancythm@english\mkessler@fancythm@englishtrue
|
||||
\newif\ifmkessler@fancythm@showstars\mkessler@fancythm@showstarstrue
|
||||
\newif\ifmkessler@fancythm@showdaggers\mkessler@fancythm@showdaggerstrue
|
||||
\newif\ifmkessler@fancythm@includestars\mkessler@fancythm@includestarstrue
|
||||
\newif\ifmkessler@fancythm@includeoral\mkessler@fancythm@includeoraltrue
|
||||
\newif\ifmkessler@fancythm@markoral\mkessler@fancythm@markoraltrue
|
||||
|
||||
\newif\ifmkessler@fancythm@lecturenumbers\mkessler@fancythm@lecturenumberstrue
|
||||
\newif\ifmkessler@fancythm@numbersmallenvironmentswiththeorem\mkessler@fancythm@numbersmallenvironmentswiththeoremfalse
|
||||
\newif\ifmkessler@fancythm@numbersmallenvironments\mkessler@fancythm@numbersmallenvironmentsfalse
|
||||
\newif\ifmkessler@fancythm@defaulttheorems\mkessler@fancythm@defaulttheoremstrue
|
||||
|
||||
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@numbersmallenvironments}[\val\nr]{no,section,theorem}{%
|
||||
\ifcase\nr\relax
|
||||
\mkessler@fancythm@numbersmallenvironmentsfalse
|
||||
\or
|
||||
\mkessler@fancythm@numbersmallenvironmentstrue
|
||||
%numbering small environments within sections is forbidden whilst using lecturenumbes
|
||||
\ifmkessler@fancythm@lecturenumbers
|
||||
\mkessler@fancythm@numbersmallenvironmentswiththeoremtrue
|
||||
\else
|
||||
\mkessler@fancythm@numbersmallenvironmentswiththeoremfalse
|
||||
\fi
|
||||
\or
|
||||
\mkessler@fancythm@numbersmallenvironmentstrue
|
||||
\mkessler@fancythm@numbersmallenvironmentswiththeoremtrue
|
||||
\fi
|
||||
}
|
||||
|
||||
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@lecturenumbers}[\val\nr]{true,false}{%
|
||||
\ifcase\nr\relax
|
||||
\mkessler@fancythm@lecturenumberstrue
|
||||
\else
|
||||
\mkessler@fancythm@lecturenumbersfalse
|
||||
\fi
|
||||
}
|
||||
|
||||
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@defaulttheorems}[\val\nr]{true,false}{%
|
||||
\ifcase\nr\relax
|
||||
\mkessler@fancythm@defaulttheoremstrue
|
||||
\else
|
||||
\mkessler@fancythm@defaulttheoremsfalse
|
||||
\fi
|
||||
}
|
||||
|
||||
\define@choicekey*{mkesslerfancythm}{mkessler@fancythm@showdaggers}[\val\nr]{true,false}{%
|
||||
\ifcase\nr\relax
|
||||
\mkessler@fancythm@showdaggerstrue
|
||||
\else
|
||||
\mkessler@fancythm@showdaggersfalse
|
||||
\fi
|
||||
}
|
||||
|
||||
\define@choicekey*{mkesslerfancythm}{ownenvironments}[\val\nr]{on, natural, off}{%
|
||||
\ifcase\nr\relax
|
||||
\mkessler@fancythm@includestarstrue
|
||||
\mkessler@fancythm@showstarstrue
|
||||
\or
|
||||
\mkessler@fancythm@includestarstrue
|
||||
\mkessler@fancythm@showstarsfalse
|
||||
\or
|
||||
\mkessler@fancythm@includestarsfalse
|
||||
\mkessler@fancythm@showstarsfalse
|
||||
\fi
|
||||
}
|
||||
|
||||
\define@choicekey*{mkesslerfancythm}{oralremarks}[\val\nr]{on,natural,off}{%
|
||||
\ifcase\nr\relax
|
||||
\mkessler@fancythm@includeoraltrue
|
||||
\mkessler@fancythm@markoraltrue
|
||||
\or
|
||||
\mkessler@fancythm@includeoraltrue
|
||||
\mkessler@fancythm@markoralfalse
|
||||
\or
|
||||
\mkessler@fancythm@includeoralfalse
|
||||
\fi
|
||||
}
|
45
git_version.py
Normal file
45
git_version.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
import git
|
||||
from typing import Dict
|
||||
|
||||
|
||||
def get_history(commit: git.objects.commit.Commit, priority=0, depth=0) -> Dict:
|
||||
commit_history = {commit.hexsha: {
|
||||
'priority': priority,
|
||||
'depth': depth
|
||||
}}
|
||||
if len(commit.parents) == 0:
|
||||
return commit_history
|
||||
else:
|
||||
commit_history.update(get_history(commit.parents[0], priority, depth+1))
|
||||
for parent in commit.parents[1:]:
|
||||
commit_history.update(get_history(parent, priority+1, depth+1))
|
||||
return commit_history
|
||||
|
||||
|
||||
def git_describe(commit: git.objects.commit.Commit):
|
||||
commit_history = get_history(commit)
|
||||
latest_tag = None
|
||||
for tag in commit.repo.tags:
|
||||
sha = tag.commit.hexsha
|
||||
if sha in commit_history.keys():
|
||||
if latest_tag is None:
|
||||
latest_tag = tag
|
||||
elif commit_history[sha]['priority'] < commit_history[latest_tag.commit.hexsha]['priority']:
|
||||
latest_tag = tag
|
||||
elif commit_history[sha]['priority'] > commit_history[latest_tag.commit.hexsha]['priority']:
|
||||
pass # move on
|
||||
elif commit_history[sha]['depth'] < commit_history[latest_tag.commit.hexsha]['depth']:
|
||||
latest_tag = tag
|
||||
elif commit_history[sha]['depth'] > commit_history[latest_tag.commit.hexsha]['depth']:
|
||||
pass # move on
|
||||
elif tag.object.tagged_date > latest_tag.object.tagged_date:
|
||||
latest_tag = tag
|
||||
if latest_tag is None:
|
||||
return "No tags found - cannot describe anything."
|
||||
else:
|
||||
msg = latest_tag.name
|
||||
if commit_history[latest_tag.commit.hexsha]['depth'] != 0:
|
||||
msg += "-{depth}".format(depth=commit_history[latest_tag.commit.hexsha]['depth'])
|
||||
if commit.repo.is_dirty(untracked_files=True):
|
||||
msg += '-*'
|
||||
return msg
|
|
@ -1,45 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-mathalias}[2021/09/09 Easy aliasing for math style commands]
|
||||
|
||||
%%%%%%
|
||||
|
||||
\newif\ifmkessler@mathalias@basic\mkessler@mathalias@basicfalse
|
||||
\DeclareOption{basic}{\mkessler@mathalias@basictrue}
|
||||
|
||||
\newif\ifmkessler@mathalias@extended\mkessler@mathalias@extendedfalse
|
||||
\DeclareOption{extended}{\mkessler@mathalias@extendedtrue\mkessler@mathalias@basictrue}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-mathalias}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
%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
|
||||
% \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.
|
||||
|
||||
\def\makealiasesforwith#1#2#3{
|
||||
\def\mkessler@aliases@makealias##1{
|
||||
\expandafter\def\csname #2##1\endcsname{\ensuremath{#1{##1}}}
|
||||
}
|
||||
\def\mkessler@aliases@recurse##1{
|
||||
\ifx##1\mkessler@dummy\else
|
||||
\mkessler@aliases@makealias{##1}\expandafter\mkessler@aliases@recurse\fi
|
||||
}
|
||||
\mkessler@aliases@recurse #3\mkessler@dummy
|
||||
}
|
||||
|
||||
\def\mkessler@mathalias@all{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
|
||||
|
||||
\ifmkessler@mathalias@basic
|
||||
\RequirePackage{amsfonts}
|
||||
\makealiasesforwith\mathbb{}{CFKNQRZ}
|
||||
\fi
|
||||
|
||||
\ifmkessler@mathalias@extended
|
||||
\expandafter\makealiasesforwith\expandafter\mathcal\expandafter{\expandafter c\expandafter}\expandafter{\mkessler@mathalias@all}
|
||||
\expandafter\makealiasesforwith\expandafter\mathfrak\expandafter{\expandafter f\expandafter}\expandafter{\mkessler@mathalias@all}
|
||||
\fi
|
|
@ -1,39 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-mathfixes}[2021-04-27 - Hacky math packages for some (custom) fixes]
|
||||
%%%%%
|
||||
|
||||
% This just brings together some (possibly ugly) hacks that I use when writing math. Likely, you do not want to use this except when building around this package (like I did), or already have similar shortcuts
|
||||
|
||||
%Proper Degree command
|
||||
\def\mkessler@mathfixes@degree{\ensuremath{^\circ}}
|
||||
\AtBeginDocument{\let\degree\mkessler@mathfixes@degree}
|
||||
|
||||
% Always put limits under \limit
|
||||
\let\oldlim\lim\def\lim{\oldlim\limits}
|
||||
|
||||
% Print equal sign under subset by default to not confuse people
|
||||
% (I still write \subset, because this enables me remove this renewcommand and have the default \subset command evaluated instead
|
||||
\let\mkessler@mathfixes@subseteq\subseteq
|
||||
\let\mkessler@mathfixes@supseteq\supseteq
|
||||
\AtBeginDocument{
|
||||
\let\subset\mkessler@mathfixes@subseteq
|
||||
\let\supset\mkessler@mathfixes@supseteq
|
||||
}
|
||||
|
||||
%%Renew phi and epsilon to their proper versions, make the old ones available as
|
||||
% uglyphi and uglyepsilon
|
||||
|
||||
\let\mkessler@mathfixes@stored@phi\phi
|
||||
\let\mkessler@mathfixes@stored@varphi\varphi
|
||||
\AtBeginDocument{
|
||||
\let\phi\mkessler@mathfixes@stored@varphi
|
||||
\let\uglyphi\mkessler@mathfixes@stored@phi
|
||||
\let\oldphi\mkessler@mathfixes@stored@phi
|
||||
}
|
||||
|
||||
\let\mkessler@mathfixes@stored@epsilon\epsilon
|
||||
\let\mkessler@mathfixes@stored@varepsilon\varepsilon
|
||||
\AtBeginDocument{
|
||||
\let\epsilon\mkessler@mathfixes@stored@varepsilon
|
||||
\let\uglyepsilon\mkessler@mathfixes@stored@epsilon
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-mathfont}[2021/09/06 - Collects several math fonts together]
|
||||
|
||||
|
||||
%%% Store away the several (partially conflicting) fonts in internal macros
|
||||
|
||||
\let\mkessler@mathfonts@none@mathcal\mathcal
|
||||
|
||||
\RequirePackage{mathrsfs}
|
||||
\let\mkessler@mathfonts@mathrsfs@mathscr\mathscr
|
||||
|
||||
\RequirePackage[mathscr]{eucal}
|
||||
\let\mkessler@mathfonts@eucal@optionmathscr@mathscr\mathscr
|
||||
|
||||
\RequirePackage{amsfonts}
|
||||
\let\mkessler@mathfonts@amsfonts@mathfrak\mathfrak
|
||||
|
||||
%%% Provide user commands to internally stored macros
|
||||
\def\mkessler@mathfonts@restorefonts{
|
||||
\let\mathcal\mkessler@mathfonts@none@mathcal % Set \mathcal to default calligrapic
|
||||
\let\mathfrak\mkessler@mathfonts@amsfonts@mathfrak % Set \mathfrak to mathfrak from amsfonts
|
||||
\let\mathscr\mkessler@mathfonts@mathrsfs@mathscr % Set \mathscr to mathscript from mathrsfs package
|
||||
\let\mathcat\mkessler@mathfonts@mathrsfs@mathscr % Set \mathcat to mathscript from mathrsfs package
|
||||
\let\mathcalo\mkessler@mathfonts@eucal@optionmathscr@mathscr % Set \mathcom (for comic) to \mathscr from [mathscr]{eucal} package
|
||||
}
|
||||
|
||||
\AtBeginDocument{\mkessler@mathfonts@restorefonts}
|
|
@ -1,26 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-hypersetup}[2021-09-06 - Package for setting up hyperref, cleveref and some default hyperref colors]
|
||||
%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
\newif\ifmkessler@hypersetup@cleveref\mkessler@hypersetup@clevereffalse
|
||||
\DeclareOption{cleveref}{\mkessler@hypersetup@clevereftrue}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-hypersetup}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
%%%Hyperref and setup
|
||||
\RequirePackage{xcolor} % To compute the colors below
|
||||
\RequirePackage{etoolbox} % Checking for defined commands
|
||||
|
||||
\def\mkessler@hypersetup@exec{
|
||||
\RequirePackage{hyperref} % Hyperlinks
|
||||
\ifmkessler@hypersetup@cleveref
|
||||
\RequirePackage{cleveref} % Better referencing
|
||||
\fi
|
||||
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\ifdef{\@course}{\@course}{\@title}}
|
||||
}
|
||||
|
||||
\AtEndPreamble{
|
||||
\mkessler@hypersetup@exec
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-vocab}[2021-09-06 - Package for emphasizing vocabulary]
|
||||
%%%%%%%%%%%%%%%%%%
|
||||
%%Provides a \vocab<[name in index]>{vocabulary} command to print vocabulary in bold blue and automatically index it.
|
||||
|
||||
\newif\ifmkessler@vocab@english\mkessler@vocab@englishtrue
|
||||
\DeclareOption{german}{\mkessler@vocab@englishfalse}
|
||||
\DeclareOption{english}{\mkessler@vocab@englishtrue}
|
||||
|
||||
\newif\ifmkessler@vocab@index\mkessler@vocab@indexfalse
|
||||
\DeclareOption{index}{\mkessler@vocab@indextrue}
|
||||
\DeclareOption{noindex}{\mkessler@vocab@indexfalse}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-vocab}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
%%%%Management of vocabulary and corresponding index
|
||||
\RequirePackage{xparse}
|
||||
\RequirePackage{xcolor}
|
||||
\ifmkessler@vocab@index
|
||||
\RequirePackage{imakeidx}
|
||||
\makeindex[name=mkessler@vocab@indexname, columns=2, title=\ifmkessler@vocab@english Index\else Stichwortverzeichnis\fi, intoc]
|
||||
|
||||
%Emphasize \vocabulary
|
||||
\RequirePackage{expl3}
|
||||
\ExplSyntaxOn
|
||||
\NewDocumentCommand{\vocab}{O{} m}{
|
||||
\textbf{\color{blue} #2}%
|
||||
\if\relax\detokenize{#1}\relax%
|
||||
\index[mkessler@vocab@indexname]{\text_titlecase_first:n{#2}} % true branch: #1 was empty
|
||||
\else
|
||||
\index[mkessler@vocab@indexname]{#1} % false branch: #1 was supplied
|
||||
\fi
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
\newcommand\printvocabindex{
|
||||
\printindex[mkessler@vocab@indexname]
|
||||
}
|
||||
\else
|
||||
\NewDocumentCommand{\vocab}{O{} m }{
|
||||
\textbf{\color{blue} #2}
|
||||
}
|
||||
\fi
|
||||
|
|
@ -1,24 +1,96 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-fancythm}[2021/04/27 - Theorem-Environment Package]
|
||||
%%%%%%%%m
|
||||
__HEADER__(Theorem-Environment Package)
|
||||
%Provides fancy theorem-like-environments used in the write-ups of my lecture notes
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
\RequirePackage{mkessler-fancythmoptions} % Internal preamble for option handling
|
||||
__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
|
||||
\DeclareOptionX{english}{\mkessler@fancythm@englishtrue}
|
||||
\DeclareOptionX{german}{\mkessler@fancythm@englishfalse}
|
||||
__LANGUAGE_OPTIONS__
|
||||
|
||||
\DeclareOptionX{showdaggers}{\setkeys{mkesslerfancythm}{mkessler@fancythm@showdaggers=#1}}
|
||||
\DeclareOptionX{ownenvironments}{\setkeys{mkesslerfancythm}{ownenvironments=#1}}
|
||||
\DeclareOptionX{oralremarks}{\setkeys{mkesslerfancythm}{oralremarks=#1}}
|
||||
\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{mkesslerfancythm}{mkessler@fancythm@lecturenumbers=#1}}
|
||||
\DeclareOptionX{numbersmallenvironments}{\setkeys{mkesslerfancythm}{mkessler@fancythm@numbersmallenvironments=#1}}
|
||||
\DeclareOptionX{lecturenumbers}{\setkeys{__PACKAGE_NAME__}{__PACKAGE_PREFIX__lecturenumbers=#1}}
|
||||
\DeclareOptionX{numbersmallenvironments}{\setkeys{__PACKAGE_NAME__}{__PACKAGE_PREFIX__numbersmallenvironments=#1}}
|
||||
|
||||
\DeclareOptionX*{\PackageWarning{mkesslerfancythm}{Unknown X \CurrentOption}}% For unknown options
|
||||
\ProcessOptionsX*\relax
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%%%%%%%% Implementation section
|
||||
|
||||
|
@ -34,8 +106,8 @@
|
|||
\tcbuselibrary{breakable}
|
||||
|
||||
% Dummy counters
|
||||
\declaretheorem[numberwithin=section]{mkessler@fancythm@dummy}
|
||||
\declaretheorem[numberwithin=mkessler@fancythm@dummy]{mkessler@fancythm@smalldummy}
|
||||
\declaretheorem[numberwithin=section]{__PACKAGE_PREFIX__dummy}
|
||||
\declaretheorem[numberwithin=__PACKAGE_PREFIX__dummy]{__PACKAGE_PREFIX__smalldummy}
|
||||
|
||||
%%%%% Main part, i.e. providing macros for defining new theorems
|
||||
|
||||
|
@ -48,68 +120,68 @@
|
|||
|
||||
\NewDocumentCommand{\declarebigtheorem}{O{} O{} m m O{}}{
|
||||
%First, store the name of the theorem in \theoremname
|
||||
\ifmkessler@fancythm@english
|
||||
\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 = mkessler@fancythm@dummy]{#4}}{}
|
||||
\ifthenelse{\isempty{#5}}{\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling = __PACKAGE_PREFIX__dummy]{#4}}{}
|
||||
|
||||
%Define the versions theorem*, theorem**, dtheorem
|
||||
|
||||
\ifmkessler@fancythm@lecturenumbers
|
||||
\ifmkessler@fancythm@numbersmallenvironments
|
||||
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}, sibling=mkessler@fancythm@smalldummy]{#4*}
|
||||
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@smalldummy]{#4**}
|
||||
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@smalldummy]{d#4}
|
||||
\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}\ifmkessler@fancythm@showstars *\else\fi, numbered = no]{#4**}
|
||||
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, numbered = no]{d#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=mkessler@fancythm@dummy]{#4*}
|
||||
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@dummy]{#4**}
|
||||
\declaretheorem[style = #3, name = \makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@dummy]{d#4}
|
||||
\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
|
||||
\ifmkessler@fancythm@includestars\else\renewenvironment{#4**}{\comment}{\endcomment}\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
|
||||
\ifmkessler@fancythm@english
|
||||
\if__PACKAGE_PREFIX__english
|
||||
\ifthenelse{\isempty{#2}}{\def\theoremname{#4}}{\def\theoremname{#2}}
|
||||
\else
|
||||
\ifthenelse{\isempty{#1}}{\def\theoremname{#4}}{\def\theoremname{#1}}
|
||||
\fi
|
||||
\ifmkessler@fancythm@numbersmallenvironments
|
||||
\ifmkessler@fancythm@numbersmallenvironmentswiththeorem
|
||||
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}, sibling = mkessler@fancythm@smalldummy]{#4}
|
||||
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@smalldummy]{#4*}
|
||||
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@smalldummy]{d#4}
|
||||
\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=mkessler@fancythm@dummy]{#4}
|
||||
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showstars *\else\fi, sibling=mkessler@fancythm@dummy]{#4*}
|
||||
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, sibling=mkessler@fancythm@dummy]{d#4}
|
||||
\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}\ifmkessler@fancythm@showstars *\else\fi, numbered = no]{#4*}
|
||||
\declaretheorem[style=#3,name=\makefirstuc{\expandafter\theoremname}\ifmkessler@fancythm@showdaggers $^{\dagger}$\else\fi, numbered = no]{d#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=mkessler@fancythm@dummy]{n#4}
|
||||
\ifmkessler@fancythm@includestars\else\renewenvironment{#4*}{\comment}{\endcomment}\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
|
||||
\ifmkessler@fancythm@defaulttheorems
|
||||
\if__PACKAGE_PREFIX__defaulttheorems
|
||||
|
||||
\RequirePackage[default styles]{mkessler-thmstyle} % Easy setup of mdframed styles
|
||||
|
||||
\declarebigtheorem[Satz][Theorem]{thmredmarginandfill}{theorem} \ifmkessler@fancythm@english\else\AtBeginDocument{\def\theoremautorefname{Satz}}\fi
|
||||
\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}
|
||||
|
@ -121,7 +193,7 @@
|
|||
\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 'mkessler@fancythm@numbersmallenvironments' is set
|
||||
% - 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
|
||||
|
||||
|
@ -136,9 +208,9 @@
|
|||
|
||||
%%%% Specially treated stuff
|
||||
|
||||
\declaresmalltheorem[\ifmkessler@fancythm@markoral Mündliche Anmerkung\else Bemerkung\fi][\ifmkessler@fancythm@markoral Oral remark\else remark\fi]{thmyellowmargin}{oral}
|
||||
\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
|
||||
\ifmkessler@fancythm@includeoral\else
|
||||
\if__PACKAGE_PREFIX__includeoral\else
|
||||
\renewenvironment{oral}{\comment}{\endcomment}
|
||||
\renewenvironment{oral*}{\comment}{\endcomment}
|
||||
\renewenvironment{doral}{\comment}{\endcomment}
|
||||
|
@ -168,26 +240,26 @@
|
|||
%%%%%%%%%%%% Non-mdframed theorems
|
||||
|
||||
\theoremstyle{plain}
|
||||
\newtheorem{variant}{\ifmkessler@fancythm@english Variant\else Variante\fi}
|
||||
\newtheorem{assumption}{\ifmkessler@fancythm@english Assumption\else Annahme\fi}
|
||||
\newtheorem{variant}{\if__PACKAGE_PREFIX__english Variant\else Variante\fi}
|
||||
\newtheorem{assumption}{\if__PACKAGE_PREFIX__english Assumption\else Annahme\fi}
|
||||
|
||||
\theoremstyle{definition}
|
||||
\newtheorem*{note}{\ifmkessler@fancythm@english Note\else Anmerkung\fi}
|
||||
\newtheorem*{warning}{\color{red}\ifmkessler@fancythm@english Warning \else Warnung\fi}
|
||||
\newtheorem*{goal}{\ifmkessler@fancythm@english Goal \else Ziel\fi}
|
||||
\newtheorem*{strategy}{\ifmkessler@fancythm@english Proof Strategy \else Beweisstrategie\fi}
|
||||
\newtheorem*{goal*}{\ifmkessler@fancythm@english Goal* \else Ziel*\fi}
|
||||
\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}{\ifmkessler@fancythm@english Answer\else Antwort\fi}
|
||||
\newtheorem{observe}[theorem]{\ifmkessler@fancythm@english Observe\else Beobachte\fi}
|
||||
\newtheorem*{property}{\ifmkessler@fancythm@english Property\else Eigenschaft\fi}
|
||||
\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}{\ifmkessler@fancythm@english Recall\else Erinnerung\fi}
|
||||
\newtheorem*{idea}{\ifmkessler@fancythm@english Idea\else Idee\fi}
|
||||
\newtheorem{exercise}{\ifmkessler@fancythm@english Exercise\else Aufgabe\fi}[section]
|
||||
\newtheorem{reminder}{\ifmkessler@fancythm@english Reminder\else Erinnerung\fi}
|
||||
\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
|
|
@ -1,14 +1,13 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-thmstyle}[2021/09/09 - Styles used for fancythm]
|
||||
|
||||
__HEADER__(Mdframed Styles used for fancythm package)
|
||||
%%%%% This provides easy-to-use styles, especially for use with the
|
||||
|
||||
% A simple option wether to define some default styles
|
||||
\newif\ifmkessler@thmstyle@defaultstyles\mkessler@thmstyle@defaultstylesfalse
|
||||
\DeclareOption{defaultstyles}{\mkessler@thmstyle@defaultstylestrue}
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-thmstyle}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
% 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}
|
||||
|
@ -75,7 +74,7 @@
|
|||
\fi
|
||||
}
|
||||
|
||||
\ifmkessler@thmstyle@defaultstyles
|
||||
__IF__(defaultstyles)
|
||||
\declarefancythmstyle[red!8]{red}[thmredmarginandfill]
|
||||
\declarefancythmstyle[orange!10]{orange}[thmorangemarginandfill]
|
||||
\declarefancythmstyle[blue!7]{blue}[thmbluemarginandfill]
|
|
@ -1,7 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-lectures}[2021-09-06 - Package for managing different lectures within a document]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%
|
||||
__HEADER__(Package for managing different lectures within a document)
|
||||
% The core of the lecture command this package provides has been taken from the preamble in
|
||||
% https://github.com/gillescastel/university-setup
|
||||
% which is licensed under
|
||||
|
@ -29,21 +26,20 @@
|
|||
%SOFTWARE.
|
||||
% This package extends the lecture command to make a summary of lectures at the beginning of a document, and has thus modified this command.
|
||||
|
||||
\newif\ifenglish\englishtrue
|
||||
\DeclareOption{german}{\englishfalse}
|
||||
\DeclareOption{english}{\englishtrue}
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
\newif\iffancyhead\fancyheadfalse
|
||||
\DeclareOption{fancyhead}{\fancyheadtrue}
|
||||
__LANGUAGE_OPTIONS__
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-lectures}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
__NEW_IF__(fancyhead,false)
|
||||
\DeclareOptionX{fancyhead}{__SET_IF__(fancyhead,true)}
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%Tocloft package for making a list of lectures
|
||||
\RequirePackage{tocloft}
|
||||
%Store name of the summary in a command to use it multiple times
|
||||
\newcommand\listlecturename{\ifenglish Summary of lectures\else Übersicht der Vorlesungen\fi}
|
||||
\newlistof{lecture}{lec}{\listlecturename} % Declare new list of lectures
|
||||
\newcommand__PACKAGE_MACRO__(listlecturename){__IF__(english) Summary of lectures\else Übersicht der Vorlesungen\fi}
|
||||
\newlistof{lecture}{lec}{__PACKAGE_MACRO__(listlecturename)} % Declare new list of lectures
|
||||
%Settings how to print the summary
|
||||
\renewcommand{\cftdot}{}
|
||||
\renewcommand\cftlecturefont{\normalfont\bfseries}
|
||||
|
@ -59,19 +55,19 @@
|
|||
}
|
||||
|
||||
%Define the main lecture command to start a new lecture
|
||||
\def\@lectureprefix{\ifenglish Lecture\else Vorlesung\fi}
|
||||
\def__PACKAGE_MACRO__(lectureprefix){__IF__(english) Lecture\else Vorlesung\fi}
|
||||
\def\@lecture{}%
|
||||
\newcommand{\lecture}[3][]{
|
||||
\refstepcounter{lecture}
|
||||
%Store lecture name in the macro \@lecture
|
||||
\ifthenelse{\isempty{#3}}{%
|
||||
\def\@lecture{\@lectureprefix\, \thelecture}%
|
||||
\def\@lecture{__PACKAGE_MACRO__(lectureprefix)\, \thelecture}%
|
||||
}{%
|
||||
\def\@lecture{\@lectureprefix\, \thelecture: #3}%
|
||||
\def\@lecture{__PACKAGE_MACRO__(lectureprefix)\, \thelecture: #3}%
|
||||
}%
|
||||
\marginpar{\small\textsf{\parbox{10em}{\@lectureprefix\, \thelecture \\#2}}}
|
||||
\marginpar{\small\textsf{\parbox{10em}{__PACKAGE_MACRO__(lectureprefix)\, \thelecture \\#2}}}
|
||||
%Add lecture as an entry to the lectures file
|
||||
\addcontentsline{lec}{lecture}{\@lectureprefix\,\thelecture\,(#2)}
|
||||
\addcontentsline{lec}{lecture}{__PACKAGE_MACRO__(lectureprefix)\,\thelecture\,(#2)}
|
||||
%If key words are provided, add the key words of the lecture below the entry
|
||||
\ifthenelse{\isempty{#1}}{}{\addtocontents{lec}{\smallskip\hspace{1.5em}\protect\parbox{\dimexpr\textwidth-\@pnumwidth - 2em}{#1}}}
|
||||
}
|
||||
|
@ -79,13 +75,13 @@
|
|||
%Provide a command to show the summary of lectures
|
||||
\DeclareRobustCommand*{\summaryoflectures}{
|
||||
\phantomsection
|
||||
\addcontentsline{toc}{section}{\listlecturename}
|
||||
\addcontentsline{toc}{section}{__PACKAGE_MACRO__(listlecturename)}
|
||||
\thispagestyle{plain}
|
||||
\listoflecture
|
||||
}
|
||||
|
||||
|
||||
\iffancyhead
|
||||
__IF__(fancyhead)
|
||||
\RequirePackage{fancyhdr}
|
||||
\pagestyle{fancy}
|
||||
|
||||
|
@ -97,9 +93,9 @@
|
|||
\fancyhead[RE,LO]{} % Right even, Left odd
|
||||
|
||||
%%No fancy headers in the appendix (as there is no lecture)
|
||||
\let\mkesslerlecturesoldappendix\appendix
|
||||
\let__PACKAGE_MACRO__(stored@appendix)\appendix
|
||||
\renewcommand\appendix{
|
||||
\mkesslerlecturesoldappendix
|
||||
__PACKAGE_MACRO__(stored@appendix)
|
||||
\fancyhead[RO,LE]{}
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-faktor}[2021-09-06 - Faktor package]
|
||||
%%%%%%%%%%%%%%%%%%
|
||||
__HEADER__(Faktor package that also handles cofaktors)
|
||||
|
||||
% Extension the faktor package for
|
||||
% - cofaktor command that provides A \ B notation
|
||||
|
@ -13,7 +11,6 @@
|
|||
%
|
||||
% This package only packages the corresponding answer and provides an analoguous way of a \cofactor command
|
||||
|
||||
|
||||
%Dependencies
|
||||
\RequirePackage{xparse}
|
||||
\RequirePackage{amssymb} % provides \diagup and \diagdown
|
|
@ -1,17 +1,14 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-math}[2021/03/31 - Math package]
|
||||
%%%%%%Collects the basic math packages used for my lecture-note write-ups
|
||||
__HEADER__(Main math package.)
|
||||
% Collects the basic math packages used for my lecture-note write-ups
|
||||
% This just imports all the packages I use for writing up mathematics
|
||||
% Probably, you will just want to load them separately for more
|
||||
% customization
|
||||
|
||||
%% This just imports all the packages I use for writing up mathematics
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
__LANGUAGE_OPTIONS_X__
|
||||
|
||||
\newif\if@mkessler@math@english\@mkessler@math@englishtrue
|
||||
\DeclareOption{german}{\@mkessler@math@englishfalse}
|
||||
\DeclareOption{ngerman}{\@mkessler@math@englishfalse}
|
||||
\DeclareOption{english}{\@mkessler@math@englishtrue}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-math}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%%%% Import the other custom math packages
|
||||
\RequirePackage{mkessler-mathfont} % Load this first to ensure untouched fonts
|
||||
|
@ -36,7 +33,7 @@
|
|||
\RequirePackage{mkessler-mathsymb}
|
||||
\RequirePackage[basic]{mkessler-mathalias}
|
||||
% mkessler-mathfont has already been imported
|
||||
\RequirePackage[\if@mkessler@math@english english\else german\fi]{mkessler-mathop}
|
||||
\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
|
43
packages/math/mathalias.pysty
Normal file
43
packages/math/mathalias.pysty
Normal file
|
@ -0,0 +1,43 @@
|
|||
__HEADER__(Easy aliasing for math style commands)
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
__NEW_IF__(basic,false)
|
||||
__NEW_IF__(extended,false)
|
||||
|
||||
\DeclareOptionX{basic}{__SET_IF__(basic,true)}
|
||||
\DeclareOptionX{extended}{__SET_IF__(extended,true)__SET_IF__(basic,true)}
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%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
|
||||
% \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.
|
||||
|
||||
\def\makealiasesforwith#1#2#3{
|
||||
\def__PACKAGE_MACRO__(makealias)##1{
|
||||
\expandafter\def\csname #2##1\endcsname{\ensuremath{#1{##1}}}
|
||||
}
|
||||
\def__PACKAGE_MACRO__(recurse)##1{
|
||||
\ifx##1__PACKAGE_MACRO__(dummy)\else
|
||||
__PACKAGE_MACRO__(makealias){##1}\expandafter__PACKAGE_MACRO__(recurse)\fi
|
||||
}
|
||||
__PACKAGE_MACRO__(recurse) #3__PACKAGE_MACRO__(dummy)
|
||||
}
|
||||
|
||||
\def__PACKAGE_MACRO__(all){ABCDEFGHIJKLMNOPQRSTUVWXYZ}
|
||||
|
||||
__IF__(basic)
|
||||
\RequirePackage{amsfonts}
|
||||
\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)}
|
||||
\fi
|
|
@ -1,7 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-mathfig}[2021/03/31 - Math figures with TikZ / pgfplots / xy]
|
||||
|
||||
%%%%%%%%
|
||||
__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
|
||||
|
36
packages/math/mathfixes.pysty
Normal file
36
packages/math/mathfixes.pysty
Normal file
|
@ -0,0 +1,36 @@
|
|||
__HEADER__(Hacky math packages for some (custom@) fixes)
|
||||
% This just brings together some (possibly ugly) hacks that I use when writing math. Likely, you do not want to use this except when building around this package (like I did), or already have similar shortcuts
|
||||
|
||||
%Proper Degree command
|
||||
\def__PACKAGE_MACRO__(degree){\ensuremath{^\circ}}
|
||||
\AtBeginDocument{\let\degree__PACKAGE_MACRO__(degree)}
|
||||
|
||||
% Always put limits under \limit
|
||||
\let\oldlim\lim\def\lim{\oldlim\limits}
|
||||
|
||||
% Print equal sign under subset by default to not confuse people
|
||||
% (I still write \subset, because this enables me remove this renewcommand and have the default \subset command evaluated instead
|
||||
\let__PACKAGE_MACRO__(subseteq)\subseteq
|
||||
\let__PACKAGE_MACRO__(supseteq)\supseteq
|
||||
\AtBeginDocument{
|
||||
\let\subset__PACKAGE_MACRO__(subseteq)
|
||||
\let\supset__PACKAGE_MACRO__(supseteq)
|
||||
}
|
||||
|
||||
%%Renew phi and epsilon to their proper versions, make the old ones available as
|
||||
% uglyphi and uglyepsilon
|
||||
|
||||
\let__PACKAGE_MACRO__(stored@phi)\phi
|
||||
\let__PACKAGE_MACRO__(stored@varphi)\varphi
|
||||
\AtBeginDocument{
|
||||
\let\phi__PACKAGE_MACRO__(stored@varphi)
|
||||
\let\uglyphi__PACKAGE_MACRO__(stored@phi)
|
||||
\let\oldphi__PACKAGE_MACRO__(stored@phi)
|
||||
}
|
||||
|
||||
\let__PACKAGE_MACRO__(stored@epsilon)\epsilon
|
||||
\let__PACKAGE_MACRO__(stored@varepsilon)\varepsilon
|
||||
\AtBeginDocument{
|
||||
\let\epsilon__PACKAGE_MACRO__(stored@varepsilon)
|
||||
\let\uglyepsilon__PACKAGE_MACRO__(stored@epsilon)
|
||||
}
|
24
packages/math/mathfont.pysty
Normal file
24
packages/math/mathfont.pysty
Normal file
|
@ -0,0 +1,24 @@
|
|||
__HEADER__(Collects several math fonts together)
|
||||
%%% Store away the several (partially conflicting) fonts in internal macros
|
||||
|
||||
\let__PACKAGE_MACRO__(none@mathcal)\mathcal
|
||||
|
||||
\RequirePackage{mathrsfs}
|
||||
\let__PACKAGE_MACRO__(mathrsfs@mathscr)\mathscr
|
||||
|
||||
\RequirePackage[mathscr]{eucal}
|
||||
\let__PACKAGE_MACRO__(eucal@optionmathscr@mathscr)\mathscr
|
||||
|
||||
\RequirePackage{amsfonts}
|
||||
\let__PACKAGE_MACRO__(amsfonts@mathfrak)\mathfrak
|
||||
|
||||
%%% Provide user commands to internally stored macros
|
||||
\def__PACKAGE_MACRO__(restorefonts){
|
||||
\let\mathcal__PACKAGE_MACRO__(none@mathcal) % Set \mathcal to default calligrapic
|
||||
\let\mathfrak__PACKAGE_MACRO__(amsfonts@mathfrak) % Set \mathfrak to mathfrak from amsfonts
|
||||
\let\mathscr__PACKAGE_MACRO__(mathrsfs@mathscr) % Set \mathscr to mathscript from mathrsfs package
|
||||
\let\mathcat__PACKAGE_MACRO__(mathrsfs@mathscr) % Set \mathcat to mathscript from mathrsfs package
|
||||
\let\mathcalo__PACKAGE_MACRO__(eucal@optionmathscr@mathscr) % Set \mathcalo (for old calligraphic) to \mathscr from [mathscr]{eucal} package
|
||||
}
|
||||
|
||||
\AtBeginDocument{__PACKAGE_MACRO__(restorefonts)}
|
|
@ -1,13 +1,11 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-mathop}[2021-04-27 - Operator Package]
|
||||
%%%%%%%%%%%%%%%%%
|
||||
__HEADER__(Math Operator Package)
|
||||
%Provides some commonly used Operators used in the write-ups of my lecture notes
|
||||
|
||||
\newif\if@mkessler@operators@english\@mkessler@operators@englishtrue
|
||||
\DeclareOption{german}{\@mkessler@operators@englishfalse}
|
||||
\DeclareOption{english}{\@mkessler@operators@englishtrue}
|
||||
\DeclareOption*{\PackageWarning{mkessler-operators}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
__LANGUAGE_OPTIONS_X__
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%%%%%Package dependencies
|
||||
\RequirePackage{amsmath}
|
||||
|
@ -23,15 +21,15 @@
|
|||
|
||||
%%%For distributions
|
||||
%Introduce synonym for \operatorname
|
||||
\newcommand\mkessler@operators@distribution[1]{\operatorname{#1}}
|
||||
\newcommand__PACKAGE_MACRO__(distribution)[1]{\operatorname{#1}}
|
||||
%Easily declare new distributions
|
||||
\newcommand\DeclareDistribution[1]{\expandafter\def\csname #1\endcsname{\mkessler@operators@distribution{#1}}}
|
||||
\newcommand\DeclareDistribution[1]{\expandafter\def\csname #1\endcsname{__PACKAGE_MACRO__(distribution){#1}}}
|
||||
|
||||
%%%For categories
|
||||
%Introduce synonym for \operatorname
|
||||
\newcommand\mkessler@operators@category[1]{\operatorname{\textbf{#1}}}
|
||||
\newcommand__PACKAGE_MACRO__(category)[1]{\operatorname{\textbf{#1}}}
|
||||
%Easily declare new categories
|
||||
\newcommand\DeclareCategory[1]{\expandafter\def\csname #1\endcsname{\mkessler@operators@category{#1}}}
|
||||
\newcommand\DeclareCategory[1]{\expandafter\def\csname #1\endcsname{__PACKAGE_MACRO__(category){#1}}}
|
||||
|
||||
|
||||
%%%%%%%%%%% Operators
|
||||
|
@ -51,27 +49,27 @@
|
|||
% \lcm would print 'kgV'
|
||||
% The starred versions of the four commands will ignore the language option and print their
|
||||
% exact names (without the *, of course)
|
||||
\DeclareMathOperator{\@mkessler@operators@ggT}{ggT}
|
||||
\DeclareMathOperator{\@@mkessler@operators@ggT}{\if@mkessler@operators@english gcd\else ggT\fi}
|
||||
\def\ggT{\@ifstar\@mkessler@operators@ggT\@@mkessler@operators@ggT}
|
||||
\DeclareMathOperator{\@__PACKAGE_PREFIX__ggT}{ggT}
|
||||
\DeclareMathOperator{\@@__PACKAGE_PREFIX__ggT}{\if@__PACKAGE_PREFIX__english gcd\else ggT\fi}
|
||||
\def\ggT{\@ifstar\@__PACKAGE_PREFIX__ggT\@@__PACKAGE_PREFIX__ggT}
|
||||
|
||||
\DeclareMathOperator{\@mkessler@operators@gcd}{gcd}
|
||||
\DeclareMathOperator{\@@mkessler@operators@gcd}{\if@mkessler@operators@english gcd\else ggT\fi}
|
||||
\def\gcd{\@ifstar\@mkessler@operators@gcd\@@mkessler@operators@gcd}
|
||||
\DeclareMathOperator{\@__PACKAGE_PREFIX__gcd}{gcd}
|
||||
\DeclareMathOperator{\@@__PACKAGE_PREFIX__gcd}{\if@__PACKAGE_PREFIX__english gcd\else ggT\fi}
|
||||
\def\gcd{\@ifstar\@__PACKAGE_PREFIX__gcd\@@__PACKAGE_PREFIX__gcd}
|
||||
|
||||
\DeclareMathOperator{\@mkessler@operators@kgV}{kgV}
|
||||
\DeclareMathOperator{\@@mkessler@operators@kgV}{\if@mkessler@operators@english lcm\else kgV\fi}
|
||||
\def\kgV{\@ifstar\@mkessler@operators@kgV\@@mkessler@operators@kgV}
|
||||
\DeclareMathOperator{\@__PACKAGE_PREFIX__kgV}{kgV}
|
||||
\DeclareMathOperator{\@@__PACKAGE_PREFIX__kgV}{\if@__PACKAGE_PREFIX__english lcm\else kgV\fi}
|
||||
\def\kgV{\@ifstar\@__PACKAGE_PREFIX__kgV\@@__PACKAGE_PREFIX__kgV}
|
||||
|
||||
\DeclareMathOperator{\@mkessler@operators@lcm}{lcm}
|
||||
\DeclareMathOperator{\@@mkessler@operators@lcm}{\if@mkessler@operators@english lcm\else kgV\fi}
|
||||
\def\lcm{\@ifstar\@mkessler@operators@lcm\@@mkessler@operators@lcm}
|
||||
\DeclareMathOperator{\@__PACKAGE_PREFIX__lcm}{lcm}
|
||||
\DeclareMathOperator{\@@__PACKAGE_PREFIX__lcm}{\if@__PACKAGE_PREFIX__english lcm\else kgV\fi}
|
||||
\def\lcm{\@ifstar\@__PACKAGE_PREFIX__lcm\@@__PACKAGE_PREFIX__lcm}
|
||||
|
||||
%Complex numbers
|
||||
\DeclareMathOperator{\mkessler@impart}{Im}
|
||||
\renewcommand\Im\mkessler@impart
|
||||
\DeclareMathOperator{\mkessler@repart}{Re}
|
||||
\renewcommand\Re\mkessler@impart
|
||||
\DeclareMathOperator{__PACKAGE_MACRO__(impart)}{Im}
|
||||
\renewcommand\Im__PACKAGE_MACRO__(impart)
|
||||
\DeclareMathOperator{__PACKAGE_MACRO__(repart)}{Re}
|
||||
\renewcommand\Re__PACKAGE_MACRO__(repart)
|
||||
|
||||
%Linear Algebra
|
||||
\DeclareSimpleMathOperator{Sym}
|
|
@ -1,15 +1,9 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-mathsymb}[2021-09-06 - Some extra math-related symbols]
|
||||
|
||||
%%%%%%%%%%%%%%%%%%
|
||||
__HEADER__(Some extra math-related symbols.)
|
||||
% A collection of math-related symbols / tools I often use, mainly collected together from Stack Overflow or hacked together myself
|
||||
|
||||
|
||||
%Dependencies
|
||||
\RequirePackage{tikz}
|
||||
|
||||
|
||||
|
||||
% noloc command by
|
||||
% user 'egreg' (https://tex.stackexchange.com/users/4427/egreg)
|
||||
% posted on
|
|
@ -1,8 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-unicodechar}[2021/09/08 - Wrapper for the newunicodchar package with defined unicode symbols]
|
||||
|
||||
%%%%%%%%
|
||||
|
||||
__HEADER__(Wrapper for the newunicodechare package with some defined unicode symbols.)
|
||||
% This is just a simple package loading the newunicodechar package and defining the common unicode symbols i regularly use for typesetting mathematics
|
||||
|
||||
\RequirePackage{newunicodechar}
|
24
packages/misc/hypersetup.pysty
Normal file
24
packages/misc/hypersetup.pysty
Normal file
|
@ -0,0 +1,24 @@
|
|||
__HEADER__(Package for setting up hyperref, cleveref and some default hyperref colors)
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
__NEW_IF__(cleveref,false)
|
||||
\DeclareOptionX{cleveref}{__SET_IF__(cleveref,true)}
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%%%Hyperref and setup
|
||||
\RequirePackage{xcolor} % To compute the colors below
|
||||
\RequirePackage{etoolbox} % Checking for defined commands
|
||||
|
||||
\def__PACKAGE_MACRO__(exec){
|
||||
\RequirePackage{hyperref} % Hyperlinks
|
||||
__IF__(cleveref)
|
||||
\RequirePackage{cleveref} % Better referencing
|
||||
\fi
|
||||
\hypersetup{colorlinks, citecolor=violet, urlcolor=blue!80!black, linkcolor=red!50!black, pdfauthor=\@author, pdftitle=\ifdef{\@course}{\@course}{\@title}}
|
||||
}
|
||||
|
||||
\AtEndPreamble{
|
||||
__PACKAGE_MACRO__(exec)
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{castel-incfig}[2021-09-06 - Figure support for inkscape figures by Gilles Castell]
|
||||
__HEADER__(Figure support for inkscape figures by Gilles Castell)
|
||||
|
||||
%%%%%%%%
|
||||
% This is just a small package bundling the figure support for the inkscape figures by Gilles Castel. The setup can be originally found in the preamble
|
41
packages/misc/vocab.pysty
Normal file
41
packages/misc/vocab.pysty
Normal file
|
@ -0,0 +1,41 @@
|
|||
__HEADER__(Package for emphasizing vocabulary)
|
||||
%%Provides a \vocab<[name in index]>{vocabulary} command to print vocabulary in bold blue and automatically index it.
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
__LANGUAGE_OPTIONS_X__
|
||||
__NEW_IF__(index,false)
|
||||
|
||||
\DeclareOptionX{index}{__SET_IF__(index,true)}
|
||||
\DeclareOptionX{noindex}{__SET_IF__(index,false)}
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%%%%Management of vocabulary and corresponding index
|
||||
\RequirePackage{xparse}
|
||||
\RequirePackage{xcolor}
|
||||
__IF__(index)
|
||||
\RequirePackage{imakeidx}
|
||||
\makeindex[name=vocabindex, columns=2, title=__IF__(english) Index\else Stichwortverzeichnis\fi, intoc]
|
||||
|
||||
%Emphasize \vocabulary
|
||||
\RequirePackage{expl3}
|
||||
\ExplSyntaxOn
|
||||
\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
|
||||
\index[vocabindex]{#1} % false branch: #1 was supplied
|
||||
\fi
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
\newcommand\printvocabindex{
|
||||
\printindex[vocabindex]
|
||||
}
|
||||
\else
|
||||
\NewDocumentCommand{\vocab}{O{} m }{
|
||||
\textbf{\color{blue} #2}
|
||||
}
|
||||
\fi
|
||||
|
13
packages/utils/counters.pysty
Normal file
13
packages/utils/counters.pysty
Normal file
|
@ -0,0 +1,13 @@
|
|||
__HEADER__(Write LaTeX counters to auxiliary file)
|
||||
|
||||
\RequirePackage{etoolbox}
|
||||
|
||||
\newwrite__PACKAGE_MACRO__(out)
|
||||
\immediate\openout__PACKAGE_MACRO__(out)\jobname.cnt\relax
|
||||
\AtBeginDocument{
|
||||
\let__PACKAGE_MACRO__(saved@stepcounter)\stepcounter
|
||||
\def\stepcounter#1{
|
||||
__PACKAGE_MACRO__(saved@stepcounter){#1}
|
||||
\immediate\write__PACKAGE_MACRO__(out){#1: \csname the#1\endcsname}}
|
||||
}
|
||||
|
|
@ -1,8 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-findpackage}[2021-09-06 - Find a package that provides some command]
|
||||
|
||||
|
||||
%%%%
|
||||
__HEADER__(Find a package that provides some command)
|
||||
% This is just a quick packaging of the post by
|
||||
% 'Martin Nyolt' (https://tex.stackexchange.com/users/78783/martin-nyolt)
|
||||
% found at
|
32
packages/wip/bibliography.pysty
Normal file
32
packages/wip/bibliography.pysty
Normal file
|
@ -0,0 +1,32 @@
|
|||
__HEADER__(Package to easily print bibliography and image attributions in document)
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
__LANGUAGE_OPTIONS__
|
||||
|
||||
\def__PACKAGE_MACRO__(bibfile){bibliography.bib}
|
||||
\def__PACKAGE_MACRO__(imagefile){images.bib}
|
||||
\DeclareOptionX{bibfile}[bibliography.bib]{\def__PACKAGE_MACRO__(bibfile){#1}}
|
||||
\DeclareOptionX{imagefile}[images.bib]{\def__PACKAGE_MACRO__(imagefile){#1}}
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
%%%%Bibliography management
|
||||
\RequirePackage[backend=biber,style=alphabetic]{biblatex}
|
||||
\addbibresource{__PACKAGE_MACRO__(bibfile)}
|
||||
\addbibresource{__PACKAGE_MACRO__(imagefile)}
|
||||
|
||||
%Provide simpler commands to properly print image attributions and literature
|
||||
\DeclareRobustCommand*{\printimageattributions}{
|
||||
\def\imageattributionstitle{\ifenglish Image attributions \else Bildquellen\fi}
|
||||
\phantomsection
|
||||
\addcontentsline{toc}{section}{\imageattributionstitle}
|
||||
\printbibliography[title={\imageattributionstitle}, type=image]
|
||||
}
|
||||
|
||||
\DeclareRobustCommand*{\printliterature}{
|
||||
\def\literaturetitle{\ifenglish Literature\else Literatur\fi}
|
||||
\phantomsection
|
||||
\addcontentsline{toc}{section}{\literaturetitle}
|
||||
\printbibliography[title={\literaturetitle}, nottype=image]
|
||||
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-enumerate}
|
||||
__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}}
|
||||
}
|
||||
|
24
packages/wip/exsheet.pysty
Normal file
24
packages/wip/exsheet.pysty
Normal file
|
@ -0,0 +1,24 @@
|
|||
__HEADER__(Include exercise sheets into lecture notes easily.)
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
__LANGUAGE_OPTIONS__
|
||||
|
||||
__END_OPTIONS__
|
||||
|
||||
\RequirePackage{mkessler-fancythm}
|
||||
|
||||
\newcounter{__PACKAGE_PREFIX__sheet}
|
||||
|
||||
\declaretheorem[style=thmgreenmargin, numberwithin=__PACKAGE_PREFIX__sheet, name=__IF__(english) Exercise\else Aufgabe\fi]{__PACKAGE_PREFIX__aufgabe}
|
||||
|
||||
\usepackage{xkeyval}
|
||||
|
||||
\NewDocumentEnvironment{aufgabe}{O{}}{
|
||||
\begin{__PACKAGE_PREFIX__aufgabe\expandafter}\if\relax\detokenize{#1}\relax\else[#1]\fi\label{aufgabe-\the__PACKAGE_PREFIX__aufgabe}
|
||||
}{
|
||||
\end{__PACKAGE_PREFIX__aufgabe\expandafter}\relax
|
||||
}
|
||||
|
||||
\newcommand\blatt{\refstepcounter{__PACKAGE_PREFIX__sheet}\subsection*{\the__PACKAGE_PREFIX__sheet. Übungsblatt}\addcontentsline{toc}{subsection}{\the__PACKAGE_PREFIX__sheet. Übungsblatt}}
|
||||
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-figures}
|
||||
__HEADER__(Packages related to inclusion of figures.)
|
||||
|
||||
\RequirePackage{caption}
|
||||
\RequirePackage{subcaption}
|
16
packages/wip/gag.pysty
Normal file
16
packages/wip/gag.pysty
Normal file
|
@ -0,0 +1,16 @@
|
|||
__HEADER__(Numbering of environments with a fractional environment number)
|
||||
% For the stack exchange source, see
|
||||
% https://tex.stackexchange.com/questions/598076/how-to-have-a-fractional-environment-number/598080?noredirect=1#comment1499689_598080
|
||||
% However, for a reason i don't understand the posted answer does not work for me, but i had to replace theorem with definition in the definition of the gag environment (so apparently, i have to do this for each environment separately). It seems that the definitions of this document do use \thedefinition and not \thetheorem, although by default this is not the case.
|
||||
|
||||
\newcounter{gag}
|
||||
\makeatletter
|
||||
\newenvironment{gag}[1]{%
|
||||
\let\savedthedefinition\thedefinition
|
||||
\thm@headfont{\bfseries\boldmath}%
|
||||
\stepcounter{gag}%
|
||||
\renewcommand{\thedefinition}{\savedthedefinition#1}%
|
||||
\renewcommand{\theHdefinition}{gag\thegag}%
|
||||
\addtocounter{definition}{-1}\ignorespaces
|
||||
}{\ignorespacesafterend}
|
||||
\makeatother
|
|
@ -1,4 +1,4 @@
|
|||
% Input / encoding
|
||||
__HEADER__(Packages related to language input. Still work in progress, not intended for use.)
|
||||
\RequirePackage[\ifutf utf8\else utf8x\fi]{inputenc}
|
||||
\RequirePackage[T1]{fontenc}
|
||||
|
96
packages/wip/proof.pysty
Normal file
96
packages/wip/proof.pysty
Normal 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}}
|
|
@ -1,4 +1,4 @@
|
|||
% Quotations
|
||||
__HEADER__((For now) removed parts of other packages. Not intended for use right now.)% Quotations
|
||||
\RequirePackage{csquotes} % quotations
|
||||
|
||||
%%%% Utilities
|
37
packages/wip/restate.pysty
Normal file
37
packages/wip/restate.pysty
Normal file
|
@ -0,0 +1,37 @@
|
|||
__HEADER__(Replacement package)
|
||||
\RequirePackage{xkeyval}
|
||||
\RequirePackage{todonotes}
|
||||
\RequirePackage{xparse}
|
||||
\RequirePackage{etoolbox}
|
||||
|
||||
__NEW_IF__(english, true)
|
||||
\DeclareOptionX{english}{__SET_IF__(english,true)}
|
||||
\DeclareOptionX{german}{__SET_IF__(english,false)}
|
||||
\DeclareOptionX{ngerman}{__SET_IF__(english,false)}
|
||||
|
||||
\define@boolkey+{__FILE_NAME__}[__PACKAGE_PREFIX__]{strict}[true]{
|
||||
\if__PACKAGE_PREFIX__strict
|
||||
__INFO__(Strict mode enabled. Undefined restates will throw errors.)%
|
||||
\else
|
||||
__INFO__(Strict mode disabled. Undefined restates will now print placeholder boxes)%
|
||||
\fi
|
||||
}{
|
||||
__WARNING__(Erroneous input to key 'strict' ignored. Provide =true or =false.)
|
||||
}
|
||||
|
||||
__END_OPTIONS_X__
|
||||
|
||||
\newcommand\restatesetup[1]{\setkeys{__FILE_NAME__}{#1}}
|
||||
|
||||
|
||||
\NewDocumentCommand{\restatetheorem}{s m}{
|
||||
\ifcsdef{#2}{
|
||||
\ifx#1\BooleanTrue\csname#2\endcsname*\else\csname#2\endcsname\fi
|
||||
}{
|
||||
__IF__(strict)
|
||||
\PackageError{__PACKAGE_NAME__}{Strict mode enabled but restate command not defined}{The theorem you tried to restate is not defined. Either make sure it is so that it can be printed or disable the strict mode with \noexpand\restatesetup{strict=false} to print a placeholder instead}
|
||||
\else
|
||||
\missingfigure{__IF__(english) Here theorem \textbf{#2} is missing, since it is not part of this document.\else Hier fehlt die Wiederholung von Satz \textbf{#2}, der nicht Teil dieses Dokumentes ist.\fi}
|
||||
\fi
|
||||
}
|
||||
}
|
11
tests/.gitignore
vendored
Normal file
11
tests/.gitignore
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
*.aux
|
||||
*.fdb_latexmk
|
||||
*.fls
|
||||
*.log
|
||||
*.pdf
|
||||
wip/proof/.skip
|
||||
*.out
|
||||
*.idx
|
||||
*.ilg
|
||||
*.ind
|
||||
*.cnt
|
3
tests/COMPILE_MAKEFILE
Normal file
3
tests/COMPILE_MAKEFILE
Normal file
|
@ -0,0 +1,3 @@
|
|||
test:
|
||||
latexmk -dvi- -pdf -gg -Werror -latexoption=-interaction=nonstopmode test.tex
|
||||
latexmk -c test.tex
|
7
tests/DIR_MAKEFILE
Normal file
7
tests/DIR_MAKEFILE
Normal file
|
@ -0,0 +1,7 @@
|
|||
SUBDIRS := $(wildcard */.)
|
||||
|
||||
all: $(SUBDIRS)
|
||||
$(SUBDIRS):
|
||||
$(MAKE) -C $@
|
||||
|
||||
.PHONY: all $(SUBDIRS)
|
1
tests/Makefile
Symbolic link
1
tests/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
DIR_MAKEFILE
|
1
tests/environments/Makefile
Symbolic link
1
tests/environments/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../DIR_MAKEFILE
|
1
tests/environments/fancythm/Makefile
Symbolic link
1
tests/environments/fancythm/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
65
tests/environments/fancythm/test.tex
Normal file
65
tests/environments/fancythm/test.tex
Normal file
|
@ -0,0 +1,65 @@
|
|||
\documentclass[a4paper, german]{article}
|
||||
|
||||
\usepackage[lecture numbers = false, number all, number small environments = section]{mkessler-fancythm}
|
||||
|
||||
|
||||
\begin{document}
|
||||
\begin{theorem}[Name]\label{test}
|
||||
test
|
||||
\end{theorem}
|
||||
\begin{definition**}
|
||||
test
|
||||
\end{definition**}
|
||||
|
||||
\ref{test}
|
||||
|
||||
\begin{theorem}
|
||||
test
|
||||
\end{theorem}
|
||||
|
||||
\mdfsetup{skipabove=8pt,skipbelow=\topskip, bottomline=true}
|
||||
\begin{lemma}
|
||||
|
||||
\end{lemma}
|
||||
|
||||
\begin{example}
|
||||
|
||||
\end{example}
|
||||
|
||||
\begin{praise}
|
||||
test
|
||||
\end{praise}
|
||||
|
||||
\begin{remark}
|
||||
test
|
||||
\end{remark}
|
||||
|
||||
\begin{notation}
|
||||
test
|
||||
\end{notation}
|
||||
|
||||
\begin{abuse}
|
||||
test
|
||||
\end{abuse}
|
||||
|
||||
\begin{theoremdef}
|
||||
|
||||
\end{theoremdef}
|
||||
|
||||
\begin{fact}
|
||||
test
|
||||
\end{fact}
|
||||
|
||||
\begin{orga}
|
||||
|
||||
\end{orga}
|
||||
|
||||
\begin{question}
|
||||
|
||||
\end{question}
|
||||
|
||||
\begin{oral}
|
||||
test
|
||||
\end{oral}
|
||||
|
||||
\end{document}
|
1
tests/lecture-notes/Makefile
Symbolic link
1
tests/lecture-notes/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../DIR_MAKEFILE
|
1
tests/lecture-notes/lectures/Makefile
Symbolic link
1
tests/lecture-notes/lectures/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
4
tests/lecture-notes/lectures/test.lec
Normal file
4
tests/lecture-notes/lectures/test.lec
Normal file
|
@ -0,0 +1,4 @@
|
|||
\contentsline {lecture}{Lecture\,1\,(date)}{1}%
|
||||
\vspace \smallskipamount \hspace {1.5em}\parbox {\dimexpr \textwidth -1.55em- 2em}{Some keywords}
|
||||
\contentsline {lecture}{Lecture\,2\,(date)}{2}%
|
||||
\vspace \smallskipamount \hspace {1.5em}\parbox {\dimexpr \textwidth -1.55em- 2em}{Some other keywords}
|
17
tests/lecture-notes/lectures/test.tex
Normal file
17
tests/lecture-notes/lectures/test.tex
Normal file
|
@ -0,0 +1,17 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-lectures}
|
||||
\usepackage{blindtext}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\summaryoflectures
|
||||
|
||||
\lecture[Some keywords]{date}{title}
|
||||
\blindtext
|
||||
|
||||
\newpage
|
||||
\lecture[Some other keywords]{date}{title 2}
|
||||
\blindtext
|
||||
|
||||
\end{document}
|
1
tests/math/Makefile
Symbolic link
1
tests/math/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../DIR_MAKEFILE
|
1
tests/math/faktor/Makefile
Symbolic link
1
tests/math/faktor/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
16
tests/math/faktor/test.tex
Normal file
16
tests/math/faktor/test.tex
Normal file
|
@ -0,0 +1,16 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-faktor}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\[
|
||||
\faktor{A}{B} \cong \cofaktor{A}{B}
|
||||
\]
|
||||
\[
|
||||
\faktor{A}[1]{B}[-1.5] \cong \cofaktor{A}[-1]{B}[0.5]
|
||||
\]
|
||||
\[
|
||||
\cofaktor*{A}[-1]{B}[2] = x
|
||||
\]
|
||||
\end{document}
|
1
tests/math/math/Makefile
Symbolic link
1
tests/math/math/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
17
tests/math/math/test.tex
Normal file
17
tests/math/math/test.tex
Normal file
|
@ -0,0 +1,17 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-math}
|
||||
|
||||
\begin{document}
|
||||
\[
|
||||
\Gal \Quot \PreSh \tensor \Var \Br \Set \CHaus \cfun \One \left\lfloor \frac{1}{\frac{3}{\frac{7}{8}}} \right\rfloor \abs{\frac{1}{\frac{8}{\frac{4}{3}}}} \lVert \frac{a}{\frac{b}{c}} \rVert \left< \frac{a}{\frac{b}{c}} \right> \norm{\frac{a}{\frac{b}{c}}} \norm{test} \norm{\frac{a}{\frac{b}{c}}}
|
||||
\]
|
||||
\[
|
||||
\C \F \K \R \Z \Q
|
||||
\]
|
||||
\begin{IEEEeqnarray*}{rCl}
|
||||
A & = & b \\
|
||||
& = & c
|
||||
\end{IEEEeqnarray*}
|
||||
|
||||
\end{document}
|
1
tests/math/mathalias/Makefile
Symbolic link
1
tests/math/mathalias/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
15
tests/math/mathalias/test.tex
Normal file
15
tests/math/mathalias/test.tex
Normal file
|
@ -0,0 +1,15 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage[extended]{mkessler-mathalias}
|
||||
|
||||
\begin{document}
|
||||
\[
|
||||
\C\F\K\N\Q\R\Z
|
||||
\]
|
||||
\[
|
||||
\cA\cB\cC\cD \cZ
|
||||
\]
|
||||
\[
|
||||
\fA \fB \fZ
|
||||
\]
|
||||
\end{document}
|
1
tests/math/mathfig/Makefile
Symbolic link
1
tests/math/mathfig/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
16
tests/math/mathfig/test.tex
Normal file
16
tests/math/mathfig/test.tex
Normal file
|
@ -0,0 +1,16 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-mathfig}
|
||||
|
||||
\begin{document}
|
||||
test
|
||||
\[
|
||||
\begin{tikzcd}
|
||||
A \ar{r} & B
|
||||
\end{tikzcd}
|
||||
\]
|
||||
test2:
|
||||
\begin{tikzpicture}
|
||||
\draw (0,0) rectangle (10,10);
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
1
tests/math/mathfixes/Makefile
Symbolic link
1
tests/math/mathfixes/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
11
tests/math/mathfixes/test.tex
Normal file
11
tests/math/mathfixes/test.tex
Normal file
|
@ -0,0 +1,11 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-mathfixes}
|
||||
|
||||
\begin{document}
|
||||
Dies ist nur ein Test:
|
||||
Es ist 1\degree{} warm.
|
||||
\[
|
||||
a \varphi \epsilon \uglyphi \uglyepsilon \subset \supset \frac{\lim_{x\to \infty}}{}
|
||||
\]
|
||||
\end{document}
|
1
tests/math/mathfont/Makefile
Symbolic link
1
tests/math/mathfont/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
32
tests/math/mathfont/test.tex
Normal file
32
tests/math/mathfont/test.tex
Normal file
|
@ -0,0 +1,32 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-mathfont}
|
||||
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
|
||||
|
||||
\begin{document}
|
||||
cal com cat frak scr
|
||||
\def\letters{ABCDEFGHIJKLMNOPQRSTUXWXYZ}
|
||||
\[
|
||||
\mathcal{A} \mathcat{A} \mathfrak{A} \mathscr{A}
|
||||
\]
|
||||
mathcalo
|
||||
\[
|
||||
\expandafter\mathcalo\expandafter{\letters}
|
||||
\]
|
||||
mathcal
|
||||
\[
|
||||
\expandafter\mathcal\expandafter{\letters}
|
||||
\]
|
||||
neue kalligraphie
|
||||
\[
|
||||
\expandafter\mathpzc\expandafter{\letters} ABC
|
||||
\]
|
||||
mathscr
|
||||
\[
|
||||
\expandafter\mathscr\expandafter{\letters}
|
||||
\]
|
||||
mathfrak
|
||||
\[
|
||||
\expandafter\mathfrak\expandafter{\letters}\mathfrak{p}\mathfrak{q}
|
||||
\]
|
||||
\end{document}
|
1
tests/math/mathop/Makefile
Symbolic link
1
tests/math/mathop/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
9
tests/math/mathop/test.tex
Normal file
9
tests/math/mathop/test.tex
Normal file
|
@ -0,0 +1,9 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-mathop}
|
||||
|
||||
\begin{document}
|
||||
\[
|
||||
\Gal \Quot \PreSh \tensor \Var \Br \Set \CHaus \cfun \One \left\lfloor \frac{1}{\frac{3}{\frac{7}{8}}} \right\rfloor \abs{\frac{1}{\frac{8}{\frac{4}{3}}}} \lVert \frac{a}{\frac{b}{c}} \rVert \left< \frac{a}{\frac{b}{c}} \right> \norm{\frac{a}{\frac{b}{c}}} \norm{test} \norm{\frac{a}{\frac{b}{c}}}
|
||||
\]
|
||||
\end{document}
|
1
tests/math/mathsymb/Makefile
Symbolic link
1
tests/math/mathsymb/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
19
tests/math/mathsymb/test.tex
Normal file
19
tests/math/mathsymb/test.tex
Normal file
|
@ -0,0 +1,19 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-mathsymb}
|
||||
|
||||
\begin{document}
|
||||
\[
|
||||
f \colon A \to B
|
||||
\]
|
||||
|
||||
\[
|
||||
B \leftarrow A \noloc f
|
||||
\]
|
||||
|
||||
\contra
|
||||
|
||||
\Warning widerspruch!
|
||||
|
||||
\circled{1} test.
|
||||
\end{document}
|
1
tests/math/unicodechar/Makefile
Symbolic link
1
tests/math/unicodechar/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
7
tests/math/unicodechar/test.tex
Normal file
7
tests/math/unicodechar/test.tex
Normal file
|
@ -0,0 +1,7 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-unicodechar}
|
||||
|
||||
\begin{document}
|
||||
Das griechische Alphabet αβγδεζετικλμνξοπρστυφχψω
|
||||
\end{document}
|
1
tests/misc/Makefile
Symbolic link
1
tests/misc/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../DIR_MAKEFILE
|
1
tests/misc/hypersetup/Makefile
Symbolic link
1
tests/misc/hypersetup/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
20
tests/misc/hypersetup/test.bbl
Normal file
20
tests/misc/hypersetup/test.bbl
Normal file
|
@ -0,0 +1,20 @@
|
|||
% $ biblatex auxiliary file $
|
||||
% $ biblatex bbl format version 3.1 $
|
||||
% Do not modify the above lines!
|
||||
%
|
||||
% This is an auxiliary file used by the 'biblatex' package.
|
||||
% This file may safely be deleted. It will be recreated by
|
||||
% biber as required.
|
||||
%
|
||||
\begingroup
|
||||
\makeatletter
|
||||
\@ifundefined{ver@biblatex.sty}
|
||||
{\@latex@error
|
||||
{Missing 'biblatex' package}
|
||||
{The bibliography requires the 'biblatex' package.}
|
||||
\aftergroup\endinput}
|
||||
{}
|
||||
\endgroup
|
||||
|
||||
\endinput
|
||||
|
86
tests/misc/hypersetup/test.run.xml
Normal file
86
tests/misc/hypersetup/test.run.xml
Normal file
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<!-- logreq request file -->
|
||||
<!-- logreq version 1.0 / dtd version 1.0 -->
|
||||
<!-- Do not edit this file! -->
|
||||
<!DOCTYPE requests [
|
||||
<!ELEMENT requests (internal | external)*>
|
||||
<!ELEMENT internal (generic, (provides | requires)*)>
|
||||
<!ELEMENT external (generic, cmdline?, input?, output?, (provides | requires)*)>
|
||||
<!ELEMENT cmdline (binary, (option | infile | outfile)*)>
|
||||
<!ELEMENT input (file)+>
|
||||
<!ELEMENT output (file)+>
|
||||
<!ELEMENT provides (file)+>
|
||||
<!ELEMENT requires (file)+>
|
||||
<!ELEMENT generic (#PCDATA)>
|
||||
<!ELEMENT binary (#PCDATA)>
|
||||
<!ELEMENT option (#PCDATA)>
|
||||
<!ELEMENT infile (#PCDATA)>
|
||||
<!ELEMENT outfile (#PCDATA)>
|
||||
<!ELEMENT file (#PCDATA)>
|
||||
<!ATTLIST requests
|
||||
version CDATA #REQUIRED
|
||||
>
|
||||
<!ATTLIST internal
|
||||
package CDATA #REQUIRED
|
||||
priority (9) #REQUIRED
|
||||
active (0 | 1) #REQUIRED
|
||||
>
|
||||
<!ATTLIST external
|
||||
package CDATA #REQUIRED
|
||||
priority (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8) #REQUIRED
|
||||
active (0 | 1) #REQUIRED
|
||||
>
|
||||
<!ATTLIST provides
|
||||
type (static | dynamic | editable) #REQUIRED
|
||||
>
|
||||
<!ATTLIST requires
|
||||
type (static | dynamic | editable) #REQUIRED
|
||||
>
|
||||
<!ATTLIST file
|
||||
type CDATA #IMPLIED
|
||||
>
|
||||
]>
|
||||
<requests version="1.0">
|
||||
<internal package="biblatex" priority="9" active="0">
|
||||
<generic>latex</generic>
|
||||
<provides type="dynamic">
|
||||
<file>test.bcf</file>
|
||||
</provides>
|
||||
<requires type="dynamic">
|
||||
<file>test.bbl</file>
|
||||
</requires>
|
||||
<requires type="static">
|
||||
<file>blx-dm.def</file>
|
||||
<file>blx-compat.def</file>
|
||||
<file>biblatex.def</file>
|
||||
<file>standard.bbx</file>
|
||||
<file>alphabetic.bbx</file>
|
||||
<file>alphabetic.cbx</file>
|
||||
<file>biblatex.cfg</file>
|
||||
<file>english.lbx</file>
|
||||
</requires>
|
||||
</internal>
|
||||
<external package="biblatex" priority="5" active="0">
|
||||
<generic>biber</generic>
|
||||
<cmdline>
|
||||
<binary>biber</binary>
|
||||
<infile>test</infile>
|
||||
</cmdline>
|
||||
<input>
|
||||
<file>test.bcf</file>
|
||||
</input>
|
||||
<output>
|
||||
<file>test.bbl</file>
|
||||
</output>
|
||||
<provides type="dynamic">
|
||||
<file>test.bbl</file>
|
||||
</provides>
|
||||
<requires type="dynamic">
|
||||
<file>test.bcf</file>
|
||||
</requires>
|
||||
<requires type="editable">
|
||||
<file>bibliography.bib</file>
|
||||
<file>images.bib</file>
|
||||
</requires>
|
||||
</external>
|
||||
</requests>
|
16
tests/misc/hypersetup/test.tex
Normal file
16
tests/misc/hypersetup/test.tex
Normal file
|
@ -0,0 +1,16 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage[cleveref]{mkessler-hypersetup}
|
||||
|
||||
\title{Geometrie}
|
||||
\author{Maximilian Keßler}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
test
|
||||
|
||||
\section{test}
|
||||
\label{foo}
|
||||
|
||||
\Cref{foo} test.
|
||||
\end{document}
|
1
tests/misc/vocab/Makefile
Symbolic link
1
tests/misc/vocab/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
11
tests/misc/vocab/test.tex
Normal file
11
tests/misc/vocab/test.tex
Normal file
|
@ -0,0 +1,11 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage[index]{mkessler-vocab}
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
\section{beg}\label{foo}
|
||||
\vocab{test} test.
|
||||
\printvocabindex
|
||||
\end{document}
|
1
tests/utils/Makefile
Symbolic link
1
tests/utils/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../DIR_MAKEFILE
|
1
tests/utils/counters/Makefile
Symbolic link
1
tests/utils/counters/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
12
tests/utils/counters/test.cnt
Normal file
12
tests/utils/counters/test.cnt
Normal file
|
@ -0,0 +1,12 @@
|
|||
subparagraph: 1.0.0.0.0
|
||||
paragraph: 1.0.0.0
|
||||
subsubsection: 1.0.0
|
||||
subsection: 1.0
|
||||
section: 1
|
||||
subparagraph: 2.0.0.0.0
|
||||
paragraph: 2.0.0.0
|
||||
subsubsection: 2.0.0
|
||||
subsection: 2.0
|
||||
section: 2
|
||||
dummy: 1
|
||||
page: 2
|
15
tests/utils/counters/test.tex
Normal file
15
tests/utils/counters/test.tex
Normal file
|
@ -0,0 +1,15 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage{mkessler-counters}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\section{test}
|
||||
|
||||
\section{test}
|
||||
|
||||
\newcounter{dummy}
|
||||
\refstepcounter{dummy}
|
||||
|
||||
|
||||
\end{document}
|
1
tests/utils/findpackage/Makefile
Symbolic link
1
tests/utils/findpackage/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
10
tests/utils/findpackage/test.tex
Normal file
10
tests/utils/findpackage/test.tex
Normal file
|
@ -0,0 +1,10 @@
|
|||
\RequirePackage{mkessler-findpackage}
|
||||
\findpackagebycommand{blindtext}
|
||||
|
||||
\documentclass{article}
|
||||
|
||||
\usepackage{blindtext}
|
||||
|
||||
\begin{document}
|
||||
Just a small test.
|
||||
\end{document}
|
1
tests/wip/Makefile
Symbolic link
1
tests/wip/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../DIR_MAKEFILE
|
1
tests/wip/proof/Makefile
Symbolic link
1
tests/wip/proof/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
48
tests/wip/proof/test.tex
Normal file
48
tests/wip/proof/test.tex
Normal file
|
@ -0,0 +1,48 @@
|
|||
\documentclass[german]{article}
|
||||
|
||||
\usepackage{mkessler-proof}
|
||||
\usepackage{mkessler-fancythm}
|
||||
\usepackage{mkessler-hypersetup}
|
||||
\usepackage{parskip}
|
||||
|
||||
\begin{document}
|
||||
\section{test}
|
||||
|
||||
\begin{theorem}\label{thm:krass}
|
||||
Man sollte nach Würzburg fahren.
|
||||
\end{theorem}
|
||||
|
||||
\begin{rproof}{thm:krass}
|
||||
\begin{claim}\label{cl:qed}
|
||||
Der QED ist toll.
|
||||
\end{claim}
|
||||
Um \autoref{cl:qed} zu beweisen, brauchen wir zunächst ein Lemma.
|
||||
\end{rproof}
|
||||
|
||||
\begin{lemma}\label{lm:krass}
|
||||
Mathevereine sind krass.
|
||||
\end{lemma}
|
||||
|
||||
\begin{rproof}{lm:krass}
|
||||
\begin{claim}
|
||||
Mathe ist cool.
|
||||
\end{claim}
|
||||
\begin{subproof}
|
||||
trivial.
|
||||
\end{subproof}
|
||||
Damit folgt nun das Lemma.
|
||||
\end{rproof}
|
||||
|
||||
Nun kommen wir wieder zurück zum eigentlichen Beweis:
|
||||
|
||||
\begin{rproof}{thm:krass}
|
||||
\begin{claim}\label{cl:würzburg}
|
||||
Der QED macht ein Seminar in Würzburg
|
||||
\end{claim}
|
||||
\begin{subproof}
|
||||
Zu prüfen in der DB. Fakt!
|
||||
\end{subproof}
|
||||
Aus \autoref{cl:qed} und \autoref{cl:würzburg} folgt nun die Aussage.
|
||||
\end{rproof}
|
||||
test
|
||||
\end{document}
|
1
tests/wip/restate/Makefile
Symbolic link
1
tests/wip/restate/Makefile
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../COMPILE_MAKEFILE
|
16
tests/wip/restate/test.tex
Normal file
16
tests/wip/restate/test.tex
Normal file
|
@ -0,0 +1,16 @@
|
|||
\documentclass{article}
|
||||
|
||||
\usepackage[german]{mkessler-restate}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\NewDocumentCommand{\testbla}{s}{
|
||||
\ifx#1\BooleanTrue Starred version called\else\relax\fi
|
||||
\LaTeX
|
||||
}
|
||||
|
||||
\undef\testbla
|
||||
|
||||
\restatetheorem{testbla}
|
||||
|
||||
\end{document}
|
|
@ -1,14 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-counters}[2021-09-06 - Write counters to auxiliary file]
|
||||
|
||||
\RequirePackage{etoolbox}
|
||||
|
||||
\newwrite\mkessler@counters@out
|
||||
\immediate\openout\mkessler@counters@out\jobname.cnt\relax
|
||||
\AtBeginDocument{
|
||||
\let\mkessler@counters@saved@stepcounter\stepcounter
|
||||
\def\stepcounter#1{
|
||||
\mkessler@counters@saved@stepcounter{#1}
|
||||
\immediate\write\mkessler@counters@out{#1: \csname the#1\endcsname}}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-bibliography}[2021-09-06 - Package to easily print bibliography and image attributions in document]
|
||||
%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
|
||||
\newif\ifenglish\englishtrue
|
||||
\DeclareOptionX{german}{\englishfalse}
|
||||
\DeclareOptionX{english}{\englishtrue}
|
||||
|
||||
\def\mkessler@bibliography@bibfile{bibliography.bib}
|
||||
\def\mkessler@bibliography@imagefile{images.bib}
|
||||
\DeclareOptionX{bibfile}[bibliography.bib]{\def\mkessler@bibliography@bibfile{#1}}
|
||||
\DeclareOptionX{imagefile}[images.bib]{\def\mkessler@bibliography@imagefile{#1}}
|
||||
|
||||
\DeclareOptionX*{\PackageWarning{mkessler-bibliography}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptionsX\relax
|
||||
|
||||
%%%%Bibliography management
|
||||
\RequirePackage[backend=biber,style=alphabetic]{biblatex}
|
||||
\addbibresource{\mkessler@bibliography@bibfile}
|
||||
\addbibresource{\mkessler@bibliography@imagefile}
|
||||
|
||||
%Provide simpler commands to properly print image attributions and literature
|
||||
\DeclareRobustCommand*{\printimageattributions}{
|
||||
\def\imageattributionstitle{\ifenglish Image attributions \else Bildquellen\fi}
|
||||
\phantomsection
|
||||
\addcontentsline{toc}{section}{\imageattributionstitle}
|
||||
\printbibliography[title={\imageattributionstitle}, type=image]
|
||||
}
|
||||
|
||||
\DeclareRobustCommand*{\printliterature}{
|
||||
\def\literaturetitle{\ifenglish Literature\else Literatur\fi}
|
||||
\phantomsection
|
||||
\addcontentsline{toc}{section}{\literaturetitle}
|
||||
\printbibliography[title={\literaturetitle}, nottype=image]
|
||||
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-exsheet}
|
||||
|
||||
\newif\ifmkessler@exsheet@english\mkessler@exsheet@englishtrue
|
||||
\DeclareOption{german}{\mkessler@exsheet@englishfalse}
|
||||
\DeclareOption{english}{\mkessler@exsheet@englishtrue}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-exsheet}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
\RequirePackage{mkessler-fancythm}
|
||||
|
||||
\newcounter{mkessler@exsheet@sheet}
|
||||
|
||||
\declaretheorem[style=thmgreenmargin, numberwithin=mkessler@exsheet@sheet, name=\ifmkessler@exsheet@english Exercise\else Aufgabe\fi]{mkessler@exsheet@aufgabe}
|
||||
|
||||
\usepackage{xkeyval}
|
||||
|
||||
\NewDocumentEnvironment{aufgabe}{O{}}{
|
||||
\begin{mkessler@exsheet@aufgabe\expandafter}\if\relax\detokenize{#1}\relax\else[#1]\fi\label{aufgabe-\themkessler@exsheet@aufgabe}
|
||||
}{
|
||||
\end{mkessler@exsheet@aufgabe\expandafter}\relax
|
||||
}
|
||||
|
||||
\newcommand\blatt{\refstepcounter{mkessler@exsheet@sheet}\subsection*{\themkessler@exsheet@sheet. Übungsblatt}\addcontentsline{toc}{subsection}{\themkessler@exsheet@sheet. Übungsblatt}}
|
|
@ -1,15 +0,0 @@
|
|||
|
||||
%Numbering of environments with a fractional environment number, see
|
||||
% https://tex.stackexchange.com/questions/598076/how-to-have-a-fractional-environment-number/598080?noredirect=1#comment1499689_598080
|
||||
%However, for a reason i don't understand the posted answer does not work for me, but i had to replace theorem with definition in the definition of the gag environment (so apparently, i have to do this for each environment separately). It seems that the definitions of this document do use \thedefinition and not \thetheorem, although by default this is not the case.
|
||||
\newcounter{gag}
|
||||
\makeatletter
|
||||
\newenvironment{gag}[1]{%
|
||||
\let\savedthedefinition\thedefinition
|
||||
\thm@headfont{\bfseries\boldmath}%
|
||||
\stepcounter{gag}%
|
||||
\renewcommand{\thedefinition}{\savedthedefinition#1}%
|
||||
\renewcommand{\theHdefinition}{gag\thegag}%
|
||||
\addtocounter{definition}{-1}\ignorespaces
|
||||
}{\ignorespacesafterend}
|
||||
\makeatother
|
|
@ -1,101 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-proof}
|
||||
|
||||
%%%% This package will be developed for proofs with automatic references to theorems
|
||||
% for claims numbered within these profos
|
||||
% and for nice subproof / proof of claim environments
|
||||
|
||||
\newif\ifmkessler@proof@english\mkessler@proof@englishtrue
|
||||
\DeclareOption{german}{\mkessler@proof@englishfalse}
|
||||
|
||||
\DeclareOption*{\PackageWarning{mkessler-proof}{Unknown '\CurrentOption'}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
\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}{\ifmkessler@proof@english Claim\else Behauptung\fi}
|
||||
\newtheorem*{claim*}{\ifmkessler@proof@english Claim\else Behauptung\fi}
|
||||
\AtBeginDocument{\def\claimautorefname{\ifmkessler@proof@english Claim\else Behauptung\fi}}
|
||||
|
||||
\newif\ifhyperref
|
||||
\AtBeginDocument{
|
||||
\@ifpackageloaded{hyperref}{
|
||||
\hyperreftrue
|
||||
\def\grab#1{\expandafter\@firstoffive#1}
|
||||
\def\mkessler@proof@blankref#1{\expandafter\grab\csname r@#1\endcsname}
|
||||
\let\mkessler@proof@autoref\autoref
|
||||
}{
|
||||
\hyperreffalse
|
||||
\let\mkessler@proof@blankref\ref
|
||||
\let\mkessler@proof@autoref\ref
|
||||
}
|
||||
}
|
||||
|
||||
\NewDocumentEnvironment{rproof}{m O{}}{\def\mkessler@proof@aster{\relax}\begin{mkessler@fancythm@rproof@impl}{#1}[#2]}{\end{mkessler@fancythm@rproof@impl}}
|
||||
\NewDocumentEnvironment{rproof*}{m O{}}{\def\mkessler@proof@aster{*}\begin{mkessler@fancythm@rproof@impl}{#1}[#2]}{\end{mkessler@fancythm@rproof@impl}}
|
||||
|
||||
\NewDocumentEnvironment{mkessler@fancythm@rproof@impl}{m O{}}
|
||||
{
|
||||
% Restore correct counter for claim
|
||||
\ifcsdef{themkessler@proof@#1@save@claim}{
|
||||
\setcounter{claim}{\value{mkessler@proof@#1@save@claim}}
|
||||
\def\mkessler@proof@proofprefix{\ifmkessler@proof@english Continuation of proof\mkessler@proof@aster\space of\else Fortsetzung des Beweises\mkessler@proof@aster\space zu\fi}
|
||||
\edef\haha{\value{mkessler@proof@#1@part}}
|
||||
}{
|
||||
\newcounter{mkessler@proof@#1@save@claim}
|
||||
\setcounter{claim}{0}
|
||||
\def\mkessler@proof@proofprefix{\ifmkessler@proof@english Proof\mkessler@proof@aster\space of\else Beweis\mkessler@proof@aster\space von\fi}
|
||||
}
|
||||
% Set up counter number printing as subindexed by numbering of the reference
|
||||
\let\mkessler@proof@theoldclaim\theclaim
|
||||
\def\theclaim{\mkessler@proof@blankref{#1}.\mkessler@proof@theoldclaim}
|
||||
% Now, start the actual proof
|
||||
\begin{proof}[\mkessler@proof@proofprefix\space\mkessler@proof@autoref{#1}\if\relax\detokenize{#2}\relax\else\space(#2)\fi]
|
||||
}
|
||||
{
|
||||
\end{proof} % End proof
|
||||
% Save current claim counter for later restoration
|
||||
\setcounter{mkessler@proof@#1@save@claim}{\value{claim}}
|
||||
}
|
||||
|
||||
% Proof (with asterisk)
|
||||
\NewDocumentEnvironment{proof*}{O{}}
|
||||
{
|
||||
\if\relax\detokenize{#1}\relax\begin{proof}[\ifmkessler@proof@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][\ifmkessler@proof@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}[\ifmkessler@proof@english{}Solution\else{}Lösung\fi{}#1]}{\end{proof}}
|
|
@ -1,38 +0,0 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{mkessler-restate}
|
||||
|
||||
\RequirePackage{xkeyval}
|
||||
\RequirePackage{todonotes}
|
||||
\RequirePackage{xparse}
|
||||
\RequirePackage{etoolbox}
|
||||
|
||||
\newif\ifmkessler@restate@english\mkessler@restate@englishtrue
|
||||
\DeclareOptionX{english}{\mkessler@restate@englishtrue}
|
||||
\DeclareOptionX{german}{\mkessler@restate@englishfalse}
|
||||
\DeclareOptionX{ngerman}{\mkessler@restate@englishfalse}
|
||||
|
||||
\define@boolkey+{mkessler-restate.sty}[mkessler@restate@]{strict}[true]{
|
||||
\ifmkessler@restate@strict
|
||||
\PackageInfo{mkessler-restate}{Strict mode enabled. Undefined restates will throw errors.}%
|
||||
\else
|
||||
\PackageInfo{mkessler-restate}{Strict mode disabled. Undefined restates will now print placeholder boxes}%
|
||||
\fi
|
||||
}{
|
||||
\PackageWarning{mkessler-restate}{Erroneous input to key 'strict' ignored. Provide =true or =false.}
|
||||
}
|
||||
\ProcessOptionsX*\relax
|
||||
|
||||
\newcommand\restatesetup[1]{\setkeys{mkessler-restate.sty}{#1}}
|
||||
|
||||
|
||||
\NewDocumentCommand{\restatetheorem}{s m}{
|
||||
\ifcsdef{#2}{
|
||||
\ifx#1\BooleanTrue\csname#2\endcsname*\else\csname#2\endcsname\fi
|
||||
}{
|
||||
\ifmkessler@restate@strict
|
||||
\PackageError{mkessler-restate}{Strict mode enabled but restate command not defined}{The theorem you tried to restate is not defined. Either make sure it is so that it can be printed or disable the strict mode with \noexpand\restatesetup{strict=false} to print a placeholder instead}
|
||||
\else
|
||||
\missingfigure{\ifmkessler@restate@english Here theorem \textbf{#2} is missing, since it is not part of this document.\else Hier fehlt die Wiederholung von Satz \textbf{#2}, der nicht Teil dieses Dokumentes ist.\fi}
|
||||
\fi
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue