Generalautomatic cover letter generation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

automatic cover letter generation

Post by melekzedek »

I want to know how to automatically generate cover letters (or certificates) with a list. My idea is having two files, one of them with a list, and the other one when compiled will go the the list_file and grab the necessary information and automatically generate as much pages as information contained in the list_files.
Does anyone knows how to do this? If the list_file could be something of CSV files, this would be even better.
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

automatic cover letter generation

Post by melekzedek »

It seems that the package mailmerge will do the job

The package mailmerge provides an interface to produce text from a template, where fields are replaced by actual data, as in a database. The package may be used to produce several letters from a template, certificates or other such documents. It allows access to the entry number, number of entries and so on.
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

automatic cover letter generation

Post by josephwright »

Also consider datatool.
Joseph Wright
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: automatic cover letter generation

Post by daleif »

Both can do the job, but datatool is much more flexible. You can just maintain a CSV file with the changing data, and then use the foreach construction to loop over the data.
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

Re: automatic cover letter generation

Post by melekzedek »

thanks for point me out datatool, I'm sure I will be using it quite a lot :D
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

automatic cover letter generation

Post by melekzedek »

I also found formlett, which is quite simple and straightforward, you just put some variables across the text, and them you put
moreletter 1st_variable; 2nd_variable! and it will generate all the letters. See working example

Code: Select all

\documentstyle[formlett,12pt,a4]{article}
%\usepackage[portuguese]{babel}
%\usepackage[utf8]{inputenc}
%\usepackage[pdftex]{graphicx}

\begin{document}                         

\beginletter                             

\NOPAGENUMBERS\parindent=0pt            

                   
\vspace*{3cm}
Hereby I confirm that 

\begin{flushleft}
 \hspace*{1cm}  \textsf{\paras[2]} 
\end{flushleft}


participated in BLABLABLA and delivered the contributed talk

\begin{flushleft}
\hspace*{1cm} \textsf{\paras[1]}. 
\end{flushleft}
              
\vfill

\hspace{7cm} Lisbon, \today

\vspace{2cm}

\hspace{7cm} Chairman of the Organizing Committee

\hspace*{7cm} Professor John Doe

\vfill\eject       
\endletter                                

\moreletter
How to do things; Jane Doe!

\moreletter
numbers in $\textrm{\textbf{R}}^n$; ze ninguem!
  
\end{document}
the problem is that I cannot use \usepackage, since it gives an error. Does anyone knows why?
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

automatic cover letter generation

Post by localghost »

I wonder why you are working in LaTeX2.09 mode.

Code: Select all

\documentclass[12pt,a4paper,portuguese]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{formlett}
...
Omit any driver option for the graphicx package.


Best regards
Thorsten
melekzedek
Posts: 34
Joined: Sat Aug 08, 2009 1:05 pm

automatic cover letter generation

Post by melekzedek »

thanks localghost, now it's working.
You asked why I was working in LaTeX2.09 mode, but I simply copy the information from the user manual found in http://www.ctan.org/tex-archive/help/Ca ... mlett.html, and since I'm not a LaTeX guru as you, I was wondering why the use of

Code: Select all

\documentstyle
and not

Code: Select all

\documentclass
Using Ubuntu 13.10 under the hood and LaTeXing via Vim-LaTeX
ウンベルト
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

automatic cover letter generation

Post by localghost »

melekzedek wrote:[...] You asked why I was working in LaTeX2.09 mode, but I simply copy the information from the user manual found in http://www.ctan.org/tex-archive/help/Ca ... mlett.html [...]
Half a page later (in the left column) you can find the according code for the LaTeX2e mode.
Post Reply