Skip to content

Commit

Permalink
add sourcecode section
Browse files Browse the repository at this point in the history
  • Loading branch information
GeneralMine committed Jun 13, 2021
1 parent 0a80549 commit c76c30e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
Binary file modified LaTeX-Kurs.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions LaTeX-Kurs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

\input{inhalte/fliesumgebungenUndVerweise.tex}

\input{inhalte/sourcecode.tex}

\input{inhalte/projektStrukturen.tex}

\input{inhalte/literatur.tex}
Expand Down
21 changes: 21 additions & 0 deletions header.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,28 @@

\usepackage{hyperref} % Verlinkt das Inhaltsverzeichnis und erlaubt \url

\usepackage{listings}
\usepackage{color}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}

\lstset{ %
backgroundcolor=\color{white}, % choose the background color
basicstyle=\footnotesize, % size of fonts used for the code
breaklines=true, % automatic line breaking only at whitespace
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{mygreen}, % comment style
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
keywordstyle=\color{blue}, % keyword style
stringstyle=\color{mymauve}, % string literal style
}


% \usepackage[outputdir=build]{minted}

% \titlehead{}
% \subject{}
\title{\LaTeX Kurs}
\subtitle{Eine Zusammenfassung}
\author{\textit{Marvin Raiser}}
Expand Down
46 changes: 46 additions & 0 deletions inhalte/sourcecode.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
\section{Sourcecode}

\subsection{lstlisting}

\subsubsection{Java}
\begin{lstlisting}[language=java]
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
for (int i = 0; i < 100; ++i) {
System.out.println(i);
}
}
}
\end{lstlisting}


\subsubsection{Python} %from http://wiki.scipy.org/Numpy_Example_List
\begin{lstlisting}[language=python]
>>> from numpy import *
>>> from numpy.fft import *
>>> signal = array([-2., 8., -6., 4., 1., 0., 3., 5.])
>>> fourier = fft(signal)
>>> N = len(signal)
>>> timestep = 0.1 # if unit=day -> freq unit=cycles/day
>>> freq = fftfreq(N, d=timestep) # freqs corresponding to 'fourier'
>>> freq
array([ 0. , 1.25, 2.5 , 3.75, -5. , -3.75, -2.5 , -1.25])
>>> fftshift(freq) # freqs in ascending order
array([-5. , -3.75, -2.5 , -1.25, 0. , 1.25, 2.5 , 3.75])
\end{lstlisting}


\subsubsection{HTML}
\begin{lstlisting}[language=html]
<html>
<head>
<title>Hello</title>
</head>
<body>Hello</body>
</html>
\end{lstlisting}

\subsection{minted}

\newpage

0 comments on commit c76c30e

Please sign in to comment.