TUD_MATH_BA/Material/Quelltext.tex

36 lines
1,023 B
TeX
Raw Permalink Normal View History

2018-08-11 11:46:12 +02:00
\documentclass{article}
\usepackage{xcolor}
\usepackage{lmodern}
2018-08-11 11:46:12 +02:00
\usepackage{listings}
\definecolor{lightlightgray}{rgb}{0.95,0.95,0.95}
\definecolor{lila}{rgb}{0.8,0,0.8}
2018-08-11 11:46:12 +02:00
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mygreen}{rgb}{0,0.8,0.26}
2018-08-11 11:46:12 +02:00
\lstset{language=[95]Fortran,
basicstyle=\ttfamily,
keywordstyle=\color{lila},
commentstyle=\color{lightgray},
2018-08-11 11:46:12 +02:00
morecomment=[l]{!\ },% Comment only with space after !
stringstyle=\color{mygreen}\ttfamily,
backgroundcolor=\color{white},
showstringspaces=false,
numbers=left,
numbersep=10pt,
numberstyle=\color{mygray}\ttfamily,
identifierstyle=\color{blue}
2018-08-11 11:46:12 +02:00
}
\begin{document}
\begin{lstlisting}
! Der folgende Fortran-Code ist bei Wikipedia geklaut.
SUBROUTINE test( Argument1, Argument2, Argument3 )
REAL, INTENT(IN) :: Argument1
CHARACTER(LEN= *), INTENT(IN) :: Argument2
INTEGER, INTENT(IN), OPTIONAL :: Argument3
! This makes sense
write(*,*) "Hallo Welt!"
END SUBROUTINE test
\end{lstlisting}
\end{document}