making TexCommon public

This commit is contained in:
o-da 2023-04-25 16:11:20 +02:00
parent 0a250f1e48
commit c9ab83c80f
12 changed files with 9229 additions and 85 deletions

192
Makefile Normal file
View File

@ -0,0 +1,192 @@
ifndef SRCNAMES
SRCNAMES = $(shell grep -l "^[^%]*{document}" *.tex)
endif
ifdef SRCNAME
SRCNAMES := $(SRCNAME).tex
endif
ifeq ($(words $SRCNAMES), 1)
SRCNAME = $(SRCNAMES)
endif
PDFNAMES = $(foreach FILE, $(SRCNAMES:.tex=.pdf), $(FILE))
DVINAMES = $(foreach FILE, $(SRCNAMES:.tex=.dvi), $(FILE))
BBLNAMES = $(foreach FILE, $(wildcard *.aux), $(FILE:.aux=.bbl))
$(warning SRCNAMES: $(SRCNAMES))
$(warning PDFNAMES: $(PDFNAMES))
#$(warning BBLNAMES: $(BBLNAMES))
#$(warning SRCNAME: $(SRCNAME))
# The resource file for bibtool
BIBRCNAME = bibtool.rc
# Calculate the path to the current dir when run recursively
THISDIR = $(dir $(lastword $(MAKEFILE_LIST)))
export TEXINPUTS:=${TEXINPUTS};$(THISDIR)//;$(THISDIR)/Corporate/4-3
BIBSRC = $(wildcard *.bib)
TEXSRC = $(wildcard *.tex)
#-- Software Environment Setup -------------------------------
SHELL = /bin/bash
LATEX = latex -src
BIBTEX = bibtex
DVIPS = dvips
PDFPS = pdftops
PDF = max_print_line=1000 pdflatex -shell-escape -src -halt-on-error -synctex=1 -interaction nonstopmode -file-line-error-style
OPEN = xdg-open
MD5SUM = md5sum
# Mac-specific definitions
ifeq ($(shell uname), Darwin)
OPEN=open
endif
.PHONY: default
default: pdf # Default goal
.PHONY: dvi
dvi : $(DVINAMES) # Compile dvi's
.PHONY: pdf
pdf : $(PDFNAMES) # Compile pdf's
.PHONY: over
over : clean pdf # Force recompile
.PHONY: clean
clean :
@echo Soft clean
-rm *.blg *.log *.out $(DVINAMES) $(PDFNAMES) 2>/dev/null ; true
.PHONY: cleanall
cleanall : clean
@echo Hard clean
-rm *~ *.aux *.bbl *.lof *.lot *.toc *.ps *.cit *.synctex.gz *.run.xml *.bcf 2>/dev/null ; true
.PHONY: cleanaux
cleanaux :
-rm *.blg *.log *.out *.dvi*.aux *.bbl *.lof *.lot *.toc *.ps *.cit *.synctex.gz 2>/dev/null ; true
.PHONY: show
show: $(PDFNAMES)
for file in $(PDFNAMES); do $(OPEN) $$file; done
.PHONY: edit
edit: $(SRCNAMES)
for file in $(SRCNAMES); do $(OPEN) $$file; done
%.bbl: $(BIBSRC)
# @echo Recreate the .aux file
# $(PDF) $(@:.bbl=.tex) >/dev/null || cat $(@:.bbl=.log)
@echo Recreate the .bbl file
$(BIBTEX) $(@:.bbl=.aux) | true
@echo Flush the citation hash
test -s $(@:.pdf=.cit) || echo '' | $(MD5SUM) > $(@:.pdf=.cit)
%.aux : %.pdf;
%.dvi: %.tex # Cancel the default rule
%.dvi: $(TEXSRC) $(wildcard $(THISDIR)*.tex)
@echo If compilation fails manipuate the timestamp to prevent recognission of .dvi as ready
$(LATEX) $(@:.dvi=.tex) || (touch --date="`date -R -r $(@:.dvi=.tex)`" $@ & false)
@echo If the citations were updated recompile the .bbl file
grep -o -G "Citation \`[^']*" $(@:.dvi=.log) | $(MD5SUM) -c --status $(@:.dvi=.cit) || $(BIBTEX) $(@:.dvi=.aux)
while grep -q "Rerun to get cross-references right." $(@:.dvi=.log); \
do $(LATEX) $(@:.dvi=.tex); done
@echo Update the missing citation hash
grep -o -G "Citation \`[^']*" $(@:.dvi=.log) | $(MD5SUM) > $(@:.dvi=.cit)
%.pdf: %.tex # Cancel the default rule
%.pdf: $(TEXSRC) $(wildcard $(THISDIR)*.tex) $(BBLNAMES)
@echo Compiling $@
($(PDF) $(@:.pdf=.tex) | grep -A 5 -B 5 ".*:[0-9]*:.*") || (touch --date="`date -R -r $(@:.pdf=.tex)`" $@ & grep "Warning" $(@:.pdf=.log))
@echo Recompile tikz images
@if [ -s $(@:.pdf=.makefile) ]; \
then \
$(MAKE) -e -f $(@:.pdf=.makefile); \
$(PDF) $(@:.pdf=.tex) >/dev/null; \
fi
@echo Create $(@:.pdf=.cit) if it does not exist
test -s $(@:.pdf=.cit) || echo '' | $(MD5SUM) > $(@:.pdf=.cit)
@echo If the citations were updated recompile the .bbl file
grep -o -G "Citation \`[^']*" $(@:.pdf=.log) | $(MD5SUM) -c --status $(@:.pdf=.cit) || rm -f *.bbl; $(MAKE) bibtex; $(PDF) $(@:.pdf=.tex) >/dev/null
@echo -n "Search for dangling references.. "
@if grep -q "Rerun to get cross-references right." $(@:.pdf=.log); \
then \
echo "Run LaTeX twice no matter how silly it is" \
$(PDF) $(@:.pdf=.tex) >/dev/null; \
$(PDF) $(@:.pdf=.tex) >/dev/null; \
else \
echo "None"; \
fi
@echo Update the citation hash
grep -o -G "Citation \`[^']*" $(@:.pdf=.log) | $(MD5SUM) > $(@:.pdf=.cit)
%.ps : %.pdf
$(PDFPS) -level1 $< # Create .ps from .pdf
.PHONY: bib
bib: bibtex
.PHONY: bibtool
bibtool: $(BIBSRC)
#Normalise all bibfiles
for bf in $(BIBSRC); do \
bibtool -s -v -i $$bf -o $$bf -r $(THISDIR)/$(BIBRCNAME); \
done
.PHONY: bibtex
bibtex: $(BBLNAMES)
.PHONY: pack
pack: $(TEXSRC)
make cleanall
$(MAKE) pdf
mkdir -p submission
# purging old files if any
rm -Rf submission/*
# copying all files from TexCommon mentioned in log-file
for file in $(THISDIR)/*; do \
if grep --quiet $(shell basename $(THISDIR))/$$(basename $$file) *.log; \
then cp -v $$file submission; \
fi; done
cp *.bib submission || echo "There are no bib-file!"
cp *.bbl submission || echo "There are no bbl-file!"
cp *.bst submission || echo "There are no bst-file!"
# copying all files from the current directory mentioned in log-file
for file in * ; do if [ -f $$file ]; then (if grep --quiet $$file *.log; then cp $$file submission; fi); fi ; done
# remove comments
for file in submission/*.tex; do perl -i -pe 's/(^|[^\\])%.*/\1%/' $$file; done
# remove appendix
#for file in submission/*.tex; do sed -i '/\\appendix/,$$c \\\end{document}' $$file ; done
for file in submission/*.tex; do sed -i '/\\\end{document}/q' $$file ; done
cd submission; rm -f *.aux *.blg *.log *.out; rm -f ../submission.zip; zip -r ../submission.zip *
.PHONY: up
up: $(PDFNAMES)
for fn in $(PDFNAMES); do rcp $$fn www8.informatik.uni-erlangen.de:/home/$(USER)/$$fn ; done
# rcp $(SRCNAME).ps www8.informatik.uni-erlangen.de:/home/$(USER)/$(EXTNAME).ps
# Check common text writting issues
.PHONY: check
check:
@echo "Checking duplicates.."
@grep -Eon -r --include "*.tex" '(\b[[:alpha:]]{2,}\b) \1\b' . | true
@echo "Checking spelling.."
cat $(SRCNAMES) | aspell --conf-dir=$(THISDIR) --home-dir=$(THISDIR) list -t --dont-tex-check-comments -d en_GB-ize | sort -uf | sed -E '/.../!d'

105
README.md
View File

@ -1,92 +1,27 @@
# TexCommon
The idea of this directory is to provide shared resources for preparing publications.
Most importantly it contains the makefile with common command packages to compile latex files.
In order to use it, create a makefile in your directory with the same name with the only content.
'include <path-to-this-dir>/Makefile'. If your directory contains more than one root latex file
add 'SRCNAME=<name-of-root-file>' before the include command.
## Getting started
== Quick summary of commands ==
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
make (=make pdf) - complies .pdf from the root file
..
make <filename> - tries to achieve <filename> in a suitable way, e.g. if <filename>=foo.pdf it will try
<------>to compile foo.tex in order to get it no matter what 'foo' is.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
make clean - removes all target files obtained by latex in one round.
.
make cleanall - removes all target files.
.
make up - uploads the compiled .pdf and .ps files on the server to the current user's directory under the.
<------>same name unless overridden by $EXTNAME variable.
.
make show - shows the compiled .dvi in xdvi
## Add your files
make bibtex - runs bibtex for all .bib files of the current directory
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://git8.cs.fau.de/public-repos/texcommon.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://git8.cs.fau.de/public-repos/texcommon/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
make bibtool - normalizes the the .bib files by calling bibtool with the settings given in bibtool.rc

17
aspell.conf Normal file
View File

@ -0,0 +1,17 @@
add-tex-command usepackage op
add-tex-command PassOptionsToPackage pp
add-tex-command RequirePackage op
add-tex-command savesymbol p
add-tex-command restoresymbol pp
add-tex-command FXRegisterAuthor ppp
add-tex-command usetikzlibrary p
add-tex-command tikzset p
add-tex-command tikzpicture op
add-tex-command newcommand pp
add-tex-command renewcommand pp
add-tex-command label p
add-tex-command mathit p
add-tex-command oname p
add-tex-command lstset p
add-tex-command hypersetup p
add-tex-command bibliographystyle p

42
bibtool.rc Normal file
View File

@ -0,0 +1,42 @@
check.double = on
sort.format = {%-2n(author)%2d(year)%+0T(title) # %-2n(editor)%2d(year)%+0T(title) # !%+0T(title)}
key.format = {%2n(author)%2d(year) # %2n(editor)%2d(year) # %2n(author)UP # %2W(title)}
fmt.et.al = {EtAl}
fmt.name.name = {}
fmt.inter.name = {}
ignored.word = {a}
ignored.word = {the}
ignored.word = {of}
%clear.ignored.words ={}
fmt.inter.name = {}
key.number.separator={}
key.base = {lower}
%print.entry.types = {Sn}
delete.field = {annote}
delete.field = {keywords}
delete.field = {abstract}
delete.field = {bibsource}
%delete.field = {nourl}
delete.field = {ee}
%delete.field = {doi}
delete.field = {coden}
delete.field = {issn}
delete.field = {bibdate}
%delete.field = {url}
delete.field = {acknowledgement}
delete.field = {subject}
delete.field = {isbn}
delete.field = {mrclass}
delete.field = {mrnumber}
delete.field = {mrreviewer}
delete.field = {location}
delete.field = {descriptor}
delete.field = {biburl}
delete.field = {keyword}
delete.field = {affiliation}
delete.field = {priority}
delete.field = {crossref}
tex.define {\HasCASL=HasCASL}

210
catprog.tex Normal file
View File

@ -0,0 +1,210 @@
%
% Standard macros to typeset papers on category theory and semantics
%
% Unless \catname is defined, make it bold.
% So, call \providecommand{\catname}{\mathcal}
% or \reprovidecommand{\catname}{\mathcal}
% before calling this file if you prefer calligraphic names for categories.
%
% Same applies to other commands.
%
\RequirePackage{bm} % Needed for defbbname
\RequirePackage{mathtools} % Needed for coloneqq
\providecommand{\catname}{\mathbf}
%\providecommand{\mndname}{\mathbbb}
\providecommand{\clsname}{\mathcal}
\providecommand{\oname}[1]{\operatorname{\mathsf{#1}}}
%% Defining category names like \BA, \BB, etc
\def\defcatname#1{\expandafter\def\csname B#1\endcsname{\catname{#1}}}
\def\defcatnames#1{\ifx#1\defcatnames\else\defcatname#1\expandafter\defcatnames\fi}
\defcatnames ABCDEFGHIJKLMNOPQRSTUVWXYZ\defcatnames
%% Defining \CA, \CB, etc
\def\defclsname#1{\expandafter\def\csname C#1\endcsname{\clsname{#1}}}
\def\defclsnames#1{\ifx#1\defclsnames\else\defclsname#1\expandafter\defclsnames\fi}
\defclsnames ABCDEFGHIJKLMNOPQRSTUVWXYZ\defclsnames
%% Defining \BBA, \BBB, etc
\def\defbbname#1{\expandafter\def\csname BB#1\endcsname{{\bm{\mathsf{#1}}}}}
\def\defbbnames#1{\ifx#1\defbbnames\else\defbbname#1\expandafter\defbbnames\fi}
\defbbnames ABCDEFGHIJKLMNOPQRSTUVWXYZ\defbbnames
%% Defining \BMA, \BMB, etc
\def\defbbname#1{\expandafter\def\csname BM#1\endcsname{{\bm{\mathsf{#1}}}}}
\def\defbbnames#1{\ifx#1\defbbnames\else\defbbname#1\expandafter\defbbnames\fi}
\defbbnames ABCDEFGHIJKLMNOPQRSTUVWXYZ\defbbnames
%% Some standard categories
\def\Set{\catname{Set}}
\def\Cpo{\catname{Cpo}}
\def\Cppo{\catname{Cppo}}
\def\dCpo{\catname{dCpo}}
\def\DCpo{\catname{DCpo}}
\def\Top{\catname{Top}}
\def\Met{\catname{Met}}
% Misc
\providecommand{\eps}{{\operatorname\epsilon}}
\providecommand{\amp}{\mathbin{\&}}
\providecommand{\argument}{\operatorname{-\!-}}
\providecommand{\altargument}{\underline{\;\;}}
\providecommand{\wave}[1]{\widetilde{#1}} % Overline wave
\providecommand{\ul}{\underline} % Underline
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\providecommand{\mplus}{{\scriptscriptstyle\bf+}} % Small '+' for indexing
\providecommand{\smin}{\smallsetminus}
\providecommand{\ass}{\mathrel{\coloneqq}}
\providecommand{\bnf}{\mathrel{\Coloneqq}}
%% Some standard functors
\providecommand{\PSet}{{\mathcal P}} % Powerset
\providecommand{\FSet}{{\mathcal P}_{\omega}} % Finite powerset
\providecommand{\CSet}{{\mathcal P}_{\omega_1}} % Countable powerset
\providecommand{\NESet}{{\mathcal P}^{\mplus}} % Non-empty powerset
\providecommand{\Id}{\operatorname{Id}}
%% General categorical notation
\providecommand{\Hom}{\mathsf{Hom}}
\providecommand{\id}{\mathsf{id}}
\providecommand{\op}{\mathsf{op}}
\providecommand{\comp}{\mathbin{\circ}}
\providecommand{\iso}{\mathbin{\cong}}
\providecommand{\tensor}{\mathbin{\otimes}}
\providecommand{\unit}{\star}
\providecommand{\bang}{\operatorname!} % Initial/final map
%% Various arrows
\providecommand{\from}{\leftarrow}
\providecommand{\ito}{\hookrightarrow} % Injection
\providecommand{\sto}{\twoheadrightarrow} % Surjection
\providecommand{\ifrom}{\hookleftarrow}
\providecommand{\pto}{\mathrel{\rightharpoonup}} % Partial function
\providecommand{\pfrom}{\mathrel{\leftarpoonup}} %
\providecommand{\tto}{\mathrel{\Rightarrow}} % Double arrow
\providecommand{\tfrom}{\mathrel{\Leftarrow}} %
\providecommand{\mto}{\mapsto}
\providecommand{\xto}[1]{\,\xrightarrow{#1}\,}
\providecommand{\xfrom}[1]{\,\xleftarrow{\;#1}\,}
\providecommand{\To}{\mathrel{\Rightarrow}} % Double arrow
\providecommand{\From}{\mathrel{\Leftarrow}}
\providecommand{\dar}{\kern-.75pt\operatorname{\downarrow}}
\providecommand{\uar}{\kern-.75pt\operatorname{\uparrow}}
\providecommand{\Dar}{\kern-.75pt\operatorname{\Downarrow}}
\providecommand{\Uar}{\kern-.75pt\operatorname{\Uparrow}}
%% Logic
\providecommand{\True}{\top}
\providecommand{\False}{\bot}
\providecommand{\bigor}{\bigvee}
\providecommand{\bigand}{\bigwedge}
\providecommand{\impl}{\Rightarrow}
\providecommand{\equ}{\Longleftrightarrow}
\providecommand{\entails}{\vdash}
%% Order
\providecommand{\appr}{\sqsubseteq}
\providecommand{\join}{\sqcup}
\providecommand{\meet}{\sqcap}
\providecommand{\bigjoin}{\bigsqcup}
\providecommand{\bigmeet}{\bigsqcap}
%% Products
\providecommand{\fst}{\oname{fst}}
\providecommand{\snd}{\oname{snd}}
\providecommand{\pr}{\oname{pr}}
\providecommand{\brks}[1]{\langle #1\rangle}
\providecommand{\Brks}[1]{\bigl\langle #1\bigr\rangle}
%% Coproducts
\providecommand{\inl}{\oname{inl}}
\providecommand{\inr}{\oname{inr}}
\providecommand{\inj}{\oname{in}}
\DeclareSymbolFont{Symbols}{OMS}{cmsy}{m}{n}
\DeclareMathSymbol{\iobj}{\mathord}{Symbols}{"3B}
%\DeclareRobustCommand{\iobj}{\emptyset}
%% CCC
\providecommand{\curry}{\oname{curry}}
\providecommand{\uncurry}{\oname{uncurry}}
\providecommand{\ev}{\oname{ev}}
% Semantic brackets
\RequirePackage{stmaryrd}
\providecommand{\lsem}{\llbracket}
\providecommand{\rsem}{\rrbracket}
\providecommand{\sem}[1]{\lsem #1 \rsem}
\providecommand{\Lsem}{\bigl\llbracket}
\providecommand{\Rsem}{\bigr\rrbracket}
\providecommand{\Sem}[1]{\Lsem #1 \Rsem}
% Typographic
\providecommand{\comma}{,\operatorname{}\linebreak[1]} % possibly line-breaking comma
\providecommand{\dash}{\nobreakdash-\hspace{0pt}} % non-line-breaking hyphen
\providecommand{\erule}{\rule{0pt}{0pt}} % Empty object whose emptiness
% is not detected by LaTeX
\providecommand{\by}[1]{\text{/\!\!/~#1}} % Comments in equations
\providecommand{\pacman}[1]{} % Hide a piece of text
\newcommand{\undefine}[1]{\let #1\relax} % Make a command undefined
\providecommand{\noqed}{\def\qed{}} % Undefine the QED symbol
% -1 superscript for the inversion operator
\providecommand{\mone}{{\text{\kern.5pt\rmfamily-}\mathsf{\kern-.5pt1}}}
\makeatletter
\@ifpackageloaded{enumitem}{}{
\RequirePackage[loadonly]{enumitem} % without [loadonly]
} % conflicts with Beamer
\makeatother
% Condensed list environments
\newlist{citemize}{itemize}{1}
\setlist[citemize]{label=\labelitemi,wide}
%leftmargin=0cm,itemindent=.7cm,labelwidth=\itemindent,labelsep=-.3cm,align=left}
\newlist{cenumerate}{enumerate}{1}
\setlist[cenumerate,1]{label=\arabic*.~,ref={\arabic*},wide}
%leftmargin=0cm,itemindent=.7cm,labelwidth=\itemindent,labelsep=-.3cm,align=left}
%\newenvironment{citemize}{\begin{itemize}[leftmargin=0cm,itemindent=.7cm,labelwidth=\itemindent,labelsep=-.3cm,align=left]}{\end{itemize}}
%\newenvironment{cenumerate}{\begin{enumerate}[leftmargin=0cm,itemindent=.7cm,labelwidth=\itemindent,labelsep=-.3cm,align=left]}{\end{enumerate}}
%% A macro for defining mixfix operators
\makeatletter
\def\mfix#1{\oname{#1}\@ifnextchar\bgroup\@mfix{}} % processing odd arguments
\def\@mfix#1{#1\@ifnextchar\bgroup\mfix{}} % processing even arguments
\makeatother
%% Instances if mfix
\providecommand{\ift}[3]{\mfix{if}{\mathbin{}#1}{then}{\mathbin{}#2}{else}{\mathbin{}#3}}
\providecommand{\case}[3]{\mfix{case}{\mathbin{}#1}{of}{#2}{\kern-1pt;}{\mathbin{}#3}}

33
defslmcs.tex Normal file
View File

@ -0,0 +1,33 @@
%% Undefine everithing
\let\theorem\relax
\let\endtheorem\relax
\let\corollary\relax
\let\endcorollary\relax
\let\lemma\relax
\let\endlemma\relax
\let\proposition\relax
\let\endproposition\relax
\let\assumption\relax
\let\endassumption\relax
\let\remark\relax
\let\endremark\relax
\let\example\relax
\let\endexample\relax
\let\defintion\relax
\let\enddefinition\relax
\let\example\relax
\let\endexample\relax
\newenvironment{theorem}{\begin{thm}}{\end{thm}}
\newenvironment{corollary}{\begin{cor}}{\end{cor}}
\newenvironment{lemma}{\begin{lem}}{\end{lem}}
\newenvironment{proposition}{\begin{prop}}{\end{prop}}
\newenvironment{assumption}{\begin{asm}}{\end{asm}}
\newenvironment{remark}{\begin{rem}}{\end{rem}}
\newenvironment{example}{\begin{exa}}{\end{exa}}
\newenvironment{definition}{\begin{defi}}{\end{defi}}

24
defslncs.tex Normal file
View File

@ -0,0 +1,24 @@
%\spnewtheorem{thm}{Theorem}[section]{\bfseries}{\itshape}
\spnewtheorem{thm}[theorem]{Theorem}{\bfseries}{\itshape}
\spnewtheorem{cor}[theorem]{Corollary}{\bfseries}{\itshape}
\spnewtheorem{cnj}[theorem]{Conjecture}{\bfseries}{\itshape}
\spnewtheorem{lem}[theorem]{Lemma}{\bfseries}{\itshape}
\spnewtheorem{lemdefn}[theorem]{Lemma and Definition}{\bfseries}{\itshape}
\spnewtheorem{prop}[theorem]{Proposition}{\bfseries}{\itshape}
\spnewtheorem{defn}[theorem]{Definition}{\bfseries}{\upshape}
\spnewtheorem{rem}[theorem]{Remark}{\bfseries}{\upshape}
\spnewtheorem{notation}[theorem]{Notation}{\bfseries}{\upshape}
\spnewtheorem{expl}[theorem]{Example}{\bfseries}{\upshape}
\spnewtheorem{thmdefn}[theorem]{Theorem and Definition}{\bfseries}{\itshape}
\spnewtheorem{propdefn}[theorem]{Proposition and Definition}{\bfseries}{\itshape}
\spnewtheorem{assumption}[theorem]{Assumption}{\bfseries}{\upshape}
\spnewtheorem{algorithm}[theorem]{Algorithm}{\bfseries}{\upshape}
\renewenvironment{theorem}{\begin{thm}}{\end{thm}}
\renewenvironment{corollary}{\begin{cor}}{\end{cor}}
\renewenvironment{lemma}{\begin{lem}}{\end{lem}}
\renewenvironment{proposition}{\begin{prop}}{\end{prop}}
\renewenvironment{definition}{\begin{defn}}{\end{defn}}
\renewenvironment{remark}{\begin{rem}}{\end{rem}}
\renewenvironment{example}{\begin{expl}}{\end{expl}}

8514
diagrams.sty Normal file

File diff suppressed because it is too large Load Diff

66
gitlab-ci/latex.yml Normal file
View File

@ -0,0 +1,66 @@
compile_latex:
image: aergus/latex # the docker image by aergus https://hub.docker.com/r/aergus/latex/
stage: build
#variables:
# GIT_SSL_NO_VERIFY: "true"
before_script:
- git submodule sync
- git submodule update --init --remote
# if you need to upload PDFs somewhere else, add a private SSH key to the
# gitlab project config and then do the following:
#- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
#- 'which rsync || ( apt-get update -y && apt-get install rsync -y )'
#- mkdir -p ~/.ssh
#- eval $(ssh-agent -s)
#- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
#- ssh-add <(echo "$STAGING_PRIVATE_KEY")
script:
# the following script requires bash
# when editing, be careful, not to use any colons since they mess up the yaml parser!
# compile all the PDFs you are interested in:
- verb() { echo -e "\e[32;1m===== $* =====\e[0m" ; }
- failed=( )
- succeeded=( )
- compile_tex() { sed -i 's,\\includeonly{[^}]*},,g' "$1" ; latexmk -f -cd -pdf "$1" ; }
# activate the following line if you use a custom makefile
#- compile_tex() { make "${1%%.tex}.pdf" ; }
- mapfile -t gitfiles < <(git ls-files)
- mapfile -d $'\0' -t texfiles < <(grep -lZ -d skip --include '*.tex' -E '^[^%]*\\documentclass' "${gitfiles[@]}")
- for t in "${texfiles[@]}" ; do verb "Compiling $t" ; compile_tex "$t" && succeeded+=( "$t" ) || failed+=( "$t" ) ; done
- git ls-files -z | xargs -0 rm -v -f || true # remove all tracked files such that they are not included in the artifacts
# if you want to upload PDFs somewhere else, do something like the following:
#- rsync -rvva *.pdf wissmann@faui8220:/serv/httpd/www8/htdocs/ext/thorsten/test
- echo "The following tex were compiled successfully:" ; printf "%s\n" "${succeeded[@]}"
- echo "The following tex files failed to build:" ; printf "%s\n" "${failed[@]}"
- echo "Successful Compilation Coverage $(((${#texfiles[@]}-${#failed[@]})*10000/${#texfiles[@]}))" | sed 's/..$/\.&/'
- if [ "${#failed[@]}" -ge 1 ] ; then verb "failed files $failed" ; false ; fi
# the second last line in the script prints the statistics which are parsed by the following regex:
coverage: /^Successful Compilation Coverage [0-9]*\.[0-9][0-9]/
cache:
untracked: true # cache all pdf files for subsequent runs
artifacts:
name: "${CI_PROJECT_NAME}-pdfs"
when: always
expire_in: 100 yrs
paths:
- ./*.pdf
- ./*/*.pdf
- ./*/*/*.pdf
- ./*/*/*/*.pdf
- ./*/*/*/*/*.pdf
- ./*/*/*/*/*/*.pdf
- ./*/*/*/*/*/*/*.pdf
- ./*/*/*/*/*/*/*/*.pdf
# You can link the most recently *finished* artifacts by a badge:
#
# Link: https://git8.cs.fau.de/%{project_path}/-/jobs/artifacts/%{default_branch}/browse?job=compile_latex
# Badge image URL: https://git8.cs.fau.de/%{project_path}/badges/%{default_branch}/pipeline.svg
#
# e.g.: https://git8.cs.fau.de/thorsten/coalgpartref/-/jobs/artifacts/master/browse?job=compile_latex
# see also https://docs.git8.com/ee/user/project/pipelines/job_artifacts.html#downloading-the-latest-artifacts
#
#environment:
# name: Recent PDFs
# url: https://git8.cs.fau.de/$CI_PROJECT_PATH/builds/$CI_BUILD_ID/artifacts/browse

50
test.tex Normal file
View File

@ -0,0 +1,50 @@
\documentclass[draft]{article}
\sloppy
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{lipsum}
\usepackage{todos}
\include{catprog}
\makeatletter
\def\show@monad@names#1{\ifx#1\show@monad@names\else\csname BB#1\endcsname\expandafter\show@monad@names@\fi}
\def\show@monad@names@#1{\ifx#1\show@monad@names\else\comma\csname BB#1\endcsname\expandafter\show@monad@names@\fi}
%
\def\show@cat@names#1{\ifx#1\show@cat@names\else\csname BB#1\endcsname\expandafter\show@cat@names@\fi}
\def\show@cat@names@#1{\ifx#1\show@cat@names\else\comma\csname B#1\endcsname\expandafter\show@cat@names@\fi}
\begin{document}
Categories: $\show@cat@names ABCDEFGHIJKLMNOPQRSTUVWXYZ\show@cat@names$
Monads: $\show@monad@names ABCDEFGHIJKLMNOPQRSTUVWXYZ\show@monad@names$
\todo{This is a use of the todo-command}
$-\dfrac{\hslash^2}{2m} \, \dfrac{\mathrm{d}^2 \psi}{\mathrm{d} x^2} \todo{It can be used like this}$
%
\begin{flalign*}
E = mc^2 &&\by{\todo{or like this}}
\end{flalign*}
\todo*{This is a use of the todo-command with a star
- starts a new line
- no indentation (initially)
- suitable for large chunks of text
\bigskip
\lipsum[1]
}
\end{document}

29
tikz_arxiv.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
if [ $# != 1 ]; then
echo "Usage: $0 <filename>"
exit 1
fi
mkdir tikz-$$
if [ -e "Makefile" ]; then
rm ${1%.tex}.pdf; max_print_line=1000 make ${1%.tex}.pdf > /dev/null < /dev/null
else
max_print_line=1000 pdflatex 1% > /dev/null < /dev/null
fi
for i in `grep /pgf/ ${1%.tex}.log | tr -d '()'`; do
if [ "${i##*.}" = tex ]; then
echo $i
(echo '%auto-ignore'; cat $i) > tikz-$$/$(basename $i)
else
cp $i tikz-$$/$(basename $i)
fi
done
cd tikz-$$
zip ../tikz.zip *
$cd ..
rm -rf tikz-$$
exit 0

32
todos.sty Normal file
View File

@ -0,0 +1,32 @@
\ProvidesFile{todos}
%\name{Sergey Goncharov}
%\signature{\bigskip Sergey Goncharov}
%\address{FAU Erlangen-Nürnberg, Martenstr.3, Erlangen}
%\subjecton
\usepackage{ifpdf} %% For switching between pdf and non-pdf mode
\usepackage{xcolor}
\usepackage{ifdraft} %% For access to the draft/final option of the documentclass
\def\todo#1{} % undefine, if defined previously
\ifdraft
{
\def\ensuretext#1{\ifmmode\text{#1}\else{#1}\fi}
\def\todo{\@ifstar\@@todo\@todo}
\ifpdf
% non-starred version for brief todos
\long\def\@todo#1{\ensuretext{\ttfamily\color[RGB]{255,64,64}TODO: #1}}
% starred version for extensive todos
\long\def\@@todo#1{{\hfill\\\noindent\ttfamily\color[RGB]{255,64,64}TODO: #1\hfill\par}}
\else
\fi
}
{}