Browse Source

initial commit

master
Bit 9 months ago
commit
d3d322dae5
8 changed files with 194 additions and 0 deletions
  1. +8
    -0
      base.tex
  2. +20
    -0
      base/build_commands.tex
  3. +8
    -0
      base/commands.tex
  4. +38
    -0
      base/commands/code_include.tex
  5. +58
    -0
      base/commands/math.tex
  6. +20
    -0
      base/imports.tex
  7. +11
    -0
      templates/uni.tex
  8. +31
    -0
      templates/uni/base.tex

+ 8
- 0
base.tex View File

@@ -0,0 +1,8 @@
\def \importpathconfig {.config}
\def \importpathtemplate {.template}

\InputIfFileExists{\importpathtemplate/base/imports}{}{}
\InputIfFileExists{\importpathtemplate/base/commands}{}{}
\InputIfFileExists{\importpathtemplate/base/build_commands}{}{}

\def \loadConfig {\InputIfFileExists{\importpathconfig}{}{}}

+ 20
- 0
base/build_commands.tex View File

@@ -0,0 +1,20 @@
\InputIfFileExists{\importpathtemplate/base/build_command/code_include}{}{}

\newcommand{\useTemplate}[1]{
\input{.template/templates/#1/base}
}

\newcommand{\includeTex}[1]{
\include{include/#1}
}

\newcommand{\includeAsset}[2]{
\ifendswith{#1}{.png}{
\includegraphics[#2]{#1}
}{\\\textbf{Asset format of #1 unknown}\\}
}

\newcommand{\includeBuild}[2]{
\InputIfFileExists{include/.build/#1}{}{\\\textbf{Build of #1 not found}\\}
}


+ 8
- 0
base/commands.tex View File

@@ -0,0 +1,8 @@
\InputIfFileExists{\importpathtemplate/base/commands/math}{}{}
\InputIfFileExists{\importpathtemplate/base/commands/code_include}{}{}

\newcommand{\ifendswith}[4]{
\StrLen{#2}[\strlen]
\StrRight{#1}{\strlen}[\strright]
\ifthenelse{ \equal{\strright}{#2} }{#3}{#4}
}

+ 38
- 0
base/commands/code_include.tex View File

@@ -0,0 +1,38 @@
\newcommand{\includeScript}[2]{
\ifthenelse{ \equal{#2}{python} }{
% --- Python code include ---
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=tb,
language=python,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3}
\lstinputlisting{#1}
}{
% --- Default code include ---
\lstset{frame=tb,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
breaklines=true,
breakatwhitespace=true,
tabsize=3}
\lstinputlisting{#1}
}
}

+ 58
- 0
base/commands/math.tex View File

@@ -0,0 +1,58 @@
\def \mathbbN {\mathbb{N}}
\def \mathbbZ {\mathbb{Z}}
\def \mathbbQ {\mathbb{Q}}
\def \mathbbI {\mathbb{I}}
\def \mathbbR {\mathbb{R}}
\def \mathbbC {\mathbb{C}}
\def \mathbbD {\mathbb{D}}
\def \mathbbW {\mathbb{W}}

\def \N {\mathbb{N}}
\def \Z {\mathbb{Z}}
\def \Q {\mathbb{Q}}
\def \I {\mathbb{I}}
\def \R {\mathbb{R}}
\def \C {\mathbb{C}}
\def \D {\mathbb{D}}
\def \W {\mathbb{W}}

\newcommand{\nsum}[3]{
\sum^{#1}_{#2} (#3)
}

\newcommand{\mmod}[1]{
(\mod #1)
}

\newcommand{\abs}[1]{
| #1 |
}

\newcommand{\rnddown}[1]{
\lfloor #1 \rfloor
}

\newcommand{\rndup}[1]{
\lceil #1 \rceil
}

\newcommand{\ecr}[1]{
\mathbb{Z}_{#1}
}

\newcommand{\inv}[1]{
#1^{-1}
}

\newcommand{\eqa}[1]{
\begin{eqnarray*}
#1
\end{eqnarray*}
}

\newcommand{\multifunc}[2]{
#1 = \begin{cases}
#2
\end{cases}
}


+ 20
- 0
base/imports.tex View File

@@ -0,0 +1,20 @@
\documentclass[12pt,a4paper,german]{article}
\usepackage{url}
%\usepackage{graphics}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage{ngerman}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{paralist}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{listings}
\usepackage{color}
\geometry{left=2.0cm,textwidth=17cm,top=3.5cm,textheight=23cm}
\usepackage{xstring}
\usepackage{amsthm}
\usepackage{ifthen}

+ 11
- 0
templates/uni.tex View File

@@ -0,0 +1,11 @@
\input{.template/base}
\useTemplate{uni}

%\private
%\uniKrypto
%\uniMathe

\begin{document}
\headline{Lösung für Übung \#}

\end{document}

+ 31
- 0
templates/uni/base.tex View File

@@ -0,0 +1,31 @@
\def \gruppe {}
\def \name {}
\def \pname {}
\def \ppname {}
\def \pppname {}
\def \matrikel {xxxxxxxxxxxx}
\def \pmatrikel {xxxxxxxxxxxx}
\def \ppmatrikel {xxxxxxxxxxxx}
\def \pppmatrikel {xxxxxxxxxxxx}
\loadConfig

\def \private {\def \isprivate {true}}
\def \isprivate {false}

\newcommand{\ifempty}[3]{\ifthenelse{ \equal{#1}{} }{#2}{#3}}


\newcommand{\headline}[1]{
\vspace*{-2cm}
\ifthenelse{ \equal{\isprivate}{true} }{
\noindent \name \\
}{
\ifempty{\name}{}{
\noindent \matrikel \quad \name \ifempty{\gruppe}{}{\hfill Gruppe: \gruppe} \\
\ifempty{\pname}{}{\noindent \pmatrikel \quad \pname \\}
\ifempty{\ppname}{}{\noindent \ppmatrikel \quad \ppname \\}
\ifempty{\pppname}{}{\noindent \pppmatrikel \quad \pppname \\}
}
}
\begin{center}{\Large \bf #1}\end{center}
}

Loading…
Cancel
Save