From 5d5dbf6c735dbf4258541e1b533422163acfd3bd Mon Sep 17 00:00:00 2001 From: Florian Hoss Date: Tue, 27 Sep 2022 12:11:39 +0200 Subject: [PATCH] More stuff --- example/example.tex | 11 +++--- main.tex | 81 +++++++++++++++++++++++++++++---------------- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/example/example.tex b/example/example.tex index 48f8fcc..a072bce 100644 --- a/example/example.tex +++ b/example/example.tex @@ -49,10 +49,13 @@ Vielleicht reicht auch Google\wwwlink{google.de}... \section{Lstlisting} -\begin{lstlisting}[language=Bash] -#!/bin/bash - -echo "Hello World" +\begin{lstlisting} [caption=Zugriff auf Klassen über eine Nachschlagetabelle, label=code:lookup-table] + const bgColor = { + blue: "bg-blue-600", + red: "bg-red-600", + green: "bg-green-600", + }; + bgColor[props.color] \end{lstlisting} \section{Verbatim} diff --git a/main.tex b/main.tex index 5a6edbf..f442d32 100644 --- a/main.tex +++ b/main.tex @@ -34,8 +34,26 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Listings Paket %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{listings,caption} +\usepackage{listings,caption,pmboxdraw} \definecolor{codebg}{rgb}{0.95,0.95,0.95} +\definecolor{lightgray}{rgb}{.9,.9,.9} +\definecolor{darkgray}{rgb}{.4,.4,.4} +\definecolor{purple}{rgb}{0.65, 0.12, 0.82} + +\lstdefinelanguage{JavaScript}{ + keywords={break, case, catch, continue, debugger, default, delete, do, else, false, finally, for, function, if, in, instanceof, new, null, return, switch, this, throw, true, try, typeof, var, void, while, with, const}, + morecomment=[l]{//}, + morecomment=[s]{/*}{*/}, + morestring=[b]', + morestring=[b]", + ndkeywords={class, export, boolean, throw, implements, import, this}, + keywordstyle=\color{blue}\bfseries, + ndkeywordstyle=\color{darkgray}\bfseries, + identifierstyle=\color{black}, + commentstyle=\color{purple}\ttfamily, + stringstyle=\color{red}\ttfamily, + sensitive=true, +} \lstset{ basicstyle =\ttfamily\color{black}\small, keywordstyle =, @@ -47,11 +65,11 @@ breakatwhitespace, backgroundcolor={\color{codebg}}, basewidth=0.5em, + numbers=left, + numberstyle=\tiny, + numbersep=-8pt, + language=JavaScript, } -\lstloadlanguages{ - bash, -} -\usepackage{pmboxdraw} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Bibliography @@ -62,27 +80,15 @@ backend=biber, urldate=long, style=iso-authoryear, - natbib=true, useauthor=true, mincitenames=1, - maxcitenames=3 + maxcitenames=3, + maxbibnames=99, ]{biblatex} \addbibresource{./bib/online.bib} \addbibresource{./bib/book.bib} - \DeclareNameAlias{default}{family-given/given-family} -\renewcommand*{\finalnamedelim}{\addspace{}und\space} -\AtEveryCite{ - \renewcommand*{\multinamedelim}{,\space} - \renewcommand*{\nameyeardelim}{\space} -} - -\AtBeginBibliography{ - \renewcommand*{\multinamedelim}{,\space} -} -\AfterTOCHead[lof]{\appto\autodot{:}} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Fussnoten %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -133,27 +139,44 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Acronyms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{acro} +% https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/acro/acro-manual.pdf +\usepackage{acro,supertabular,array} + +\acsetup{ + make-links=true, + list/template=supertabular, + list/heading=chapter*, + list/sort=true, + list/display=used, + list/name=Abkürzungsverzeichnis, +} \DeclareAcronym{html}{short=HTML,long=HyperText Markup Language} \DeclareAcronym{js}{short=JS,long=JavaScript} +\usepackage{todonotes} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Dokument %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} - \include{titlepage/titlepage} - \include{vorspiel/vorspiel} + \include{titlepage/titlepage} + \include{vorspiel/vorspiel} - \tableofcontents - \newpage - \listoffigures - \printacronyms - \addcontentsline{toc}{chapter}{Abkürzungen} + \tableofcontents + \newpage + \listoffigures + \renewcommand\lstlistingname{Codefragment} + \renewcommand\lstlistlistingname{Codeverzeichnis} + \lstlistoflistings + \printacronyms[heading=addchap] - \include{example/example} - \printbibliography[title=Literaturverzeichnis] + \include{example/example} + + \printbibheading[title=Literaturverzeichnis] + \printbibliography[type=book,heading=subbibliography,title=Buch-Quellen] + \printbibliography[type=online,heading=subbibliography,title=Online-Quellen] \end{document} \ No newline at end of file