Skip to content
Snippets Groups Projects
Commit eb1b1219 authored by Jan Wille's avatar Jan Wille
Browse files

fixed everything -_-

parent 85a04f01
Branches
No related tags found
No related merge requests found
......@@ -3,8 +3,7 @@ NAME = project
LATEX = pdflatex
BIBTEX = biber
SUBDIRS = img plt
# use . for no OUTDIR
SUBDIRS = svg plt crc
OUTDIR = build
TEX_FLAGS = -file-line-error -interaction=nonstopmode
COM_FLAGS = -output-directory=$(OUTDIR) -quiet
......
\documentclass[11pt,ngerman]{HsH-standalone}
\usepackage{siunitx} % kennt SI einheiten
\usepackage{amsmath} % schöne Formeln
\usepackage{circuitikz} % zeichnen von Schaltplänen
\begin{document} %----------------------Inhalt---------------------------------------------------%
\begin{circuitikz} \draw
(0,0) to[V, v<=$U_q$, i=$I_q$] ++(0,2)
-- ++(2,0)
to[R, i^=$I_R$] ++(0,-2)
to[rmeter, t=A] ++(-2,0)
;
\end{circuitikz}
\begin{circuitikz} \draw
(0,0) to[I, v^<=$U_q$, i=$I_q$] ++(0,2)
-- ++(2,0) coordinate(a)
to[R, *-*, v^=$U_R$] ++(0,-2) coordinate(b)
-- ++(-2,0)
(a) -- ++(1.5,0)
to[rmeterwa, t=V] ++(0,-2)
-- (b)
;
\end{circuitikz}
\begin{circuitikz} \draw
(0,-2) coordinate(home)
to[V, v<=$U_q$] ++(0,2)
;
\foreach \i in {0,...,3} \draw
(0,0) -- ++(1.5+\i,0)
to[R, *-*,l=$R_\i$] ++(0,-2)
-- (home)
;
\end{circuitikz}
\end{document}
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
img/lorem-ipsum.jpg

62.5 KiB

\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
\begin{document} %----------------------Inhalt---------------------------------------------------%
\begin{tikzpicture}
\begin{axis}[MyPlots]
\addplot[FM1,domain=-1:1, name path=A]{x^2};
\addplot[FM2,mark=none,domain=-1:1, name path=B]{0.5*x^2-1};
\addplot[pattern color=gray!40, pattern=dots] fill between[of=A and B];
\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}
File added
\documentclass[11pt,a4paper]{HsH-report}
% preamble
\documentclass[ %----------------------Preamble---------------------------------------------------%
11pt,a4paper, % fontsize and papersize
twoside, % double sided layout
english, % document language (also numberingsystem)
f1 % HsH facultie
]{HsH-report} % documentclass
\usepackage{color} % for coloring stuff
\usepackage{siunitx} % units
\usepackage{listings}
\usepackage{csvsimple}
\usepackage{biblatex} % bibiography
\addbibresource{src/localBibliography.bib}
\usepackage{lipsum} % dummy text
\begin{document}
% content goes here
\pagenumbering{Roman} % duífferent numbering until first chapter
\maketitle % using personal.tex
\declarationAuthorship
\begin{abstract}
\lipsum[5-8]
\end{abstract}
\tableofcontents
\cleardoublepage % importand when using double sided layout
\pagenumbering{arabic} % numbering in normal numbers
\chapter{Examples}
\label{chap: one}
{\color{red}red text} and {\color{blue}blue text} \\
different subscripts: \normalsubscripts$R_t$ \upsubscripts$R_t$ \\
using Units: $R=200\,\milli\ohm + \SI{0.34567453}{\volt\per\metre} - 5\,\si{\second\per\metre\squared}$ \\
some information\cite{laboranleitung:physik}\\
german number: $3,5$ english number: $3.5$\\ % note changes when using ngerman document option
\section{using images}
Images can just be imported and used in a float enviroment with a caption and a lable to reference it.
\begin{figure}
\includegraphics[width=.6\textwidth]{img/lorem-ipsum.jpg}
\caption{just a random image}
\end{figure}
Plots can be created direktly with latex. It is recomendet to do this in subfiles and just import the finished PDF pages. This speed us
compiletimes by a lot. You should not change the size of precompiled images to keep fontsizes consistent.
\pagebreak
\begin{figure}
\includegraphics[page=2]{plt/build/examplePlot.pdf}
\caption[centering]{a nice plot}
\label{fig: plot1}
\end{figure}
\begin{figure}
\includegraphics[page=1]{plt/build/examplePlot.pdf}
\caption{a area plot}
\label{fig: area}
\end{figure}
Circuit diagramms can also be created using a package called \lstinline{circuitikz}. It is also recomendet to get formiliar with Inkscape which
has a very good export to latex feature.
\begin{figure}
\graphicspath{{svg/build/}} % double curly brackets needet for unknown reason
\subfigure[a circuit diagramm]{\includegraphics{crc/build/exampleCircuit.pdf}}
\hspace{2cm}
\subfigure[made via Inkscape]{\input{svg/build/exampleSVG.pdf_tex}}
\caption{using two figures}
\end{figure}
\section{demo nested listing}
\begin{itemize}
\item hallo
\begin{itemize}
\item temp
\begin{itemize}
\item temp
\begin{itemize}
\item temp
\end{itemize}
\end{itemize}
\end{itemize}
\end{itemize}
\section{using Units}
For this the \lstinline{siunitx} package is used. It provides Macros for all units.
\begin{equation}
200\,\ohm
\end{equation}
The space betwen a number and it's unit shoud be a protected half-space, which can be created in latex using \lstinline{\,} In the classfile
siunits is set up to use a seperate macro for each subunit, even for size-modifiers:
\begin{equation}
200\,\milli\metre \cdot 2\,\mega\volt
\end{equation}
Siunits also allows for reformating of numbers as well as units. Use the \lstinline{\SI} and \lstinline{\si} macros for that:
\begin{equation}
e = \SI{1.602176634E-19}{\coulomb} % formats number + units, autospacing, transform to gernam comma
\end{equation}
\begin{equation}
124\,\si[per-mode=fraction]{\kilo\metre\per\second\squared} % only units
\end{equation}
\begin{equation}
\num{0.0004}\,\lumen % only numbers, \per and \squared do not work
\end{equation}
\section{Using formulas}
\label{sec: formula}
a numberd formula:
\begin{equation}
\label{eq: einhalb} % always lable your stuff
0,5=\frac{1}{3}
\end{equation}
\autoref{eq: einhalb} is nice, but how about multiple lines:
\begin{equation}
\begin{split} % you need do nest this
x &= x^2+3 \\
\Leftrightarrow 0 &= x^2-x+3 \\
\end{split}
\end{equation}
and how could you align formulas?
\begin{align}
x_1 &= 6 &&|\;\mbox{mit } x \in \mathbb{N} \\
x_2 &= 33+\abs{\frac{1}{4}} &&|\;x_1+3 \\
&= 33,25 &&\mbox{| don't number everything} \notag \\
x_3 &= 10^{22}
\end{align}
\section{formating code}
\label{sec: code}
use the listings package:
% how to skip fist tab??
\begin{lstlisting}[language=c]
#include <stdlib.h>
#include <sdtio.h>
int main(void) {
printf("Hello World");
return 0;
}
\end{lstlisting}
% or input from external file:
%\lstinputlisting[language=c]{main.c}
\section{CSV files}
\label{sec: messwerte}
import a csv as table:\\
\csvautotabular{csv/bsp.csv}\\
or do it manualy to get more controll:
\begin{table}
\caption{a nice list of numbers}
\begin{tabular}{c|c}
first row & second row \\\hline\hline
\csvreader[
late after line=\\\hline,
late after last line=\\\hline
]{csv/bsp.csv}{}{number: $\csvcoli\,\metre$ & is not \csvcoliii}
\end{tabular}
\end{table}
\clearpage
\KOMAoptions{paper=landscape,pagesize} % rotate page to landscape mode (because why not XD)
\recalctypearea
\chapter{attachment}
% manually include a PDF as not numbered section
\textbf{\Large{Messprotokoll oder so}} % just so it'S not empty
\phantomsection % Anker für den Hyperlink
\addcontentsline{toc}{section}{Messprotokoll} % add to table of content
\chaptermark{Messprotokoll} % change headmark
%\includepdf[pages=-,pagecommand={},width=\paperwidth]{temp.pdf} % comment in to include pdf
As you can see its also posible to have some pages sideways. Just keep in mind you might need to adapt the margins
\newpage
\KOMAoptions{paper=portrait,pagesize} % and back
\recalctypearea
\printbibliography
\noindent\begin{minipage}{\textwidth} % prevent automatic pagebreaks
\listoffigures
\listoftables
\end{minipage}
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment