I'm generating a bulk letter using datatool. Therefore I import my data from an external csv-file using the following syntax:
\documentclass[11pt]{dinbrief}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage[separator=;]{datatool}
\newrobustcmd{\companyrobust}{\parbox[b]{7.5cm}{\raggedright\company}}
\begin{document}
\inputencoding{latin1}
\DTLloadrawdb{addr}{list.csv} % open database
\inputencoding{utf8}
\DTLforeach{addr}{
\company=company,
\firstname=firstname,
\surname=surname%
}{ % start bulk letter
\begin{letter}{\companyrobust\\\firstname\ \surname}
\subject{\textbf{test}}
\opening{Dear Mr. \surname,}
nothing
\closing{regards}
\end{letter}
}
\end{document}
the corresponding list.csv is the following:
company;firstname;surname
Microsoft Software;Bill;Gates
This was working for me for quite a while but now I have the problem that there is a company in my list which has a linebreak in its name. For example I want to put "Software" in a new line. I tried using \\
, \linebreak
and \newline
but I it did not work and I could not figure out how to succeed. How can I realize a defined line break within a field of the csv-file?
letter
class with theletter
environment), and also a short sample csv file with an example entry that needs a line break.company
values created automatically? In your setup you could useMicrosoft\DTLpar Software
and avoid using a line-break in the actual CSV.