Debian Codegraph @

texmf-dist/doc/latex/datatool/samples/sample-mail-merge.tex

raw
1 % This file is public domain.
2 \documentclass{letter}
3
4 \usepackage{datatool}
5
6 \DTLloaddb{data}{sample-student-records.csv}
7
8 \begin{document}
9 \begin{DTLenvforeach*}{data}{\Title=Title,\FirstName=First Name,\Surname=Surname,\AssignmentI=Assignment 1,\AssignmentII=Assignment 2,\AssignmentIII=Assignment 3,\Address=Address}
10 \begin{letter}{\Title\space\FirstName\space\Surname\\\Address}
11 \opening{Dear \Title~\Surname}
12
13 \DTLmeanforall{\Score}{\AssignmentI,\AssignmentII,\AssignmentIII}
14 \DTLround{\Score}{\Score}{0}\DTLclip{\Score}{\Score}%
15 You were awarded a mark of \Score\%.
16
17 \closing{Yours Sincerely}
18 \end{letter}
19
20 \end{DTLenvforeach*}
21 \end{document}