\documentclass[a4paper, 12pt]{article} \usepackage[utf8]{inputenc} % this is needed for umlauts \usepackage[ngerman]{babel} % this is needed for umlauts \usepackage[T1]{fontenc} % needed for right umlaut output in pdf \usepackage[ngerman, num]{isodate} % get DD.MM.YYYY dates \usepackage[locale=DE,group-minimum-digits={3}]{siunitx} \usepackage{parskip} \usepackage{fancyhdr} \usepackage[rmargin=2.4cm]{geometry} \usepackage{csvsimple} \usepackage{pgfplots} \usepackage{myInformation} \fancypagestyle{appendix}{% \fancyhead{} \renewcommand{\headrulewidth}{0pt} } \setlength{\headheight}{15pt} % fixes \headheight warning \lhead{\Vorname{}~\Nachname{}, \Strasse{}, \PLZ{}~\Ort} \rhead{Id-Nr. \Idnr} % Begin document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \pagestyle{fancy} \section*{Überschussrechnung \Year} \subsection*{Einnahmen} \csvreader[before reading=\def\einnahmen{0},separator=semicolon]{2013-einnahmen-selbststaendig.csv}{Betrag=\Betrag}{% \pgfmathsetmacro{\einnahmen}{\einnahmen+\Betrag}% } \begin{tabular}{|p{2.5cm}|p{2.5cm}|p{7cm}|p{2cm}|}\hline% \textbf{Rechnungs-\newline{}nummer} & \textbf{Rechnungs-\newline{datum}} & \textbf{Text} & \textbf{Betrag\newline{}in EUR} \csvreader[head to column names,separator=semicolon]{2013-einnahmen-selbststaendig.csv}{}% {\\\hline\Rechnungsnummer & \Rechnungsdatum & \Text &\hfill\num[round-mode=places,round-precision=2]{\Betrag}}% \\\hline\hline \multicolumn{3}{|l|}{Summe} & \hfill\num[round-mode=places,round-precision=2]{\einnahmen} \\\hline \end{tabular} \subsection*{Ausgaben} \csvreader[before reading=\def\ausgaben{0},separator=semicolon]{2013-ausgaben.csv}{Betrag=\Betrag}{% \pgfmathsetmacro{\ausgaben}{\ausgaben+\Betrag}% } \begin{tabular}{|p{2cm}|p{10.4cm}|p{2cm}|}\hline% \textbf{Datum} & \textbf{Text} & \textbf{Betrag} \csvreader[head to column names,separator=semicolon]{2013-ausgaben.csv}{}% {\\\hline\Datum & \Text &\hfill\num[round-mode=places,round-precision=2]{\Betrag}}% \\\hline\hline \multicolumn{2}{|l|}{Summe} & \hfill\num[round-mode=places,round-precision=2]{\ausgaben} \\\hline \end{tabular} \vfill\pgfmathsetmacro{\gewinn}{\einnahmen-\ausgaben} \textbf{Gewinn / Verlust:}\hfill\num[round-mode=places,round-precision=2]{\gewinn} \clearpage \subsection*{Sonstige Einnahmen aus selbstständiger Tätigkeit} \csvreader[before reading=\def\selbststaendig{0},separator=semicolon]{2013-einnahmen-sonstiges.csv}{Betrag=\Betrag}{% \pgfmathsetmacro{\selbststaendig}{\selbststaendig+\Betrag}% } \begin{tabular}{|p{2cm}|p{10.4cm}|p{2cm}|}\hline% \textbf{Datum} & \textbf{Text} & \textbf{Betrag} \csvreader[head to column names,separator=semicolon]{2013-einnahmen-sonstiges.csv}{}% {\\\hline\Datum & \Text &\hfill\num[round-mode=places,round-precision=2]{\Betrag}}% \\\hline\hline \multicolumn{2}{|l|}{Summe} & \hfill\num[round-mode=places,round-precision=2]{\selbststaendig} \\\hline \end{tabular} \subsection*{Einnahmen aus Kapitalerträgen} \csvreader[before reading=\def\kapitalsum{0},separator=semicolon]{2013-kapitalertraege.csv}{Betrag=\Betrag}{% \pgfmathsetmacro{\kapitalsum}{\kapitalsum+\Betrag}% } \begin{tabular}{|p{2cm}|p{10.4cm}|p{2cm}|}\hline% \textbf{Datum} & \textbf{Text} & \textbf{Betrag} \csvreader[head to column names,separator=semicolon]{2013-kapitalertraege.csv}{}% {\\\hline\Datum & \Text &\hfill\num[round-mode=places,round-precision=2]{\Betrag}}% \\\hline\hline \multicolumn{2}{|l|}{Summe} & \hfill\num[round-mode=places,round-precision=2]{\kapitalsum} \\\hline \end{tabular} \subsection*{Einnahmen aus nicht-selbstständiger Tätigkeit} \csvreader[before reading=\def\nichstselbststaendig{0},separator=semicolon]{2013-nicht-selbststaendig.csv}{Betrag=\Betrag}{% \pgfmathsetmacro{\nichstselbststaendig}{\nichstselbststaendig+\Betrag}% } \begin{tabular}{|p{2cm}|p{10.4cm}|p{2cm}|}\hline% \textbf{Datum} & \textbf{Text} & \textbf{Betrag} \csvreader[head to column names,separator=semicolon]{2013-nicht-selbststaendig.csv}{}% {\\\hline\Datum & \Text &\hfill\num[round-mode=places,round-precision=2]{\Betrag}}% \\\hline\hline \multicolumn{2}{|l|}{Summe} & \hfill\num[round-mode=places,round-precision=2]{\nichstselbststaendig} \\\hline \end{tabular} \end{document}