diff --git a/chap/README.md b/chap/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1cf1ae9597e49a3f88709ee14efbbb8552128f3f --- /dev/null +++ b/chap/README.md @@ -0,0 +1,4 @@ +# Chapters folder + +For bigger projects it can be usefull to have separate files for chapters. +These separate files should be stored here and can be included into the main document via `\input{chap/one.tex}`. \ No newline at end of file diff --git a/csv/bsp.csv b/csv/bsp.csv new file mode 100644 index 0000000000000000000000000000000000000000..a6a28d55b1aabbd5c4a16f55e6581c3eb68f15b1 --- /dev/null +++ b/csv/bsp.csv @@ -0,0 +1,6 @@ +A;B;C;D +1;0;3,1;0,2 +2;0;7,2;0,5 +3;0;8,3;0,3 +4;0;2,4;0,1 +5;0;4,5;0,2 diff --git a/plt/examplePlot.tex b/plt/examplePlot.tex new file mode 100644 index 0000000000000000000000000000000000000000..0b3b8420c3433457e946335fe632775d8bf72849 --- /dev/null +++ b/plt/examplePlot.tex @@ -0,0 +1,33 @@ +\documentclass[11pt,ngerman]{HsH-standalone} + +%__________Formeln und Mathe________________ +\usepackage{siunitx} % kennt SI einheiten +\usepackage{amsmath} % schöne Formeln + +%__________Daten Import_____________________ +\usepackage{pgfplots,pgfplotstable} % plots und bilder, enthält tikz und graphix +\usepackage{circuitikz} % zeichnen von Schaltplänen + +\begin{document} %----------------------Inhalt---------------------------------------------------% + +\begin{tikzpicture} + \begin{axis}[MyPlots] + \addplot[FM1,domain=-1:1]{x^2}; + \end{axis} +\end{tikzpicture} + +\begin{tikzpicture} +\pgfplotstableread{../csv/bsp.csv}\data + \begin{axis}[MyPlots, + xlabel=X Achse, ylabel=$\percent$, + ] + \addplot[FM1,errBars] table [x=A,y=C,y error=D] {\data}; + \addlegendentry{Messdaten} + \addplot[FM2,smooth] table [x=A,y=C] {\data}; + \addlegendentry{theroretische Werte} + \addplot[FM4] table [x=A,y={create col/linear regression={y=C}}] {\data}; + \addlegendentry{lineariesiert zu: $y=\num\pgfplotstableregressiona*x+\num\pgfplotstableregressionb$} + \end{axis} +\end{tikzpicture} + +\end{document} diff --git a/src/HsH-standalone.cls b/src/HsH-standalone.cls new file mode 100644 index 0000000000000000000000000000000000000000..985d40d836982ae8e0e0cf0a03e72704d6ff5b1a --- /dev/null +++ b/src/HsH-standalone.cls @@ -0,0 +1,88 @@ +\typeout{Adapted from KOMA script for use in Hochschule Hannover <2020-08-21> Jan Wille} +\NeedsTeXFormat{LaTeX2e} + +\newcommand{\myClassName}{HsH-standalone} +\ProvidesClass{\myClassName}[2020/09/21 HsH Report based on KOMA] +\LoadClass[multi=tikzpicture,multi=circuitikz]{standalone} + +\newcommand{\HsHlogoPath}{HSH-Logo.pdf} +\newcommand{\HsHlogoPage}{1} +\newcommand{\includeHsHlogohere}{\includegraphics[width=5cm,page=\HsHlogoPage]{\HsHlogoPath}} +\providecommand{\abs}[1]{\ensuremath{\left\vert#1\right\vert}} % Makro für Betragsstriche + + +\newif\if@german% +\DeclareOption{ngerman}{% + \PassOptionsToPackage{\CurrentOption}{babel} + \@germantrue +} +\DeclareOption{english}{% + \PassOptionsToPackage{\CurrentOption}{babel} +} +\DeclareOption{f1}{% + \renewcommand{\HsHlogoPage}{2} +} +\DeclareOption{f2}{% + \renewcommand{\HsHlogoPage}{3} +} +\DeclareOption{f3}{% + \renewcommand{\HsHlogoPage}{4} +} +\DeclareOption{f4}{% + \renewcommand{\HsHlogoPage}{5} +} +\DeclareOption{f5}{% + \renewcommand{\HsHlogoPage}{6} +} +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{standalone}} +\ProcessOptions\relax + +\newcommand*{\@titlehead}{}% +\newcommand{\titlehead}[1]{\gdef\@titlehead{#1}}% +\newcommand*{\@subject}{}% +\newcommand*{\subject}[1]{\gdef\@subject{#1}}% +\newcommand*{\@subtitle}{}% +\newcommand*{\subtitle}[1]{\gdef\@subtitle{#1}}% +\newcommand*{\@publishers}{}% +\newcommand{\publishers}[1]{\gdef\@publishers{#1}}% +\InputIfFileExists{personal.tex}{ + \ClassInfo{\myClassName}{personal.tex was found. Using it...} +}{ + \ClassInfo{\myClassName}{no personal.tex! Configre the titlepage yourselfe} +} + +% enforced options for packages +\PassOptionsToPackage{utf8}{inputenc} +\PassOptionsToPackage{T1}{fontenc} +\PassOptionsToPackage{babel, german=quotes}{csquotes} +\PassOptionsToPackage{free-standing-units}{siunitx} +\PassOptionsToPackage{european,EFvoltages,straightvoltages}{circuitikz} + +%used packages: +\RequirePackage{inputenc} % inputencoding, utf8 recomendet +\RequirePackage{fontenc} % outputencoding, T1 recomendet +\RequirePackage{lmodern} % font +\RequirePackage{graphicx} % required for importing images +\RequirePackage{babel} % required for german names +\if@german\RequirePackage{ziffer}\fi % german dezimal numbers + +% typesetting indexes upright or standart +\def\subinrm#1{\sb{\textnormal{#1}}} +{\catcode`\_=13 \global\let_=\subinrm} +\mathcode`_="8000 +\newcommand\upsubscripts{\catcode`\_=12 } % the toggle for upright subscripts +\newcommand\normalsubscripts{\catcode`\_=8 } % the toggle for italic subscripts +\upsubscripts % setting upright as default + +% keep compatible +\providecommand{\renewcaptionname}[3]{} + +\AtBeginDocument { + \makeatletter + \InputIfFileExists{config.tex}{ + \ClassInfo{\myClassName}{config.tex was found. Using it...} + }{ + \ClassInfo{\myClassName}{no config.tex!! I hope you configered it yourself.} + } + \makeatother +} diff --git a/src/config.tex b/src/config.tex index 2a1a63b8f057c58cefa51556678f7b657919f0b2..50ffab0ee6225f5d6063ebdaf99d57b78e0e9403 100644 --- a/src/config.tex +++ b/src/config.tex @@ -10,11 +10,13 @@ \MakeOuterQuote{"} }{}% \@ifpackageloaded{siunitx}{ + \if@german + \sisetup{output-decimal-marker={,}} + \fi \sisetup{ free-standing-units, tight-spacing=true, per-mode=symbol, - output-decimal-marker={,}, scientific-notation=engineering, round-mode = places, round-precision = 3, @@ -41,11 +43,12 @@ } }{}% \@ifpackageloaded{pgfplots}{ - \usepackage{pgfplotstable} \usepgfplotslibrary{fillbetween} % mark areas under or between graphs + \if@german + \pgfplotsset{/pgf/number format/use comma} + \fi \pgfplotsset{ compat=1.16, - /pgf/number format/use comma, /pgf/number format/read comma as period, every tick label/.append style={font=\tiny}, every axis legend/.append style={font=\footnotesize}, @@ -63,6 +66,8 @@ error mark options={mark size=1pt,rotate=90}}, } } +}{}% +\@ifpackageloaded{pgfplotstable}{ \pgfplotstableset{ col sep=semicolon, % global seperator for csv files } diff --git a/test.tex b/test.tex index ecf848ceeb9eb90d7dc86dede90688936739ec16..1936f75dd39294687c01904aea3282725b58fdd6 100644 --- a/test.tex +++ b/test.tex @@ -6,6 +6,7 @@ \usepackage{biblatex} \addbibresource{src/localBibliography.bib} +\usepackage{pgfplots,pgfplotstable} % plots und bilder, enthält tikz und graphix \begin{document} @@ -39,6 +40,12 @@ \vspace{2cm}\\\pagebreak eine zahl: $3,5+3.5$\\ + \begin{tikzpicture} + \begin{axis}[MyPlots] + \addplot[FM1,domain=-5:5]{x^2}; + \end{axis} + \end{tikzpicture} + \printbibliography \listoffigures \end{document}