commit b63de650f86663a6765c162d1fe99b9b7f28149c Author: Philipp Horstenkamp Date: Tue Jan 10 22:23:53 2023 +0100 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef35fa0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,488 @@ +# ---> TeX +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs +*.slg +*.slo +*.sls + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplot +*.gnuplot +*.table + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.glog +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files +# *.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# newpax +*.newpax + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# svg +svg-inkscape/ + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# titletoc +*.ptc + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# gummi +.*.swp + +# KBibTeX +*~[0-9]* + +# TeXnicCenter +*.tps + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files +*.lpz + +# xwatermark package +*.xwm + +# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib +# option is specified. Footnotes are the stored in a file with suffix Notes.bib. +# Uncomment the next line to have this generated file ignored. +#*Notes.bib + +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# ---> JupyterNotebooks +# gitignore template for Jupyter Notebooks +# website: http://jupyter.org/ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +# IPython +profile_default/ +ipython_config.py + +# Remove previous ipynb_checkpoints +# git rm -r .ipynb_checkpoints/ + +/Couchbase-Content - Kopie.tex +/einstein.jpg +/links.txt +/Coucbase DB.pdf +venv +.idea + +/*.exe +/JupyterServer/old diff --git a/Example.ipynb b/Example.ipynb new file mode 100644 index 0000000..0e6b902 --- /dev/null +++ b/Example.ipynb @@ -0,0 +1,241 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "f536eab6-2776-4535-972a-3ece6be99b3a", + "metadata": {}, + "outputs": [], + "source": [ + "# Some configs that should not be shown!\n", + "import warnings\n", + "\n", + "warnings.simplefilter(action=\"ignore\", category=FutureWarning)" + ] + }, + { + "cell_type": "markdown", + "id": "f6597a28-a4fc-46bb-a9b2-3cafbc944ef5", + "metadata": {}, + "source": [ + "# Start here\n", + "# First headline\n", + "Some nice text!" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "0c9dbddc-f5f5-4f58-a2e2-dfff0faf517f", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\n", + "[notice] A new release of pip available: 22.3 -> 22.3.1\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n", + "\n", + "[notice] A new release of pip available: 22.3 -> 22.3.1\n", + "[notice] To update, run: python.exe -m pip install --upgrade pip\n" + ] + } + ], + "source": [ + "!pip install pandas==1.5.2 -q\n", + "!pip install matplotlib==3.6.2 -q" + ] + }, + { + "cell_type": "markdown", + "id": "8f41454c-0bf0-4e53-992b-34fb47bf7dd1", + "metadata": {}, + "source": [ + "Import the classes necessary to run the software." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "5c4c7d02-c06b-49c3-a6e6-9819e9eae44b", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "id": "2e5173f8-7c64-40f4-8fbe-e3bf28ad96a3", + "metadata": {}, + "source": [ + "A bit of sample code!" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "66ada60d-8a49-473b-bc38-a40999ba761a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": "362880" + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a = 1\n", + "for i in range(1, 10):\n", + " a *= i\n", + "a" + ] + }, + { + "cell_type": "markdown", + "id": "3dbc2840-9793-4a92-802b-78d0b333e632", + "metadata": {}, + "source": [ + "Acces a document by key." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "5e5fd8c8-200f-4857-b63d-1172b842f11c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": "{'test': 1, 'more content': 'some_more1', 'more content1': 'some_more2'}" + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# get a document by key\n", + "some_dict = {\"test\": 1, \"more content\": \"some_more1\", \"more content1\": \"some_more2\"}\n", + "some_dict" + ] + }, + { + "cell_type": "markdown", + "id": "e818c095-e2d9-40c7-9234-ceddcb27cddb", + "metadata": {}, + "source": [ + "Pandas Example!" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "8eb6d0be-9fc0-4c89-ad18-801c0349d5cc", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\\begin{tabular}{lrll}\n", + "\\toprule\n", + "{} & test & more content & more content1 \\\\\n", + "\\midrule\n", + "0 & 1 & some\\_more1 & some\\_more2 \\\\\n", + "1 & 1 & some\\_more1 & some\\_more2 \\\\\n", + "2 & 1 & some\\_more1 & some\\_more2 \\\\\n", + "3 & 1 & some\\_more1 & some\\_more2 \\\\\n", + "4 & 1 & some\\_more1 & some\\_more2 \\\\\n", + "\\bottomrule\n", + "\\end{tabular}\n", + "\n" + ] + } + ], + "source": [ + "df = pd.DataFrame([some_dict] * 10)\n", + "print(df.head().to_latex())" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "c1237c23-2ab4-4fa0-9895-0691c20827b6", + "metadata": {}, + "outputs": [], + "source": [ + "%%capture\n", + "N = 400\n", + "t = np.linspace(0, 2 * np.pi, N)\n", + "r = 0.5 + np.cos(t)\n", + "x, y = r * np.cos(t), r * np.sin(t)\n", + "\n", + "fig, ax = plt.subplots()\n", + "ax.plot(x, y, \"k\")\n", + "ax.set(aspect=1)\n", + "plt.show()\n", + "plt.savefig(\"diagramm.png\")" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# End here\n", + "\n", + "This should not be shown!" + ], + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (2007221166.py, line 3)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m File \u001b[1;32m\"C:\\Users\\phhor\\AppData\\Local\\Temp\\ipykernel_2708\\2007221166.py\"\u001b[1;36m, line \u001b[1;32m3\u001b[0m\n\u001b[1;33m This should not be shownm\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "execution_count": 1 + }, + { + "cell_type": "code", + "execution_count": 7, + "outputs": [], + "source": [], + "metadata": { + "collapsed": false + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Example.tex b/Example.tex new file mode 100644 index 0000000..5ff70d1 --- /dev/null +++ b/Example.tex @@ -0,0 +1,104 @@ +\hypertarget{first-headline}{% +\section{First headline}\label{first-headline}} + +Some nice text! + +\hypertarget{0c9dbddc-f5f5-4f58-a2e2-dfff0faf517f}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +!pip install pandas==1.5.2 -q +!pip install matplotlib==3.6.2 -q +\end{lstlisting} +\end{minipage} + +\begin{lstlisting} + +[notice] A new release of pip available: 22.3 -> 22.3.1 +[notice] To update, run: python.exe -m pip install --upgrade pip + +[notice] A new release of pip available: 22.3 -> 22.3.1 +[notice] To update, run: python.exe -m pip install --upgrade pip +\end{lstlisting} + +\leavevmode\vadjust pre{\hypertarget{8f41454c-0bf0-4e53-992b-34fb47bf7dd1}{}}% +Import the classes necessary to run the software. + +\hypertarget{5c4c7d02-c06b-49c3-a6e6-9819e9eae44b}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +import pandas as pd +import numpy as np + +import matplotlib.pyplot as plt +\end{lstlisting} +\end{minipage} + +\leavevmode\vadjust pre{\hypertarget{2e5173f8-7c64-40f4-8fbe-e3bf28ad96a3}{}}% +A bit of sample code! + +\hypertarget{66ada60d-8a49-473b-bc38-a40999ba761a}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +a = 1 +for i in range(1, 10): + a *= i +a +\end{lstlisting} +\end{minipage} + +\begin{lstlisting} +362880 +\end{lstlisting} + +\leavevmode\vadjust pre{\hypertarget{3dbc2840-9793-4a92-802b-78d0b333e632}{}}% +Acces a document by key. + +\hypertarget{5e5fd8c8-200f-4857-b63d-1172b842f11c}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +# get a document by key +some_dict = {"test": 1, "more content": "some_more1", "more content1": "some_more2"} +some_dict +\end{lstlisting} +\end{minipage} + +\begin{lstlisting} +{'test': 1, 'more content': 'some_more1', 'more content1': 'some_more2'} +\end{lstlisting} + +\leavevmode\vadjust pre{\hypertarget{e818c095-e2d9-40c7-9234-ceddcb27cddb}{}}% +Pandas Example! + +\hypertarget{8eb6d0be-9fc0-4c89-ad18-801c0349d5cc}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +df = pd.DataFrame([some_dict] * 10) +df.head() +\end{lstlisting} +\end{minipage} + +\begin{tabular}{lrll} +\toprule +{} & test & more content & more content1 \\ +\midrule +0 & 1 & some\_more1 & some\_more2 \\ +1 & 1 & some\_more1 & some\_more2 \\ +2 & 1 & some\_more1 & some\_more2 \\ +3 & 1 & some\_more1 & some\_more2 \\ +4 & 1 & some\_more1 & some\_more2 \\ +\bottomrule +\end{tabular} + +\hypertarget{c1237c23-2ab4-4fa0-9895-0691c20827b6}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython]N = 400 +t = np.linspace(0, 2 * np.pi, N) +r = 0.5 + np.cos(t) +x, y = r * np.cos(t), r * np.sin(t) + +fig, ax = plt.subplots() +ax.plot(x, y, "k") +ax.set(aspect=1) +plt.show() +\end{lstlisting} +\end{minipage} \ No newline at end of file diff --git a/JupyterConnector.ipynb b/JupyterConnector.ipynb new file mode 100644 index 0000000..dc7c04b --- /dev/null +++ b/JupyterConnector.ipynb @@ -0,0 +1,288 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "f536eab6-2776-4535-972a-3ece6be99b3a", + "metadata": {}, + "outputs": [], + "source": [ + "import warnings\n", + "\n", + "warnings.simplefilter(action=\"ignore\", category=FutureWarning)" + ] + }, + { + "cell_type": "markdown", + "id": "f6597a28-a4fc-46bb-a9b2-3cafbc944ef5", + "metadata": {}, + "source": [ + "# Start here\n", + "### Install couchbase and pandas with specified versions\n", + "The cell below installs the couchbase python package and pandas." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "0c9dbddc-f5f5-4f58-a2e2-dfff0faf517f", + "metadata": {}, + "outputs": [], + "source": [ + "!pip install couchbase==4.1.1 -q\n", + "!pip install pandas==1.5.2 -q" + ] + }, + { + "cell_type": "markdown", + "id": "8f41454c-0bf0-4e53-992b-34fb47bf7dd1", + "metadata": {}, + "source": [ + "Import the the classes necessary to run the couchbase connector." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "5c4c7d02-c06b-49c3-a6e6-9819e9eae44b", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "from couchbase.cluster import Cluster\n", + "from couchbase.auth import PasswordAuthenticator\n", + "\n", + "from couchbase.options import ClusterOptions, QueryOptions" + ] + }, + { + "cell_type": "markdown", + "id": "2e5173f8-7c64-40f4-8fbe-e3bf28ad96a3", + "metadata": {}, + "source": [ + "Connect to the cluster select the sample bucket and connect to the default collection." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "66ada60d-8a49-473b-bc38-a40999ba761a", + "metadata": {}, + "outputs": [], + "source": [ + "cluster = Cluster.connect(\n", + " \"couchbase://couchbase1\",\n", + " ClusterOptions(\n", + " PasswordAuthenticator(\"Administrator\", \"some-pw-that-is-better-than-this!\")\n", + " ),\n", + ")\n", + "bucket = cluster.bucket(\"travel-sample\")\n", + "\n", + "# get a reference to the default collection\n", + "cb_coll = bucket.default_collection()" + ] + }, + { + "cell_type": "markdown", + "id": "3dbc2840-9793-4a92-802b-78d0b333e632", + "metadata": {}, + "source": [ + "Acces a document by key." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "5e5fd8c8-200f-4857-b63d-1172b842f11c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'id': 10,\n", + " 'type': 'airline',\n", + " 'name': '40-Mile Air',\n", + " 'iata': 'Q5',\n", + " 'icao': 'MLA',\n", + " 'callsign': 'MILE-AIR',\n", + " 'country': 'United States'}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# get a document by key\n", + "result = cb_coll.get(\"airline_10\")\n", + "result.value" + ] + }, + { + "cell_type": "markdown", + "id": "e818c095-e2d9-40c7-9234-ceddcb27cddb", + "metadata": {}, + "source": [ + "The Querry language contains a \n", + "If a hyphen is used please use a pair of \\` to surround the name using a hyphen." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "8eb6d0be-9fc0-4c89-ad18-801c0349d5cc", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "RangeIndex: 1968 entries, 0 to 1967\n", + "Data columns (total 9 columns):\n", + " # Column Non-Null Count Dtype \n", + "--- ------ -------------- ----- \n", + " 0 airportname 1968 non-null object\n", + " 1 city 1968 non-null object\n", + " 2 country 1968 non-null object\n", + " 3 faa 1709 non-null object\n", + " 4 geo 1968 non-null object\n", + " 5 icao 1687 non-null object\n", + " 6 id 1968 non-null int64 \n", + " 7 type 1968 non-null object\n", + " 8 tz 1968 non-null object\n", + "dtypes: int64(1), object(8)\n", + "memory usage: 138.5+ KB\n" + ] + } + ], + "source": [ + "result = cluster.query(\n", + " \"\"\"\n", + " SELECT airport.* \n", + " FROM `travel-sample`.inventory.airport airport\n", + " \"\"\",\n", + " QueryOptions(metrics=True),\n", + ")\n", + "df = pd.DataFrame(result)\n", + "df.info()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "c1237c23-2ab4-4fa0-9895-0691c20827b6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\\begin{tabular}{llll}\n", + "\\toprule\n", + "{} & airportname & city & country \\\\\n", + "\\midrule\n", + "\\textbf{4877} & London Heliport & London & United Kingdom \\\\\n", + "\\textbf{4289} & London St Pancras & London & United Kingdom \\\\\n", + "\\textbf{3411} & Stansted & London & United Kingdom \\\\\n", + "\\textbf{6457} & London - Kings Cross & London & United Kingdom \\\\\n", + "\\textbf{8759} & Charles De Gaulle & Paris & France \\\\\n", + "\\bottomrule\n", + "\\end{tabular}\n", + "\n" + ] + } + ], + "source": [ + "result = cluster.query(\n", + " \"\"\"\n", + " SELECT airport.airportname, airport.city, airport.country \n", + " FROM `travel-sample`.inventory.airport airport INNER JOIN `travel-sample`.inventory.landmark landmark on airport.city = landmark.city\n", + " \"\"\",\n", + " QueryOptions(metrics=True),\n", + ")\n", + "print(pd.DataFrame(result).sample(5).to_latex(bold_rows=True))" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "a4cc7ef5-511e-4709-9d82-e1c20238f173", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\\begin{tabular}{lllll}\n", + "\\toprule\n", + "{} & airportname & city & country & name \\\\\n", + "\\midrule\n", + "\\textbf{443 } & Edinburgh & Edinburgh & United Kingdom & Murrayfield Ice Rink \\\\\n", + "\\textbf{1487} & Luton & London & United Kingdom & The Phoenix \\\\\n", + "\\textbf{3620} & Paddington Station & London & United Kingdom & Kensal Green Cemetery \\\\\n", + "\\textbf{5629} & London-Corbin Airport-MaGee Field & London & United States & Alexandra Palace \\\\\n", + "\\textbf{8588} & Le Bourget & Paris & France & Aux Merveilleux de Fred \\\\\n", + "\\bottomrule\n", + "\\end{tabular}\n", + "\n" + ] + } + ], + "source": [ + "result = cluster.query(\n", + " \"\"\"\n", + " SELECT airport.airportname, airport.city, airport.country, landmark.name\n", + " FROM `travel-sample`.inventory.airport airport INNER JOIN `travel-sample`.inventory.landmark landmark on airport.city = landmark.city\n", + " \"\"\",\n", + " QueryOptions(metrics=True),\n", + ")\n", + "print(pd.DataFrame(result).sample(5).sort_index().to_latex(bold_rows=True))" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# End here\n", + "\n", + "This should not be shownm" + ], + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (2007221166.py, line 3)", + "output_type": "error", + "traceback": [ + "\u001B[1;36m File \u001B[1;32m\"C:\\Users\\phhor\\AppData\\Local\\Temp\\ipykernel_2708\\2007221166.py\"\u001B[1;36m, line \u001B[1;32m3\u001B[0m\n\u001B[1;33m This should not be shownm\u001B[0m\n\u001B[1;37m ^\u001B[0m\n\u001B[1;31mSyntaxError\u001B[0m\u001B[1;31m:\u001B[0m invalid syntax\n" + ] + } + ], + "execution_count": 1 + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Logo-CMYK.jpg b/Logo-CMYK.jpg new file mode 100644 index 0000000..eb93cb2 Binary files /dev/null and b/Logo-CMYK.jpg differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc44deb --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# Jupyter notebook to python conversion example! + +Use to convert a Juypter notebook into an `*.tex` file that can easely be imported! + +## Requirements + +- [pandoc](https://pandoc.org/) +- [python](https://www.python.org/) +- A latex compiler like miktex or overleaf +- Optionall install [black\[jupyter\]](https://pypi.org/project/black/) + +## Jupyter +Create a jupyter notebook. +Do your experiments. + +Headlines will be converted into sections and subsections! +Register in `listing_conversion.py`. There is a `dict` at the top! +Use an `*.ipynb` fiel +Add the `listing_preamble.tex` to support the listings. Please do not modify them. + +If you want to ensure your code is properly formated install black jupyter with `pip install black[juypter]`. + +If you want your `pd.DataFrame`s formated like tables display them in jupyter like this: + +```python +print(dataframe.to_latex()) +``` +This will be converted to `dataframe` via regex. +The output will also be formated. Some formating options will work via the `to_latex` function. + +Execurte the `listing_conversion.py`. +Input your latex file into your project. + +Also include the `listing_preamble.tex` before the content starts. + +Build your document! + + + +### Prefix section +You can ignore a prefix section in the `*.ipynb` by adding `# Start here` in a MD section. +Everithing before the first occurrence of that headline will be dropped. The `#Start here` tag will get lost to. +This is optional! + +### Suffix section +You can ignore a suffix section in the `*.ipynb` by adding `# End here` in a MD section. +Everithing after the first occurrence of that headline will be dropped. The `# End here` tag will get lost to. +This is optional! + +# Contribute + +Please contribute for additional functionality. +Support for plots is still missing! + diff --git a/Vorlage_Abschlussarbeit.pdf b/Vorlage_Abschlussarbeit.pdf new file mode 100644 index 0000000..945a02d Binary files /dev/null and b/Vorlage_Abschlussarbeit.pdf differ diff --git a/Vorlage_Abschlussarbeit.tex b/Vorlage_Abschlussarbeit.tex new file mode 100644 index 0000000..91c6fb5 --- /dev/null +++ b/Vorlage_Abschlussarbeit.tex @@ -0,0 +1,52 @@ +\documentclass[a4paper, 11pt, toc=listof, toc=bib]{scrbook} + +% Vorlage fuer Abschlussarbeiten +% Version 2022-05-17 +% Getestet mit TeX Live; Kodierung: UTF8 + +% Hier Daten eintragen: +\newcommand{\name}{Max Mustermann} +\newcommand{\abschlussarbeit}{Masterarbeit} +\newcommand{\hochschule}{Fachhochschule Südwestfalen} +\newcommand{\datum}{1. Januar 1970} +\newcommand{\titeldeutsch}{Deutscher Titel\\ der Abschlussarbeit} +\newcommand{\titelenglisch}{Englischer Titel der Abschlussarbeit} +\newcommand{\erstpruefer}{Prof. Dr. ...} +\newcommand{\zweitpruefer}{Prof. Dr. ...} +% Ende der Daten + +\usepackage[inner=25mm, outer=25mm, top=25mm, bottom=25mm]{geometry} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{lmodern} +\usepackage[ngerman]{babel} +\usepackage[style=alphabetic, backend=biber]{biblatex}\addbibresource{literatur.bib}\usepackage{csquotes} +\usepackage{scrlayer-scrpage}\lohead{\rightmark}\rehead{\leftmark}\ohead{\pagemark} +\usepackage{booktabs} +\usepackage{microtype} +\usepackage{graphicx} +\usepackage{scrhack} +\parindent0pt\parskip6pt + +\usepackage{listings} +\renewcommand{\lstlistingname}{Listing} +\renewcommand{\lstlistlistingname}{Listingverzeichnis} +\lstset{basicstyle=\small\ttfamily, breaklines=true, numbers=left} + +\input{listing_preamble} % add this line and add the file! + +\begin{document} +\frontmatter +\input{frontmatter} +\tableofcontents + +\mainmatter +\ofoot*{} +\input{mainmatter} + +\backmatter +\printbibliography +\listoffigures +\listoftables +\lstlistoflistings +\end{document} diff --git a/connector.tex b/connector.tex new file mode 100644 index 0000000..9ae86b7 --- /dev/null +++ b/connector.tex @@ -0,0 +1,159 @@ +\hypertarget{install-couchbase-and-pandas-with-specified-versions}{% +\subsubsection{Install couchbase and pandas with specified +versions}\label{install-couchbase-and-pandas-with-specified-versions}} + +The cell below installs the couchbase python package and pandas. + +\hypertarget{0c9dbddc-f5f5-4f58-a2e2-dfff0faf517f}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +!pip install couchbase==4.1.1 -q +!pip install pandas==1.5.2 -q +\end{lstlisting} +\end{minipage} + +\leavevmode\vadjust pre{\hypertarget{8f41454c-0bf0-4e53-992b-34fb47bf7dd1}{}}% +Import the the classes necessary to run the couchbase connector. + +\hypertarget{5c4c7d02-c06b-49c3-a6e6-9819e9eae44b}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +import pandas as pd +from couchbase.cluster import Cluster +from couchbase.auth import PasswordAuthenticator + +from couchbase.options import ClusterOptions, QueryOptions +\end{lstlisting} +\end{minipage} + +\leavevmode\vadjust pre{\hypertarget{2e5173f8-7c64-40f4-8fbe-e3bf28ad96a3}{}}% +Connect to the cluster select the sample bucket and connect to the +default collection. + +\hypertarget{66ada60d-8a49-473b-bc38-a40999ba761a}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +cluster = Cluster.connect( + "couchbase://couchbase1", + ClusterOptions( + PasswordAuthenticator("Administrator", "some-pw-that-is-better-than-this!") + ), +) +bucket = cluster.bucket("travel-sample") + +# get a reference to the default collection +cb_coll = bucket.default_collection() +\end{lstlisting} +\end{minipage} + +\leavevmode\vadjust pre{\hypertarget{3dbc2840-9793-4a92-802b-78d0b333e632}{}}% +Acces a document by key. + +\hypertarget{5e5fd8c8-200f-4857-b63d-1172b842f11c}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +# get a document by key +result = cb_coll.get("airline_10") +result.value +\end{lstlisting} +\end{minipage} + +\begin{lstlisting} +{'id': 10, + 'type': 'airline', + 'name': '40-Mile Air', + 'iata': 'Q5', + 'icao': 'MLA', + 'callsign': 'MILE-AIR', + 'country': 'United States'} +\end{lstlisting} + +\leavevmode\vadjust pre{\hypertarget{e818c095-e2d9-40c7-9234-ceddcb27cddb}{}}% +The Querry language contains a If a hyphen is used please use a pair of +` to surround the name using a hyphen. + +\hypertarget{8eb6d0be-9fc0-4c89-ad18-801c0349d5cc}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +result = cluster.query( + """ + SELECT airport.* + FROM `travel-sample`.inventory.airport airport + """, + QueryOptions(metrics=True), +) +df = pd.DataFrame(result) +df.info() +\end{lstlisting} +\end{minipage} + +\begin{lstlisting} + +RangeIndex: 1968 entries, 0 to 1967 +Data columns (total 9 columns): + # Column Non-Null Count Dtype +--- ------ -------------- ----- + 0 airportname 1968 non-null object + 1 city 1968 non-null object + 2 country 1968 non-null object + 3 faa 1709 non-null object + 4 geo 1968 non-null object + 5 icao 1687 non-null object + 6 id 1968 non-null int64 + 7 type 1968 non-null object + 8 tz 1968 non-null object +dtypes: int64(1), object(8) +memory usage: 138.5+ KB +\end{lstlisting} + +\hypertarget{c1237c23-2ab4-4fa0-9895-0691c20827b6}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +result = cluster.query( + """ + SELECT airport.airportname, airport.city, airport.country + FROM `travel-sample`.inventory.airport airport INNER JOIN `travel-sample`.inventory.landmark landmark on airport.city = landmark.city + """, + QueryOptions(metrics=True), +) +pd.DataFrame(result).sample(5) +\end{lstlisting} +\end{minipage} + +\begin{tabular}{llll} +\toprule +{} & airportname & city & country \\ +\midrule +\textbf{4877} & London Heliport & London & United Kingdom \\ +\textbf{4289} & London St Pancras & London & United Kingdom \\ +\textbf{3411} & Stansted & London & United Kingdom \\ +\textbf{6457} & London - Kings Cross & London & United Kingdom \\ +\textbf{8759} & Charles De Gaulle & Paris & France \\ +\bottomrule +\end{tabular} + +\hypertarget{a4cc7ef5-511e-4709-9d82-e1c20238f173}{} +\begin{minipage}{1.0\textwidth} +\begin{lstlisting}[language=iPython] +result = cluster.query( + """ + SELECT airport.airportname, airport.city, airport.country, landmark.name + FROM `travel-sample`.inventory.airport airport INNER JOIN `travel-sample`.inventory.landmark landmark on airport.city = landmark.city + """, + QueryOptions(metrics=True), +) +pd.DataFrame(result).sample(5).sort_index() +\end{lstlisting} +\end{minipage} + +\begin{tabular}{lllll} +\toprule +{} & airportname & city & country & name \\ +\midrule +\textbf{443 } & Edinburgh & Edinburgh & United Kingdom & Murrayfield Ice Rink \\ +\textbf{1487} & Luton & London & United Kingdom & The Phoenix \\ +\textbf{3620} & Paddington Station & London & United Kingdom & Kensal Green Cemetery \\ +\textbf{5629} & London-Corbin Airport-MaGee Field & London & United States & Alexandra Palace \\ +\textbf{8588} & Le Bourget & Paris & France & Aux Merveilleux de Fred \\ +\bottomrule +\end{tabular} \ No newline at end of file diff --git a/diagramm.png b/diagramm.png new file mode 100644 index 0000000..7fc41cf Binary files /dev/null and b/diagramm.png differ diff --git a/frontmatter.tex b/frontmatter.tex new file mode 100644 index 0000000..968fe36 --- /dev/null +++ b/frontmatter.tex @@ -0,0 +1,57 @@ +\begin{titlepage} +\begin{center} +\begin{center} +\includegraphics{Logo-CMYK} +\end{center} + +\vspace*{10mm} +\huge +\textbf{\titeldeutsch} + +\vspace{10mm} +\Large +\titelenglisch + +\vspace{15mm} +\LARGE +\textsc{\abschlussarbeit} + +\vspace{20mm} +\large +\name + +\hochschule + +\datum +\end{center} +\end{titlepage} + +\clearpage + +\normalsize\normalfont + +\thispagestyle{plain} +\begin{tabular}{ll} +Autor: & \name \\ +Referent: & \erstpruefer \\ +Korreferent: & \zweitpruefer \\ +Eingereicht: & \datum +\end{tabular} + +\chapter*{Zusammenfassung} +\addcontentsline{toc}{chapter}{Zusammenfassung} + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + +\chapter*{Erklärung} + +Ich erkläre hiermit, dass ich die vorliegende Arbeit selbstständig verfasst und dabei keine anderen als die angegebenen Hilfsmittel benutzt habe. Sämtliche Stellen der Arbeit, die im Wortlaut oder dem Sinn nach Werken anderer Autoren entnommen sind, habe ich als solche kenntlich gemacht. Die Arbeit wurde bisher weder gesamt noch in Teilen einer anderen Prüfungsbehörde vorgelegt und auch noch nicht veröffentlicht. + +\bigskip +\noindent +\datum + +\vspace{25mm} + +\noindent +\name diff --git a/listing_conversion.py b/listing_conversion.py new file mode 100644 index 0000000..f02e3bd --- /dev/null +++ b/listing_conversion.py @@ -0,0 +1,75 @@ +import sys +import os +import re + +list_files = {"Example.ipynb": "Example.tex"} + +if __name__ == "__main__": + for orig_name, tex_name in list_files.items(): + print(f"Converting file {orig_name} into {tex_name}.") + if not os.path.exists(orig_name): + print(f"Original file {os.path.abspath(orig_name)} could not be found!") + continue + + + print("Using black next comment out if you don't want to use it") + + try: + os.system(f"black {orig_name}") + except: + pass + + os.system(f"pandoc --listings -f ipynb -t latex {orig_name} -o {tex_name}") + + if not os.path.exists(tex_name): + print(f"The file {os.path.abspath(tex_name)} does not exist.") + print("The file should now exist") + continue + + with open(tex_name, "r", encoding="utf-8") as read_file: + content = read_file.read() + + start_string = "\\hypertarget{start-here}{%\n\\section{Start here}\\label{start-here}}" + end_string = "\\hypertarget{end-here}{%\n\\section{End here}\\label{end-here}}" + content = content.split(start_string, 2)[1] if start_string in content else content + # print(content) + content = content.split(end_string)[0] if end_string in content else content + print(content) + + # redefine code blocks as IPython blocks and add the minipage surrounding to force them on a single page. + content = re.sub( + r"\\begin\{lstlisting}\[language=Python](.+?)\\end\{lstlisting}", + "\\\\begin{minipage}{1.0\\\\textwidth}\n" + "\\\\begin{lstlisting}[language=iPython]\\g<1>" + "\\\\end{lstlisting}\n\\\\end{minipage}", + content, + flags=re.DOTALL, + ) + + # remove the listings code around a pandas table exported as latex. + content = re.sub( + r"\\begin\{lstlisting}\n*\\begin\{tabular}", + "\\\\begin{tabular}", + content, + flags=re.DOTALL, + ) + content = re.sub( + r"\\end\{tabular}\n*\\end\{lstlisting}", + "\\\\end{tabular}", + content, + flags=re.DOTALL, + ) + content = re.sub( + r"print\((.+?)\.to_latex\(.*?\)\)\n", "\\g<1>\\n", content, flags=re.DOTALL + ) + + content = re.sub(r"\n(%%capture\n)", "", content, flags=re.DOTALL) + content = re.sub(r"\n(plt.savefig\(.*?\))", "", content, flags=re.DOTALL) + + + content = content.strip() + + # overwrite the original file + with open(tex_name, "w", encoding="utf-8") as write_file: + content = write_file.write(content) + diff --git a/listing_preamble.tex b/listing_preamble.tex new file mode 100644 index 0000000..232d276 --- /dev/null +++ b/listing_preamble.tex @@ -0,0 +1,129 @@ +\usepackage{xcolor} +\usepackage{hyperref} + +\lstdefinestyle{yaml}{ + basicstyle=\color{blue}\footnotesize, + rulecolor=\color{black}, + string=[s]{'}{'}, + stringstyle=\color{blue}, + comment=[l]{:}, + commentstyle=\color{black}, + morecomment=[l]{-} +} + +\definecolor{delim}{RGB}{20,105,176} +\definecolor{numb}{RGB}{106, 109, 32} +\definecolor{string}{rgb}{0.64,0.08,0.08} + +\lstdefinelanguage{json}{ + numbers=left, + numberstyle=\small, + frame=single, + rulecolor=\color{black}, + showspaces=false, + showtabs=false, + breaklines=true, + postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{gray}\hookrightarrow\space}}, + breakatwhitespace=true, + basicstyle=\ttfamily\small, + upquote=true, + morestring=[b]", + stringstyle=\color{string}, + literate= + *{0}{{{\color{numb}0}}}{1} + {1}{{{\color{numb}1}}}{1} + {2}{{{\color{numb}2}}}{1} + {3}{{{\color{numb}3}}}{1} + {4}{{{\color{numb}4}}}{1} + {5}{{{\color{numb}5}}}{1} + {6}{{{\color{numb}6}}}{1} + {7}{{{\color{numb}7}}}{1} + {8}{{{\color{numb}8}}}{1} + {9}{{{\color{numb}9}}}{1} + {\{}{{{\color{delim}{\{}}}}{1} + {\}}{{{\color{delim}{\}}}}}{1} + {[}{{{\color{delim}{[}}}}{1} + {]}{{{\color{delim}{]}}}}{1}, +} + +\definecolor{maroon}{cmyk}{0, 0.87, 0.68, 0.32} +\definecolor{halfgray}{gray}{0.55} +\definecolor{ipython_frame}{RGB}{207, 207, 207} +\definecolor{ipython_bg}{RGB}{247, 247, 247} +\definecolor{ipython_red}{RGB}{186, 33, 33} +\definecolor{ipython_green}{RGB}{0, 128, 0} +\definecolor{ipython_cyan}{RGB}{64, 128, 128} +\definecolor{ipython_purple}{RGB}{170, 34, 255} +\lstdefinelanguage{iPython}{ + morekeywords={access,and,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,not,or,pass,print,raise,return,try,while},% + % + % Built-ins + morekeywords=[2]{abs,all,any,basestring,bin,bool,bytearray,callable,chr,classmethod,cmp,compile,complex,delattr,dict,dir,divmod,enumerate,eval,execfile,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,property,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip,apply,buffer,coerce,intern},% + % + sensitive=true,% + morecomment=[l]\#,% + morestring=[b]',% + morestring=[b]",% + % + morestring=[s]{'''}{'''},% used for documentation text (mulitiline strings) + morestring=[s]{"""}{"""},% added by Philipp Matthias Hahn + % + morestring=[s]{r'}{'},% `raw' strings + morestring=[s]{r"}{"},% + morestring=[s]{r'''}{'''},% + morestring=[s]{r"""}{"""},% + morestring=[s]{u'}{'},% unicode strings + morestring=[s]{u"}{"},% + morestring=[s]{u'''}{'''},% + morestring=[s]{u"""}{"""},% + % + % {replace}{replacement}{lenght of replace} + % *{-}{-}{1} will not replace in comments and so on + literate= + {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 + {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 + {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 + {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 + {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 + {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 + {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 + {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1 + {€}{{\EUR}}1 {£}{{\pounds}}1 + % + {^}{{{\color{ipython_purple}\^{}}}}1 + {=}{{{\color{ipython_purple}=}}}1 + % + {+}{{{\color{ipython_purple}+}}}1 + {*}{{{\color{ipython_purple}$^\ast$}}}1 + {/}{{{\color{ipython_purple}/}}}1 + % + {+=}{{{+=}}}1 + {-=}{{{-=}}}1 + {*=}{{{$^\ast$=}}}1 + {/=}{{{/=}}}1, + literate= + *{-}{{{\color{ipython_purple}-}}}1 + {?}{{{\color{ipython_purple}?}}}1, + % + identifierstyle=\color{black}\ttfamily, + commentstyle=\color{ipython_cyan}\ttfamily, + stringstyle=\color{ipython_red}\ttfamily, + keepspaces=true, + showspaces=false, + showstringspaces=false, + % + rulecolor=\color{ipython_frame}, + frame=single, + frameround={t}{t}{t}{t}, + framexleftmargin=6mm, + numbers=left, + numberstyle=\tiny\color{halfgray}, + % + % + backgroundcolor=\color{ipython_bg}, + % extendedchars=true, + basicstyle=\scriptsize, + keywordstyle=\color{ipython_green}\ttfamily, +} \ No newline at end of file diff --git a/literatur.bib b/literatur.bib new file mode 100644 index 0000000..255b877 --- /dev/null +++ b/literatur.bib @@ -0,0 +1,18 @@ +@book{knuth, + author = {Knuth, Donald E.}, + title = {The Art of Computer Programming}, + subtitle = {Fundamental Algorithms}, + volume = {1}, + publisher = {Addison-Wesley}, + location = {Reading, Massachusetts}, + edition = {3}, + year = {1997} +} + +@online{scheme, + author = {Shinn, Alex and Cowan, John and Gleckler, Arthur A.}, + title = {Scheme Reports Process}, + year = {2013}, + urldate = {2020-07-13}, + url = {http://www.scheme-reports.org/} +} diff --git a/mainmatter.tex b/mainmatter.tex new file mode 100644 index 0000000..7da0acb --- /dev/null +++ b/mainmatter.tex @@ -0,0 +1,7 @@ +\chapter{Überschrift Ebene eins} + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + +Eine Abbildungen: + +\input{Example}