summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/bankstatement/bankstatement.tex
blob: 0ad53c2ad9033b0b422e33f94c175b5f8c5e1a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
\documentclass[a4paper]{ltxdoc}%
\usepackage[english]{babel}%
\usepackage[latin1]{inputenc}%
\usepackage[T1]{fontenc}%
\usepackage{textcomp}%
\usepackage{lmodern}%
\usepackage{bera}%
\usepackage{microtype}%
\usepackage{ltxdocext}%
\usepackage{marginnote}%
\usepackage[svgnames,rgb]{xcolor}%
\usepackage{amsmath,array}%
\usepackage{tikz}%
\usepackage{listings}%
\usepackage{filecontents}%
\usetikzlibrary{calc}%
\usepackage{ragged2e}%
\usepackage{url}%
\usepackage[automark,nouppercase]{scrpage2}
\usepackage{hyperref}
%
\begin{filecontents}{bankstatement.bib}
@misc{bib:datatool,
 author               = {Talbot, {Nicola L.C.}},
 note                 = {\href{http://mirrors.ctan.org/macros/latex/contrib/datatool/datatool-user.pdf}{http://mirrors.ctan.org/macros/latex/contrib/datatool/datatool-user.pdf}},
 title                = {{User Manual for datatool bundle version 2.22}},
 year                 = {2014},
 }
 
@misc{bib:sepa,
 author               = {{wikipedia.org}},
 note                 = {\href{https://en.wikipedia.org/wiki/Single_Euro_Payments_Area}{https://en.wikipedia.org/wiki/Single\_Euro\_Payments\_Area}},
 title                = {{Single Euro Payments Area}},
 year                 = {2014},
 }
 
@misc{bib:bic,
 author               = {{wikipedia.org}},
 note                 = {\href{https://en.wikipedia.org/wiki/ISO_9362}{https://en.wikipedia.org/wiki/ISO\_9362}},
 title                = {{ISO 9362}},
 year                 = {2014},
 }
 
@misc{bib:iban,
 author               = {{wikipedia.org}},
 note                 = {\href{https://en.wikipedia.org/wiki/International_Bank_Account_Number}{https://en.wikipedia.org/wiki/International\_Bank\_Account\_Number}},
 title                = {{International Bank Account Number}},
 year                 = {2014},
 }

\end{filecontents}
\makeatletter
\setlength{\headheight}{1.1\baselineskip}%
%
\hypersetup{colorlinks=true,urlcolor=NavyBlue,linkcolor=NavyBlue,citecolor=CornflowerBlue,naturalnames=true,hypertexnames=false}%
\renewcommand{\maketitle}%
{%
  \thispagestyle{empty}%
  \pagecolor{Ivory}%
  \begin{titlepage}%
    \begin{tikzpicture}[remember picture,overlay]%
      \node[yshift=-2cm] at (current page.north west)%
      {%
        \begin{tikzpicture}[remember picture, overlay]%
          \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle%
            (\paperwidth,2cm);%
          \draw[anchor=west,yshift=-4cm,xshift=3cm,color=NavyBlue] (0,0) node%
            {\parbox{15cm}{\RaggedRight\Huge\sffamily\textbf{\@title}}};%
          \draw[anchor=west,yshift=-6cm,xshift=3cm,color=NavyBlue] (0,0) node%
            {\parbox{15cm}{\huge\sffamily\textbf{\@fileversion}}};%
          \draw[anchor=west,yshift=-9cm,xshift=3cm,color=NavyBlue] (0,0) node%
            {\parbox{15cm}{\RaggedRight\huge\sffamily\textbf{\@subtitle}}};%
          \draw[anchor=west,yshift=-14cm,xshift=3cm,color=NavyBlue] (0,0) node%
            {\parbox{15cm}{\huge\sffamily\textbf{\@date}}};%
          \draw[anchor=west,yshift=-20cm,xshift=3cm,color=NavyBlue] (0,0) node%
            {\parbox{15cm}{\Large\sffamily{\@authorline\\\textbf{\@author}}}};%
        \end{tikzpicture}%
      };%
      \node[yshift=0cm] at (current page.south west)%
      {%
        \begin{tikzpicture}[remember picture, overlay]%
          \draw[fill=NavyBlue,color=NavyBlue,yshift=6cm,xshift=2cm] (0,0) rectangle (0.2cm,19cm);%
          \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);%
          \draw[anchor=west,yshift=1cm,xshift=3cm,color=NavyBlue] (0,0) node%
            {\parbox{15cm}{\large\sffamily{\@refline}}};%
        \end{tikzpicture}%
      };%
    \end{tikzpicture}%
  \end{titlepage}%
  \pagecolor{white}%
}%
%
\newcommand*{\@tikzhead}[1]%
{%
  \begin{tikzpicture}[remember picture,overlay]%
    \node[yshift=-2cm] at (current page.north west)%
    {%
      \begin{tikzpicture}[remember picture, overlay]%
        \draw[fill=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);%
        \draw[anchor=west,yshift=1cm,xshift=1.5cm,color=NavyBlue] (0,0) node%
          {\parbox{15cm}{\LARGE\sffamily\textbf{\@title}}};%
        \node[anchor=east,xshift=.9\paperwidth,rectangle,%
              rounded corners=15pt,inner sep=11pt,fill=NavyBlue]%
              {\color{white}\textsc{#1}};%
      \end{tikzpicture}%
    };%
  \end{tikzpicture}%
}%
\clearscrheadings%
\ihead{\@tikzhead{\headmark}}%
\cfoot{\upshape\thepage}%
\pagestyle{scrheadings}%
%
%\newcommand*{\headline}[1]{\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}%
\newcommand*{\Headline}[1]{\@mkboth{#1}{#1}}%
%
\renewcommand{\headfont}{\normalfont\mdseries\scshape}
%
\gdef\@subtitle{}%
\providecommand*{\Subtitle}[1]{\gdef\@subtitle{#1}}%
\gdef\@fileversion{}%
\providecommand*{\Fileversion}[1]{\gdef\@fileversion{#1}}%
\gdef\@author{}%
\providecommand*{\Author}[1]{\gdef\@author{#1}}%
\gdef\@authorline{Package author:}%
\providecommand*{\Authorline}[1]{\gdef\@authorline{#1}}%
\gdef\@refline{}%
\providecommand*{\Refline}[1]{\gdef\@refline{#1}}%
\gdef\and{\unskip{}, }%
\newcommand\doubledash{-\kern0.5pt-}
\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1em\leavevmode\llap{\makeenmark}}
\makeatother
%
\def\filename{bankstatement.cls}%
\def\XeLaTeX{Xe\LaTeX}%
%
\makeatletter%
\renewcommand\tableofcontents%
{%
  %\section*{\contentsname}%
  \@mkboth{%
  \MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
  \@starttoc{toc}%
}%
%
\newcommand\styleoption{\name@idx{style option}}%
\newcommand\stylename{\name@idx{document style}}%
\def\name@idx#1#2{%
 {\ttfamily#2}%
 \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}%
}%
\newcommand*\margcs[1]{\marginnote{\raggedleft\scriptsize #1}}%
\newcommand*\package[1]{\texttt{#1}\index{#1=\string\ttt{#1}}}%
\newcommand*\mco[1]{\mbox{\LANGLE\itshape#1\RANGLE}\index{#1, class option value}\index{class option value>#1}}%
%
\renewcommand\@biblabel[1]{\makebox[1.5cm][l]{[#1]}}
\renewcommand*\l@subsection{\@dottedtocline{2}{1.2em}{2.3em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{2.4em}{3.7em}}
\makeatother
%
\setlength\parindent{0pt}%
\hypersetup{pdfauthor={Josef Kleber},pdftitle={A LaTeX class for bank statements based on csv data},pdfsubject={Documentation for LaTeX class \filename}}%
\lstset{language=[LaTeX]TeX,numbers=left,numberstyle=\tiny, basicstyle=\ttfamily, aboveskip=\baselineskip, frame=single, backgroundcolor=\color{LightGoldenrodYellow}, keywordstyle=\color{Blue},
emph={bankstatement},emphstyle=\color{Tomato}, 
emph={[2]logo,bic,iban,holder,title,language,10pt,a4paper,format,logowidth,negativecolor,openingbalance,closingbalance},emphstyle={[2]\color{OliveDrab}},
morekeywords={bankstatement}}
\begin{document}
\bibliographystyle{alphadin}
\title{\filename}%
\Subtitle{A \LaTeX{} class for bank statements based on csv data}%
\author{Josef Kleber}
\Fileversion{v0.9.1}
\Refline{\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}\\\href{https://bitbucket.org/kleberj/bankstatement/}{\texttt{https://bitbucket.org/kleberj/bankstatement/}}}
\date{07.01.2015}
\maketitle
\Headline{Abstract}
\begin{abstract}
More and more banks allow their customers to download posting records in various formats.
By using the \texttt{bankstatement} class, you can create bank statements -- as long as a csv format is available!
At the moment, the \texttt{csv-mt940} \texttt{and csv-camt} formats -- used by many german Sparkassen -- are supported.
You can quite easily add support for other csv formats.
Simply define the order of the keys in the csv data file and how to use them.

The terminology in this class like BIC (Business Identifier Codes) or IBAN (International Bank Account Number) is based on SEPA (Single Euro Payments Area).
But you can adjust the terminology to suit your needs.
\end{abstract}
\clearpage
\tableofcontents
\clearpage
\section{Class options}

\begin{description}
\item[format (\texttt{csv-mt940})] specifies the csv format of your data files
\item[language (\texttt{english})] specifies the language of your document
\item[left (\texttt{2cm})] specifies the left margin
\item[right (\texttt{2cm})] specifies the right margin
\item[top (\texttt{2cm})] specifies the top margin
\item[bottom (\texttt{2cm})] specifies the bottom margin
\end{description}

\section{The \texttt{bankstatement} command}
The \cmd\bankstatement{}\marginnote{\cmd\bankstatement\\\oarg{options}\{\marg{csv file}\}} command reads in \marg{csv file} and outputs your bank statement.
It supports the following options, which can also be used as class options with global scope:

\begin{description}
\item[title (\texttt{})] specifies the title of your bank statement
\item[logo (\texttt{})] specifies the logo used in the bank statement. It may be the logo of your bank or the sports club, whose treasurer you are.
\item[logowidth (\texttt{4cm})] defines the width of the logo
\item[holder (\texttt{})] specifies the account holder
\item[bic (\texttt{})] specisfies the BIC (Business Identifier Codes)
\item[iban (\texttt{})] specifies the IBAN (International Bank Account Number) 
\item[referencewidth (\texttt{11cm})] specifies the width of the second table column used for the reference. Depending on page size, margins and font you may need to adjust the width.
\item[negativecolor (\texttt{red})] specifies the color used for negative amounts
\item[sort (\texttt{PostingDate})] defines the sort key of the csv data base
\item[openingbalance (\texttt{none})] specifies the opening balance. csv posting records do not contain an opening balance, only postings.
\item[closingbalance (\texttt{none})] specifies the closing balance 
\end{description}

Make sure to use the same encoding in your document than in the csv file(s)!

\section{Customization}

You can quite easily add support for other languages and formats. Please send a copy to the maintainer of \texttt{bankstatement}.

\subsection{Languages}

Supported languages:

\begin{itemize}
\item \texttt{\bfseries english}
\item \texttt{german}
\end{itemize}

To support other languages, simply copy \texttt{stmenglish.def} to your local \TeX{} tree, rename it and translate the definitions to your language!

\subsection{Formats}

Supported formats:

\begin{itemize}
\item \texttt{\bfseries csv-mt940}
\item \texttt{csv-camt}
\end{itemize}

To support other formats, simply copy \texttt{csv-mt940.def} to your local \TeX{} tree, rename it and adjust the definitions to your needs!
That is, define the order of keys in your format and specify how to use them. Furthermore, you should specify the separator of the csv file and whether the csv file has a header row or not.

\section{Example}

\begin{lstlisting}
\documentclass[a4paper,10pt,bic=BYLADEM1ERD,
               iban=DE70753574230240408336,
               holder={Josef Kleber},
               language=german,logo=stmlogo,
               format=csv-camt,
               logowidth=4cm,negativecolor=red]
              {bankstatement}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{bera}
\renewcommand\familydefault{\sfdefault}
\begin{document}
\bankstatement[title={Kontoauszug 12/2014},
               openingbalance={-12,34},
               closingbalance={82,13}]{201412.csv}
\end{document}
\end{lstlisting}

{
\clearpage
\raggedright
\nocite{*}
\bibliography{bankstatement}
\addcontentsline{toc}{section}{\refname}
}

\end{document}