Add docs, finish up errors

This commit is contained in:
Admin 2025-01-07 10:38:36 +01:00
parent 9217ace0af
commit 0644caf2b2
28 changed files with 1010 additions and 102 deletions

View File

@ -1,6 +1,7 @@
# latex
# LaTeX helpers
This repository contains a collection of LaTeX files, helping you get started with LaTeX quickly.
My LaTeX helpers
See the docs [here](https://git.janishutz.com/janishutz/latex/src/branch/main/docs/main/docs.pdf) to get started.
[LaTeX helper files](https://git.janishutz.com/janishutz/latex) © 2024 by [Janis Hutz](https://janishutz.com) is licensed under [Creative Commons Attribution-NonCommercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/)
[LaTeX helper files](https://git.janishutz.com/janishutz/latex) © 2024 by [Janis Hutz](https://janishutz.com) is licensed under [Creative Commons Attribution-NonCommercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/)

View File

@ -1,3 +0,0 @@
\include{./most.tex}
\include{./extra/bib.tex}
\include{./extra/minted.tex}

View File

@ -1,2 +0,0 @@
\include{./main/core.tex}
\include{./config/config.tex}

View File

@ -7,6 +7,7 @@
% ( )_) |
% \___/
% To be loaded *after* main/core.tex
% Configure your author name here
\newcommand{\authorTitle}{Janis Hutz\\\url{https://janishutz.com}}
@ -22,5 +23,16 @@
% Configure definition, lemma, theorem, etc numbering behaviour. 1 = Individual, 2 = Combined (apart from Definition), 3 = Combined
\setcounter{numberingConfig}{1}
% Set the default language. 1 = English, 2 = German
\setcounter{lang}{1}
% Set the default language.
\setLang{en}
% ----- %
% STYLE %
% ----- %
% The colour-saturation of the short / inline descriptors (default = 40)
\setcounter{descriptorShadeStrength}{40}
% The colour-saturation of the shade command (default = 20)
\setcounter{shadeStrength}{20}

5
dist/full.tex vendored Normal file
View File

@ -0,0 +1,5 @@
\newcommand{\loadFull}{
\input{\dir/dist/recommended.tex}
\loadRecommended
\input{\dir/extra/minted.tex}
}

View File

7
dist/minimal.tex vendored Normal file
View File

@ -0,0 +1,7 @@
\newcommand{\loadMinimal}{
\typeout{[CustomLaTeXHelperLoader]: Loaded minimal}
\input{\dir/main/core.tex}
\input{\dir/config/config.tex}
\input{\dir/main/style/style.tex}
\input{\dir/main/style/common.tex}
}

14
dist/most.tex vendored Normal file
View File

@ -0,0 +1,14 @@
\newcommand{\loadMost}{
\typeout{[CustomLaTeXHelperLoader]: Loaded most}
\input{\dir/dist/minimal.tex}
\loadMinimal
\input{\dir/main/math.tex}
\input{\dir/main/cs.tex}
\input{\dir/main/index.tex}
\input{\dir/main/tables.tex}
\input{\dir/main/style/counters.tex}
\input{\dir/main/style/cs.tex}
\input{\dir/main/style/math.tex}
\input{\dir/main/style/language.tex}
}

7
dist/recommended.tex vendored Normal file
View File

@ -0,0 +1,7 @@
\newcommand{\loadRecommended}{
\typeout{[CustomLaTeXHelperLoader]: Loaded recommended}
\input{\dir/dist/most.tex}
\loadMost
\input{\dir/extra/bib.tex}
\input{\dir/extra/glossary.tex}
}

BIN
docs/main/docs.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,35 @@
\documentclass{article}
\newcommand{\dir}{~/projects/latex}
\input{\dir/include.tex}
\load{full}
\setup{Docs - \LaTeX \hspace{0mm} helpers}
\setLang{en}
\begin{document}
\startDocument
\usetcolorboxes
\printtoc{Aquamarine}
\newpage
\section{Introduction}
This set of \LaTeX files is designed to give you a good looking, pre-configured \LaTeX setup, which helps you get started much more quickly.
It has some configuration options already, but more are to come soon. If you have any suggestions as to what should be added, don't hesitate to open a support ticket at \url{https://support.janishutz.com?a=add} or contacting me via email to \texttt{development@janishutz.com}.
\section{Installation}
You can install these helper files by downloading this repo and storing it to any location on your PC, remembering where that location is.
You may also install the VSCode snippets found in the vscode-snippets folder. These snippets provide autocompletion for many of the commands that this helper file provides.
\input{./parts/usage.tex}
\input{./parts/custom-loader.tex}
\input{./parts/reference.tex}
\end{document}

View File

@ -0,0 +1,6 @@
\newsection
\section{Custom Loader}
You can create a custom loader by defining a \verb|load|\{\textit{string}\} macro (or any other, if you are aware you need to change that in your main file for it to work) that uses the \verb|\dir| command to resolve the custom parts.
Take a look at the \texttt{/include.tex} file for inspiration on how to do it, if you also want it to do case distinction.
You can also include some the pre-built configs from the \texttt{dist/} folder.

View File

@ -0,0 +1,321 @@
\newsection
\section{Full Command Reference}
\subsection{Variables}
\begin{itemize}
\item \textit{scope}: \texttt{minimal}, \texttt{most}, \texttt{recommended}, \texttt{all} or \texttt{letter}
\item \textit{string}: Any normal text
\item \textit{number}: Any non-negative integer, i.e. no commas
\item \textit{color}: Any of the \texttt{dvipsnames} colours of \texttt{xcolor}
\end{itemize}
\subsection{Per-File config}
\begin{itemize}
\item \verb|\renewcommand{\authorTitle}|\{\textit{string}\} Change the author (in the title) for this document only
\item \verb|\renewcommand{\authorHeaders}|\{\textit{string}\} Change the author (in the header) for this document only
\item \verb|\renewcommand{\name}|\{\textit{string}\} Change the name (for letters) for this document only
\item \verb|\renewcommand{\street}|\{\textit{string}\} Change the street (for letters) for this document only
\item \verb|\renewcommand{\city}|\{\textit{string}\} Change the city (for letters) for this document only
\item \verb|\renewcommand{\countrycode}|\{\textit{string}\} Change the country-code (for letters) for this document only
\item \verb|\setcounter{numberingConfig}|\{\textit{number}\} Change the numbering of definitions, lemmas, etc for this document. 1 = Separately, 2 = Combined (except for definition), 3 = Combined, 4 = Off
\item \verb|\setcounter{descriptorShadeStrength}|\{\textit{number}\} Change the colour saturation of the inline descriptors
\item \verb|\setcounter{shadeStrength}|\{\textit{number}\} Change the colour saturation of the \verb|\shade| command
\item \verb|\setLang|\{\textit{language}\} Change the language. Will automatically load babel in German. Can only be used once and only at the start of the document or in the preamble, as repeated usage leads to undefined behaviour
\end{itemize}
\subsection{Setup, Loading \& Translation}
\begin{itemize}
\item \verb|\load|\{\textit{scope}\} Load the selected \textit{scope}
\item \verb|\setup|\{\textit{string}\} Prepare the document with the \textit{string} being the title
\item \verb|\setupExam|\{\textit{string}\} Prepare the document with smaller borders and no headers / footers. \textit{string} is the title
\item \verb|\setupBarebones|\{\textit{string}\} Minimal setup, only borders and title set
\item \verb|\startDocument| Initialize the document. Has to be called after \verb|\begin{document}|
\item \verb|\usetcolorboxes| Initialize tcolorboxes. In main body, if you want to use fancy boxes. (requires \texttt{most} or up)
\item \verb|\translate|\{\textit{string}\}\{\textit{string}\} First \textit{string} is English, second \textit{string} is German. Switches automatically based on language selected
\end{itemize}
\newpage
\subsection{Style}
General styling commands. All other commands, except these ones require at least \texttt{most} to be the selected \textit{scope}
\begin{itemize}
\item \verb|\TODO| Print a highlighted \TODO
\item \verb|\background|\{\textit{color}\}\{\textit{number}\}\{\textit{string}\} Print \background{ForestGreen}{50}{shaded text, with colour saturation}
\item \verb|\shade|\{\textit{color}\}\{\textit{string}\} Print \shade{ForestGreen}{shaded text}
\item \verb|\backdrop|\{\textit{string}\} Print \backdrop{text with gray backdrop}
\item \verb|\fhlc|\{\textit{color}\}\{\textit{string}\} Print \fhlc{ForestGreen}{bold, underlined text in a coloured box}
\item \verb|\fhl|\{\textit{string}\} Print \fhl{bold, underlined text in a white box}
\item \verb|\printtoc|\{\textit{color}\} Print the table of contents (as seen on the first page). The normal \verb|\tableofcontents| still works as expected
\end{itemize}
\newpage
\subsubsection{Tcolorboxes}
\textit{Included in \texttt{most} and up}
Put \verb|\usetcolorboxes| right after \verb|\startDocument| (right after \verb|\begin{document}|) if you plan to use them.
\fhlc{Aquamarine}{General}
\begin{terms}[]{Title here}
\begin{minted}{latex}
\begin{terms}[]{Title here}
\end{terms}
\end{minted}
\end{terms}
\begin{notation}[]{Title here}
\begin{minted}{latex}
\begin{notation}[]{Title here}
\end{notation}
\end{minted}
\end{notation}
\begin{recall}[]{Title here}
\begin{minted}{latex}
\begin{recall}[]{Title here}
\end{recall}
\end{minted}
\end{recall}
\begin{remarks}[]{Title here}
\begin{minted}{latex}
\begin{remarks}[]{Title here}
\end{remarks}
\end{minted}
\end{remarks}
\begin{usage}[]{Title here}
\begin{minted}{latex}
\begin{usage}[]{Title here}
\end{usage}
\end{minted}
\end{usage}
\begin{guides}[]{Title here}{Tutorial}
\begin{minted}{latex}
\begin{guides}[]{Title here}{Tutorial}
% You can also change the right title on this one
\end{guides}
\end{minted}
\end{guides}
\begin{properties}[]{Title here}
\begin{minted}{latex}
\begin{properties}[]{Title here}
\end{properties}
\end{minted}
\end{properties}
\begin{restrictions}[]{Title here}
\begin{minted}{latex}
\begin{restrictions}[]{Title here}
\end{restrictions}
\end{minted}
\end{restrictions}
\begin{limitations}[]{Title here}
\begin{minted}{latex}
\begin{limitations}[]{Title here}
\end{limitations}
\end{minted}
\end{limitations}
\fhlc{Aquamarine}{Math-Specific}
\begin{formula}[]{Title here}
\begin{minted}{latex}
\begin{formula}[]{Title here}
\end{formula}
\end{minted}
\end{formula}
\newpage
\fhlc{Aquamarine}{Counter-enabled}
These ones also have a setting, namely, you can change the counter behaviour:\\
\verb|\setcounter{numberingConfig}|\{\textit{number}\}: Change the numbering of definitions, lemmas, etc for this document. 1 = Separately, 2 = Combined (except for definition), 3 = Combined, 4 = Off
Here, it is shown with the default setting, $1$, meaning they are numbered separately. See \ref{sec:counters} for a guide on how to change the current number.
\begin{definition}[]{Title here}
\begin{minted}{latex}
\begin{definition}[]{Title here}
\end{definition}
\end{minted}
\end{definition}
\begin{theorem}[]{Title here}
\begin{minted}{latex}
\begin{theorem}[]{Title here}
\end{theorem}
\end{minted}
\end{theorem}
\begin{lemma}[]{Title here}
\begin{minted}{latex}
\begin{lemma}[]{Title here}
\end{lemma}
\end{minted}
\end{lemma}
\begin{corollary}[]{Title here}
\begin{minted}{latex}
\begin{corollary}[]{Title here}
\end{corollary}
\end{minted}
\end{corollary}
\begin{axiom}[]{Title here}
\begin{minted}{latex}
\begin{axiom}[]{Title here}
\end{axiom}
\end{minted}
\end{axiom}
\begin{example}[]{Title here}
\begin{minted}{latex}
\begin{example}[]{Title here}
\end{example}
\end{minted}
\end{example}
\newpage
\fhlc{Aquamarine}{Language-Specific}
\begin{conjugation}[]{Title here}
\begin{minted}{latex}
\begin{conjugation}[]{Title here}
\end{conjugation}
\end{minted}
\end{conjugation}
\begin{forms}[]{Title here}
\begin{minted}{latex}
\begin{forms}[]{Title here}
\end{forms}
\end{minted}
\end{forms}
\fhlc{Aquamarine}{CS-Specific}
\textit{Coming soon!}
\fhlc{Aquamarine}{Flexible}
\begin{general}[]{title}{second title}{red}
This Tcolorbox is flexible and can take any main and secondary title, as well as any colour.\\
\begin{minted}{latex}
\begin{general}[]{title}{second title}{red}
\end{general}
\end{minted}
\end{general}
\newpage
\subsubsection{Inline \& Shortened descriptors}
\textit{Included in \texttt{most} and up}
See \ref{sec:counters} for a guide on how to change the current number.
\fhlc{Aquamarine}{Inline}
\begin{tables}{ll}{Command & Output}
\verb|\inlineex| & \inlineex\\
\verb|\inlinedef| & \inlinedef\\
\verb|\inlinetheorem| & \inlinetheorem\\
\verb|\inlinelemma| & \inlinelemma\\
\verb|\inlinecorollary| & \inlinecorollary\\
\verb|\inlineaxiom| & \inlineaxiom\\
\verb|\inlineproof| & \inlineproof\\
\end{tables}
\fhlc{Aquamarine}{Shortened}
\begin{tables}{ll}{Command & Output}
\verb|\shortex| & \shortex\\
\verb|\shortdef| & \shortdef\\
\verb|\shorttheorem| & \shorttheorem\\
\verb|\shortlemma| & \shortlemma\\
\verb|\shortcorollary| & \shortcorollary\\
\verb|\shortaxiom| & \shortaxiom\\
\verb|\shortproof| & \shortproof\\
\end{tables}
\subsubsection{Changing the counters}
\label{sec:counters}
\textit{Included in \texttt{most} and up}
You may set the current number for the elements by setting their corresponding counter to the selected number. You can do this using \verb|\setcounter|\{\textit{name of the counter}\}\{\textit{number}\}, where you replace \textit{name of the counter} with one of the following:
\texttt{definitions}, \texttt{lemmas}, \texttt{theorems}, \texttt{corollaries}, \texttt{axioms}, \texttt{examples}. This only applies if you have set numberingConfig to $1$ (for all of them) and $2$ (only for \texttt{definitions}). To change the combined numbering, set \texttt{all} to your desired number.
\newpage
\subsection{Tables}
\textit{Included in \texttt{most} and up}
You can set up nice looking tables using the \texttt{booktab} and \texttt{tabulary} environments.
\begin{minted}{latex}
\begin{tables}{ll}{Left & Right}
Left content & Right Content\\
\end{tables}
\end{minted}
This outputs as
\begin{tables}{ll}{Left & Right}
Left content & Right Content\\
\end{tables}
This doesn't use the \texttt{table} environment, so no captions are possible, as to why there is also
\begin{minted}{latex}
\begin{fullTable}{ll}{Left & Right}{This is a caption}
Left content & Right Content\\
\end{fullTable}
\end{minted}
This outputs as
\begin{fullTable}{ll}{Left & Right}{This is a caption}
Left content & Right Content\\
\end{fullTable}
\subsection{Index}
\textit{Included in \texttt{most} and up}
If you want to use index, add \verb|\prepareIndex| to the preamble. Using \verb|\addIndexBold|\{\textit{string}\}, you can add entries to the index. They are printed in bold typeface in your document.
Using \verb|\addIndex|\{\textit{string}\}, you can do the same, but the text remains normal and using \verb|\addIndexItalic|\{\textit{string}\}, it is printed in italics
\subsection{Extras}
\subsubsection{BibTeX}
\textit{Included in \texttt{recommended} and up}
Use \verb|\setupBiber|\{\textit{/path/to/your/bib/sources.bib file}\} in the preamble to prepare, then use \verb|\printbib| to print your bibliography.
\subsubsection{Glossary}
\textit{Included in \texttt{recommended} and up}
Use \verb|\setupGlossary| in the preamble to prepare, then use the normal glossary commands to add entries to the glossary. When you want to print it, use \verb|\printGlossary|.
\subsubsection{Minted}
\textit{Included in \texttt{full}}
No extra configs or commands provided by this one, simply an import for minted. Be sure to enable \texttt{shell-escape} for your compiler!

60
docs/main/parts/usage.tex Normal file
View File

@ -0,0 +1,60 @@
\newsection
\section{Usage}
You can type \texttt{latex-prepare} and press tab, if you have installed the VSCode snippets, or copy over this code snippet:
\begin{minted}{latex}
\documentclass{article}
\newcommand{\dir}{~/path/to/helper} % TODO: Change your path here! No trailing slashes!
\input{\dir/include.tex}
\load{recommended} % TODO: Change the inclusion level (if necessary), see below
\setup{Type your title here}
\begin{document}
\startDocument
Type your \LaTeX here
\end{document}
\end{minted}
The \verb|\load| command takes one parameter, which can be one of the following:
\begin{itemize}
\item \texttt{minimal} Just the core styling and core functionality.
\item \texttt{most} Includes Math, CS, Language and all styling.
\item \texttt{recommended} The recommended setup. Includes BibTeX in addition to what is in most
\item \texttt{all} If you want to also include glossaries or code with highlighting
\item \texttt{letter} If you want to typeset a letter (see \ref{sec:letters})
\end{itemize}
\subsection{Configuration}
You can set a global config in config file in helper files directory. The file is located at
\texttt{/<path to helpers>/config/config.tex}. All configs are documented there. Simply open that file using any text editor and edit your config.
\subsection{Letters}
\label{sec:letters}
Letters require a different setup compared to a normal \LaTeX document:
\begin{minted}{latex}
\documentclass[12pt,a4paper]{scrlttr2}
\newcommand{\dir}{~/path/to/helper} % TODO: Change your path here! No trailing slashes!
\input{\dir/include.tex}
\load{letter}
\setkomavar{subject}{} % type your subject here
\begin{document}\raggedright
% below, type the address, being careful not to remove the backslashes
\begin{letter}{Company \\ Name \\ Address \\ CH-Place}
\opening{Intro}
Your text
\closing{Kind regards} % Your closing sentence
\end{letter}
\end{document}
\end{minted}
If you are using the snippets, you can type \texttt{latex-letter} and press tab.

View File

@ -14,6 +14,6 @@
}
\newcommand{\printbib}{
\addcontentsline{toc}{section}{Sources}
\printbibliography[title=Sources]
\addcontentsline{toc}{section}{\translate{Sources}{Quellen}}
\printbibliography[title=\translate{Sources}{Quellen}]
}

View File

@ -0,0 +1 @@
\usepackage{minted}

40
include.tex Normal file
View File

@ -0,0 +1,40 @@
% Loader
\newcommand{\load}[1]{
\edef\recommended{recommended}
\edef\minimal{minimal}
\edef\most{most}
\edef\full{full}
\edef\letter{letter}
\edef\temp{#1}
\ifx \temp\recommended
\typeout{[CustomLaTeXHelperLoader]: Loading config recommended}
\input{\dir/dist/recommended.tex}
\loadRecommended
\else
\ifx \temp\minimal
\typeout{[CustomLaTeXHelperLoader]: Loading config minimal}
\input{\dir/dist/minimal.tex}
\loadMinimal
\else
\ifx \temp\most
\typeout{[CustomLaTeXHelperLoader]: Loading config most}
\input{\dir/dist/most.tex}
\loadMost
\else
\ifx \temp\full
\typeout{[CustomLaTeXHelperLoader]: Loading config full}
\input{\dir/dist/full.tex}
\loadFull
\else
\ifx \temp\letter
\typeout{[CustomLaTeXHelperLoader]: Loading config letter}
\input{\dir/dist/letter.tex}
\else
\typeout{[CustomLaTeXHelperLoader]: NO CONFIG SPECIFIED, NOTHING LOADED!}
\fi
\fi
\fi
\fi
\fi
}

View File

@ -10,6 +10,7 @@
% This file contains all necessary dependencies for the document to compile (at all) and some core macros
% Imports %
\typeout{[Core] Importing!}
\usepackage[table, dvipsnames]{xcolor}
\usepackage{amsmath}
\usepackage{graphicx}
@ -33,18 +34,50 @@
\usepackage{ifthen}
\usepackage[hidelinks]{hyperref}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{tabulary}
% Language Switching. Currently only English and German are supported
% See docs for how to use
\newcounter{lang}
\newcommand{\setLang}[1]{
\edef\lang{#1}
\edef\en{en}
\edef\de{de}
\ifx\lang\en
\typeout{[Lang Switcher] Loading English}
\setcounter{lang}{1}
\else
\ifx\lang\de
\typeout{[Lang Switcher] Loading German}
\setcounter{lang}{2}
\else
\typeout{[Lang Switcher] No such language!}
\fi
\fi
}
\newcommand{\loadLang}{
\ifnum\value{lang}<2{
\typeout{[Lang Loader] Loaded English}
}\else {
\typeout{[Lang Loader] Loaded German}
\usepackage[ngerman]{babel}
\setcounter{lang}{2}
}
\fi
}
% Create config counters / variables. See the config file for changing them
\newcounter{numberingConfig}
\newcounter{descriptorShadeStrength}
\newcounter{shadeStrength}
% Set up the latex document, configure author, title (as first argument), as well as headers and footers
\newcommand{\setup}[1]{
\typeout{[Setup] Setting up...}
\loadLang
\usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
\title{\Huge \textbf{#1}}
\author{\authorTitle}
@ -71,12 +104,11 @@
\maketitle
\pagestyle{fancy}
\thispagestyle{fancy}
\include{./style/style.tex}
\include{./style/common.tex}
}
% Set up the latex document, only configuring the author, title and page size
\newcommand{\setupbarebones}[1]{
\loadLang
\usepackage[a4paper,textwidth=17.5cm,textheight=25cm,includehead]{geometry}
\title{\Huge \textbf{#1}}
\author{\authorTitle}
@ -84,6 +116,7 @@
% Set up the latex document for exam summaries (Extra wide body, small margins, no header)
\newcommand{\setupexams}[1]{
\loadLang
\usepackage[a4paper,textwidth=20cm,textheight=28cm,includehead]{geometry}
\title{#1}
\author{\authorTitle}
@ -91,6 +124,4 @@
% translate the document between two languages
\newcommand{\translate}[2]{
\ifnum\value{lang}<2{#1}\else {#2}\fi
}
\newcommand{\translate}[2]{\ifnum\value{lang}<2{#1}\else{#2}\fi}

View File

@ -15,7 +15,7 @@
\makeindex
}
\newcommand{\addIndex}[1]{
\textbf{\index{\MakeLowercase{#1}} #1}
}
\newcommand{\addIndexBold}[1]{\textbf{\index{\MakeLowercase{#1}} #1}}
\newcommand{\addIndexItalic}[1]{\textit{\index{\MakeLowercase{#1}} #1}}
\newcommand{\addIndex}[1]{\index{\MakeLowercase{#1}} #1}

View File

@ -1,37 +1,45 @@
%▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
%██░▄▄▀█▀▄▄▀█░▄▀▄░█░▄▀▄░█▀▄▄▀█░▄▄▀
%██░████░██░█░█▄█░█░█▄█░█░██░█░██░
%██░▀▀▄██▄▄██▄███▄█▄███▄██▄▄██▄██▄
%▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
\newtcolorbox{recall}[2][]{mainboxstyle,colback=yellow!5!white,colframe=yellow!75!black,colbacktitle=yellow!75!black,title={\large #2},
overlay={\node[draw=yellow!75!black,,fill=yellow!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1}
overlay={\node[overlaystyle,draw=yellow!75!black,,fill=yellow!75!black] at (frame.north east) {\large \translate{Recall }{Repetition }};},#1}
\newtcolorbox{remarks}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2},
overlay={\node[draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Remarks }{Bemerkungen }};},#1}
overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Remarks }{Bemerkungen }};},#1}
\newtcolorbox{guides}[3][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2},
overlay={\node[draw=red!75!black,,fill=red!75!black] at (frame.north east) {\large #3};},#1}
overlay={\node[overlaystyle,draw=red!75!black,,fill=red!75!black] at (frame.north east) {\large #3};},#1}
\newtcolorbox{properties}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2},
overlay={\node[draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1}
overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Properties }{Eigenschaften }};},#1}
\newtcolorbox{restrictions}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2},
overlay={\node[draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1}
overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Restrictions }{Einschränkungen }};},#1}
\newtcolorbox{limitations}[2][]{mainboxstyle,colback=purple!5!white,colframe=purple!75!black,colbacktitle=purple!75!black,title={\large #2},
overlay={\node[draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1}
overlay={\node[overlaystyle,draw=purple!75!black,,fill=purple!75!black] at (frame.north east) {\large \translate{Limitations }{Limitierungen }};},#1}
% Terms and notation
\newtcolorbox{terms}[2][]{mainboxstyle,colback=orange!5!white,colframe=orange!75!black,colbacktitle=orange!75!black,title={\large #2},
overlay={\node[draw=orange!75!black,,fill=orange!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1}
overlay={\node[overlaystyle,draw=orange!75!black,,fill=orange!75!black] at (frame.north east) {\large \translate{Terms }{Begriffe }};},#1}
\newtcolorbox{notation}[2][]{mainboxstyle,colback=Peach!5!white,colframe=Peach!75!black,colbacktitle=Peach!75!black,title={\large #2},
overlay={\node[draw=Peach!75!black,,fill=Peach!75!black] at (frame.north east) {\large Notation};},#1}
overlay={\node[overlaystyle,draw=Peach!75!black,,fill=Peach!75!black] at (frame.north east) {\large Notation};},#1}
\newtcolorbox{usage}[2][]{mainboxstyle,colback=green!5!white,colframe=green!75!black,colbacktitle=green!75!black,title={\large #2},
overlay={\node[draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1}
overlay={\node[overlaystyle,draw=green!75!black,,fill=green!75!black] at (frame.north east) {\large \translate{Usage }{Nutzung }};},#1}
% Proof
\newtcolorbox{proof}[2][]{mainboxstyle,colback=magenta!5!white,colframe=magenta!75!black,colbacktitle=magenta!75!black,title={\large #2},overlay={\node[overlaystyle,draw=magenta!75!black,fill=magenta!75!black] at (frame.north east) {\large \translate{Proof}{Beweis}};},#1}
% General
\newtcolorbox{general}[4][]{mainboxstyle,colback=#4!5!white,colframe=#4!75!black,colbacktitle=#4!75!black,title={\large #2},
overlay={\node[draw=#4!75!black,,fill=#4!75!black] at (frame.north east) {\large #3};},#1}
overlay={\node[overlaystyle,draw=#4!75!black,,fill=#4!75!black] at (frame.north east) {\large #3};},#1}

View File

@ -14,17 +14,12 @@
\newcounter{examples}
\newcounter{all}
\newcommand{\usenumberArabic}[1]{
\arabic{section}.\ifnum{numberingConfig}<3{
\ifnum{numberingConfig}<2{\arabic{#1}\stepcounter{#1}}\else{
\ifx#1definitions
\arabic{#1}\stepcounter{#1}
\else
\arabic{all}\stepcounter{all}
\fi
}\fi
}\else{\arabic{all}\stepcounter{all}}\fi
}
\newcommand{\usenumberArabic}[1]{\ifnum\value{numberingConfig}<4{\arabic{section}.\ifnum\value{numberingConfig}<3{\ifnum\value{numberingConfig}<2{\arabic{#1}\stepcounter{#1}}\else{
\ifx#1definitions
\arabic{#1}\stepcounter{#1}
\else
\arabic{all}\stepcounter{all}
\fi}\fi}\else{\arabic{all}\stepcounter{all}}\fi}\else{}\fi}
% Reset definition, lemma, etc counters, add a new page
@ -35,12 +30,12 @@
% Reset definitions, lemma, etc counters, do not add new page
\newcommand{\newsectionNoPB}{
\setcounter{lemmaCount}{1}
\setcounter{definitionCount}{1}
\setcounter{corollaryCount}{1}
\setcounter{theoremCount}{1}
\setcounter{axiomCount}{1}
\setcounter{exampleCount}{1}
\setcounter{lemmas}{1}
\setcounter{definitions}{1}
\setcounter{corollaries}{1}
\setcounter{theorems}{1}
\setcounter{axioms}{1}
\setcounter{examples}{1}
}
\newsectionNoPB
@ -50,26 +45,36 @@
% Theorems
\newtcolorbox{theorem}[2][]{mainboxstyle,colback=ForestGreen!5!white,colframe=ForestGreen!75!black,colbacktitle=ForestGreen!75!black,title={\large #2},
overlay={\node[draw=ForestGreen!75!black,fill=ForestGreen!75!black] at (frame.north east) {\large Theorem \usenumberArabic{theorems}};},#1}
overlay={\node[overlaystyle,draw=ForestGreen!75!black,fill=ForestGreen!75!black] at (frame.north east) {\large Theorem \usenumberArabic{theorems}};},#1}
\newtcolorbox{lemma}[2][]{mainboxstyle,colback=Aquamarine!5!white,colframe=Aquamarine!75!black,colbacktitle=Aquamarine!75!black,title={\large #2},
overlay={\node[draw=Aquamarine!75!black,fill=Aquamarine!75!black] at (frame.north east) {\large Lemma \usenumberArabic{lemmas}};},#1}
overlay={\node[overlaystyle,draw=Aquamarine!75!black,fill=Aquamarine!75!black] at (frame.north east) {\large Lemma \usenumberArabic{lemmas}};},#1}
\newtcolorbox{corollary}[2][]{mainboxstyle,colback=teal!5!white,colframe=teal!75!black,colbacktitle=teal!75!black,title={\large #2},
overlay={\node[draw=teal!75!black,fill=teal!75!black] at (frame.north east) {\large \translate{Corollary}{Korollar} \usenumberArabic{corollaries}};},#1}
overlay={\node[overlaystyle,draw=teal!75!black,fill=teal!75!black] at (frame.north east) {\large \translate{Corollary}{Korollar} \usenumberArabic{corollaries}};},#1}
\newtcolorbox{axiom}[2][]{mainboxstyle,colback=JungleGreen!5!white,colframe=JungleGreen!75!black,colbacktitle=JungleGreen!75!black,title={\large #2},
overlay={\node[draw=JungleGreen!75!black,fill=JungleGreen!75!black] at (frame.north east) {\large Axiom \usenumberArabic{axioms}};},#1}
overlay={\node[overlaystyle,draw=JungleGreen!75!black,fill=JungleGreen!75!black] at (frame.north east) {\large Axiom \usenumberArabic{axioms}};},#1}
\newtcolorbox{example}[2][]{mainboxstyle,colback=gray!5!white,colframe=gray!75!black,colbacktitle=gray!75!black,title={\large #2},
overlay={\node[draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Example }{Beispiel } \usenumberArabic{examples}};},#1}
overlay={\node[overlaystyle,draw=gray!75!black,fill=gray!75!black] at (frame.north east) {\large \translate{Example}{Beispiel} \usenumberArabic{examples}};},#1}
% Shortened environments (inline)
\newcommand{\inlineex}{\textbf{\translate{Example }{Beispiel } \hspace{0mm} \usenumberArabic{examples}}}
\newcommand{\inlinedef}{\backdrop{Definition \hspace{0mm} \usenumberArabic{definitions}:} }
\newcommand{\inlinelemma}{\backdrop{Lemma \hspace{0mm} \usenumberArabic{lemmas}:} }
\newcommand{\inlinetheorem}{\backdrop{Theorem \hspace{0mm} \usenumberArabic{theorems}:} }
\newcommand{\inlineaxiom}{\backdrop{Axiom \hspace{0mm} \usenumberArabic{axioms}:} }
\newcommand{\inlinecorollary}{\backdrop{\translate{Corollary}{Korollar} \hspace{0mm} \usenumberArabic{corollaries}}:}
\newcommand{\inlineproof}{\backdrop{\ifnum\value{lang}<2{Proof}\else {Beweis}\fi \hspace{0mm}:} }
% Inline environments (inline)
\newcommand{\inlineex}{\textbf{\translate{Example}{Beispiel} \usenumberArabic{examples}}}
\newcommand{\inlinedef}{\bg{blue}{Definition \usenumberArabic{definitions}:}}
\newcommand{\inlinelemma}{\bg{Aquamarine}{Lemma \usenumberArabic{lemmas}:}}
\newcommand{\inlinetheorem}{\bg{ForestGreen}{Theorem \usenumberArabic{theorems}:}}
\newcommand{\inlineaxiom}{\bg{JungleGreen}{Axiom \usenumberArabic{axioms}:}}
\newcommand{\inlinecorollary}{\bg{teal}{\translate{Corollary}{Korollar} \usenumberArabic{corollaries}:}}
\newcommand{\inlineproof}{\bg{magenta}{\translate{Proof}{Beweis}:}}
% short environments (abbreviated)
\newcommand{\shortex}{\textbf{\translate{Ex}{Bsp} \usenumberArabic{examples}}}
\newcommand{\shortdef}{\bg{blue}{D \usenumberArabic{definitions}:}}
\newcommand{\shortlemma}{\bg{Aquamarine}{L \usenumberArabic{lemmas}:}}
\newcommand{\shorttheorem}{\bg{ForestGreen}{T \usenumberArabic{theorems}:}}
\newcommand{\shortaxiom}{\bg{JungleGreen}{A \usenumberArabic{axioms}:}}
\newcommand{\shortcorollary}{\bg{teal}{\translate{C}{K} \usenumberArabic{corollaries}:}}
\newcommand{\shortproof}{\bg{magenta}{\translate{Proof}{Beweis}:}}

View File

@ -4,7 +4,7 @@
% Specific styles for language summaries and docs
\newtcolorbox{conjugation}[2][]{mainboxstyle,colback=blue!5!white,colframe=blue!75!black,colbacktitle=blue!75!black,title={\large #2},
overlay={\node[draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large \translate{Conjugation}{Konjugation}};},#1}
overlay={\node[overlaystyle,draw=blue!75!black,fill=blue!75!black] at (frame.north east) {\large \translate{Conjugation}{Konjugation}};},#1}
\newtcolorbox{forms}[2][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2},
overlay={\node[draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Forms}{Formen}};},#1}
overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Forms}{Formen}};},#1}

View File

@ -6,10 +6,5 @@
% Math specific tcolorboxes
\newtcolorbox{formula}[2][]{mainboxstyle,colback=red!5!white,colframe=red!75!black,colbacktitle=red!75!black,title={\large #2},
overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \ifnum\value{lang}<2{Formula}\else {Formel}\fi};},#1}
overlay={\node[overlaystyle,draw=red!75!black,fill=red!75!black] at (frame.north east) {\large \translate{Formula}{Formel}};},#1}
\newtcolorbox{proof}[2][]{arc=3mm,colback=magenta!5!white,colframe=magenta!75!black,colbacktitle=magenta!75!black,fonttitle=\bfseries,
enhanced,attach boxed title to top left={yshift=-2mm,xshift=5mm},title={\large #2},breakable,top=0.4cm,
overlay={\node[draw=magenta!75!black,thick,fill=magenta!75!black,left,anchor=east,text=white,rounded corners=1mm,font=\bfseries,
xshift=-5mm,yshift=1mm,inner xsep=3mm,inner ysep=1.5mm] at (frame.north east) {\large \ifnum\value{lang}<2{Proof}\else {Beweis}\fi};},#1}

View File

@ -48,23 +48,25 @@
\newcommand{\TODO}{\color{red} \hl{TODO:} \color{black}}
% Add a color shade (similar to \fhlc, but nicer boxes)
\newcommand{\shade}[2]{
\tcbox[on line,
boxsep=3pt,
left=0pt,
right=0pt,
top=0pt,
bottom=0pt,
colframe=white,
colback=#1!20!white,
highlight math style={enhanced}
] {\textbf{#2}}
}
\newcommand{\background}[3]{\tcbox[on line,
boxsep=3pt,
left=0pt,
right=0pt,
top=0pt,
bottom=0pt,
colframe=white,
colback=#1!#2!white,
highlight math style={enhanced}
] {\textbf{#3}}}
% Abstraction of background, where the brightness is set to 20%
\newcommand{\shade}[2]{\background{#1}{\arabic{shadeStrength}}{#2}}
% This command is used for the short and inline descriptors
\newcommand{\bg}[2]{\background{#1}{\arabic{descriptorShadeStrength}}{#2}}
% Add a gray backdrop
\newcommand{\backdrop}[1]{
\shade{black}{#1}
}
\newcommand{\backdrop}[1]{\shade{black}{#1}}
% Fancy highlighting (Bold, underlined, colorbox behind it. Shorthand for \fhlc{white}{#1}

View File

@ -5,9 +5,12 @@
% | | ( (_| | |_) )| |( ___/__ \
% (_) \__ _)_ __/(___)\____)____/
\usepackage{booktabs}
\usepackage{tabulary}
% Create new table. #1 Layout, #2 title row
\newenvironment{tab}[2]{
\newenvironment{tables}[2]{
\begin{center}
\begin{tabular}{#1}
\toprule
@ -15,15 +18,17 @@
\midrule
}{
\bottomrule
\end{center}
\end{tabular}
\end{tabular}
\end{center}
}
% Create new table in table env. #1 layout, #2 title row, #3 caption
\newenvironment{fullTable}[3]{
\edef\tableCaption{#3}
\begin{table}[h!]
\begin{tab}{#1}{#2}
\begin{tables}{#1}{#2}
}{
\caption{#3}
\end{tables}
\caption{\tableCaption}
\end{table}
}

View File

@ -1,9 +0,0 @@
\input{./barebones.tex}
\input{./main/math.tex}
\input{./main/cs.tex}
\input{./main/index.tex}
\input{./main/tables.tex}
\input{./main/style/counters.tex}
\input{./main/style/cs.tex}
\input{./main/style/math.tex}
\input{./main/style/language.tex}

View File

@ -1,2 +0,0 @@
\include{./most.tex}
\include{./extra/bib.tex}

369
vscode-snippets/tex.json Executable file
View File

@ -0,0 +1,369 @@
{
"prepare LaTeX Document": {
"prefix": "latex-prepare",
"body": [
"\\documentclass{article}\n",
"\\newcommand{\\dir}{~/projects/latex} % IMPORTANT: No trailing slashes!",
"\\input{\\dir/include.tex}",
"\\load{recommended}\n",
"\\setup{$1}\n",
"\\begin{document}",
"\\startDocument",
"\\usetcolorboxes",
"$2\n\n",
"\\end{document}"
],
"description": "Prepares a full LaTeX Document for use and compiling"
},
"Fancy table": {
"prefix": "table",
"body": [
"\\begin{tables}{$1}{$2}\n",
"\t$3\\\\",
"\\end{tables}"
],
"description": "Insert a table (without environment)"
},
"Formula": {
"prefix": "formula",
"body": [
"\\begin{formula}[]{$1}",
"\t$2",
"\\end{formula}"
],
"description": "Inserts a tcolorbox to provide a formula (red)"
},
"Definition": {
"prefix": "definition",
"body": [
"\\begin{definition}[]{$1}",
"\t$2",
"\\end{definition}"
],
"description": "Inserts a tcolorbox to provide a definition (blue)"
},
"Recall": {
"prefix": "recall",
"body": [
"\\begin{recall}[]{$1}",
"\t$2",
"\\end{recall}"
],
"description": "Inserts a tcolorbox to provide a recall / revision of previous knowledge (yellow)"
},
"Important Remarks": {
"prefix": "remarks",
"body": [
"\\begin{remarks}[]{$1}",
"\t$2",
"\\end{remarks}"
],
"description": "Inserts a tcolorbox to provide remarks (green)"
},
"Guides": {
"prefix": "guides",
"body": [
"\\begin{guides}[]{$1}{${2:Usage}}",
"\t$2",
"\\end{guides}"
],
"description": "Inserts a tcolorbox to provide guides / instructions on how to use (red)"
},
"Properties": {
"prefix": "properties",
"body": [
"\\begin{properties}[]{$1}",
"\t$2",
"\\end{properties}"
],
"description": "Inserts a tcolorbox to inform about properties"
},
"Restrictions": {
"prefix": "restrictions",
"body": [
"\\begin{restrictions}[]{$1}",
"\t$2",
"\\end{restrictions}"
],
"description": "Inserts a tcolorbox to inform about restrictions"
},
"Limitations": {
"prefix": "limitations",
"body": [
"\\begin{limitations}[]{$1}",
"\t$2",
"\\end{limitations}"
],
"description": "Inserts a tcolorbox to inform about limitations"
},
"Theorem": {
"prefix": "theorem",
"body": [
"\\begin{theorem}[]{$1}",
"\t$2",
"\\end{theorem}"
],
"description": "Inserts a tcolorbox to inform about theorems"
},
"Lemma": {
"prefix": "lemma",
"body": [
"\\begin{lemma}[]{$1}",
"\t$2",
"\\end{lemma}"
],
"description": "Inserts a tcolorbox to inform about lemmas"
},
"Corollary": {
"prefix": "corollary",
"body": [
"\\begin{corollary}[]{$1}",
"\t$2",
"\\end{corollary}"
],
"description": "Inserts a tcolorbox to inform about corollaries"
},
"Terms": {
"prefix": "terms",
"body": [
"\\begin{terms}[]{$1}",
"\t$2",
"\\end{terms}"
],
"description": "Inserts a tcolorbox to inform about terms"
},
"Proof": {
"prefix": "proof",
"body": [
"\\begin{proof}[]{$1}",
"\t$2",
"\\end{proof}"
],
"description": "Inserts a tcolorbox to show a proof"
},
"Axiom": {
"prefix": "axiom",
"body": [
"\\begin{axiom}[]{$1}",
"\t$2",
"\\end{axiom}"
],
"description": "Inserts a tcolorbox to show an axiom"
},
"Notation": {
"prefix": "notation",
"body": [
"\\begin{notation}[]{$1}",
"\t$2",
"\\end{notation}"
],
"description": "Inserts a tcolorbox to show notation"
},
"Example": {
"prefix": "example",
"body": [
"\\begin{example}[]{$1}",
"\t$2",
"\\end{example}"
],
"description": "Inserts a tcolorbox to show example"
},
"Usage": {
"prefix": "usage",
"body": [
"\\begin{usage}[]{$1}",
"\t$2",
"\\end{usage}"
],
"description": "Inserts a tcolorbox to inform about usage"
},
"Conjugation": {
"prefix": "conjugation",
"body": [
"\\begin{conjugation}[]{$1}",
"\t$2",
"\\end{conjugation}"
],
"description": "Inserts a tcolorbox to inform about conjugation"
},
"Forms": {
"prefix": "forms",
"body": [
"\\begin{forms}[]{$1}",
"\t$2",
"\\end{forms}"
],
"description": "Inserts a tcolorbox to inform about forms of e.g. grammatical structures"
},
"General-Tcolorbox": {
"prefix": "general-tcb",
"body": [
"\\begin{general}[]{${1:title}}{${2:second title}}{${3|red,green,blue,cyan,magenta,yellow,black,gray,white,darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet|}}",
"\t$4",
"\\end{general}"
],
"description": "Inserts a tcolorbox for general purposes. First bracket is title, second one is second title, third one colour"
},
"Derivative": {
"prefix": "derivative",
"body": [
"\\frac{\\mbox{d}}{\\mbox{d}x}$1"
]
},
"Example (inline)": {
"prefix": "example-inline",
"body": [
"\\inlineex"
]
},
"Example (short)": {
"prefix": "example-short",
"body": [
"\\shortex"
]
},
"Definition (inline)": {
"prefix": "definition-inline",
"body": [
"\\inlinedef"
]
},
"Definition (short)": {
"prefix": "definition-short",
"body": [
"\\shortdef"
]
},
"Theorem (inline)": {
"prefix": "theorem-inline",
"body": [
"\\inlinetheorem"
]
},
"Theorem (short)": {
"prefix": "theorem-short",
"body": [
"\\shorttheorem"
]
},
"Lemma (inline)": {
"prefix": "lemma-inline",
"body": [
"\\inlinelemma"
]
},
"Lemma (short)": {
"prefix": "lemma-short",
"body": [
"\\shortlemma"
]
},
"Corollary (inline)": {
"prefix": "corollary-inline",
"body": [
"\\inlinecorollary"
]
},
"Corollary (short)": {
"prefix": "corollary-short",
"body": [
"\\shortcorollary"
]
},
"Axiom (inline)": {
"prefix": "axiom-inline",
"body": [
"\\inlineaxiom"
]
},
"Axiom (short)": {
"prefix": "axiom-short",
"body": [
"\\shortaxiom"
]
},
"Proof (inline)": {
"prefix": "proof-inline",
"body": [
"\\inlineproof"
]
},
"Proof (short)": {
"prefix": "proof-short",
"body": [
"\\shortproof"
]
},
"bold": {
"prefix": "#bold",
"body": [
"\\textbf{$1}"
]
},
"italic": {
"prefix": "#i",
"body": [
"\\textit{$1}"
]
},
"bolditalic": {
"prefix": "#bi",
"body": [
"\\textbf{\\textit{$1}}"
]
},
"underlinie": {
"prefix": "#u",
"body": [
"\\underbar{$1}"
]
},
"algebra": {
"prefix": "algebra",
"body": [
"\\langle $1 \\rangle"
]
},
"fill-width": {
"prefix": "#fill",
"body": [
"\\hspace{\\fill}$1"
]
},
"Latex-Colour": {
"prefix": "colour",
"body": [
"${1|red,green,blue,cyan,magenta,yellow,black,gray,white,darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet|}"
]
},
"Latex-Text-Colour": {
"prefix": "colour-text",
"body": [
"\\color{${1|red,green,blue,cyan,magenta,yellow,black,gray,white,darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet|}}"
]
},
"Set Language": {
"prefix": "setLang",
"body": [
"\\setLang{$1}"
]
},
"Letter": {
"prefix": "latex-letter",
"body": [
"\\documentclass[12pt,a4paper]{scrlttr2}\n",
"\\newcommand{\\dir}{~/projects/latex} % IMPORTANT: No trailing slashes!",
"\\input{\\dir/include.tex}",
"\\load{recommended}\n",
"% Subject",
"\\setkomavar{subject}{$1}",
"\\begin{document}\\raggedright",
"\t\\begin{letter}{Company \\\\\\ Name \\\\\\ Address \\\\\\ CH-Place}",
"\t\t\\opening{Intro}\n",
"\t\t$2\n",
"\t\t\\closing{Kind regards}",
"\t\\end{letter}",
"\\end{document}"
]
}
}