Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to create a LaTex document that will allow me to write the text of the birthday invitations once with the formatting I desire, and then have Latex automatically fill in the recipient's names from a list on each different one (as well as have multiple invitations per letter sized sheet of paper).

I have searched this sight as well as the Latex wikibook and a Latex website for templates (to see if anyone has done something similar) or similar concepts. I haven't found anything that would help me do this.

share|improve this question
A solution does not have to rely on lists. For example, creating a macro \invite{<name>} would permit to create the desired invitations by using one \invite call per guest without an explicit list. –  Christian Lindig Jun 26 '12 at 12:17

3 Answers 3

Create a txt file consisting of rows of the following form:


You can use up to 9 fields (because commands can't have more parameters in LaTeX). All entries must have the same number of fields.
Save this file e.g. as adr.txt
Then write your letter with latex and use:

   \begin{letter}{#1 #2 \\#4\\#5}
   \opening{Dear #1,} 
   We would like to invite you ...

All you have to do is to replace names, given names, street etc. with the field number of your \ADR definition. This should work on all letter classes.

share|improve this answer
I just edited the code to make a MWE. Very nice idea. –  R. Schumacher Jun 25 '12 at 14:33
@R.Schumacher I use the way of may edited answer. Each begin{letter} starts a new page, though no \clearpage is needed. –  Peter Breitfeld Jun 26 '12 at 11:39

Here is a solution using a csv data file with the names, then using the datatool package to create the invitations, finally using Werner's recommandation to use a pdf printer to get 4up. I used PDF995 (which was on my laptop).

First create the csv file. I just used notepad to create the file and then did a save as to marie-names.txt

I now have the following file in csv format

Bob the Tomatoe
Larry the Cucumber
Big Bird
Waldo (if found) 

Now I modified the instructions found at to get the following MWE. Note: old-border.jpg is from and picture1.png was converted using powerpoint from

% Use scrartcl to allow larger base font size

\usepackage{wallpaper} % For background image frame

% Load database 'names' from file 'marie-names.txt''
\DTLloaddb{firstnames}{marie-names.txt}%Import the txt file in csv format as a database
\linespread{2}\selectfont %Changing linespacing for the font and enabling the change
\pagestyle{empty}% Turn of page numbers
% Set old-border.jpg as background image
\TileWallPaper{\paperwidth}{\paperheight}{old-border}%Loading a borderpattern
% Ref:

% For each record (line) in database 'names'
% Assign field values by name to macros
    {\LARGE\bfseries Birthday Party Invitation}\par
   \smallskip\large Dear \name,\par\smallskip
   You are invited to a cookout to celebrate Cookie Monster's 44th birthday!\par
    Saturday, November 10, 2012 from 5:30 -- 9:00 p.m.\par 
    1234 Sesame Street\par 
    Anywhere, USA\par 
  Please RSVP to Miss Piggy at 987-654-abcd\par \bigskip


Now compile with pdflatex and view. Now print with a package capable of creating a 4up pdf page and your get

enter image description here

share|improve this answer

I would suggest using a two-step approach:

  1. Create a standard document layout that has the outline for the invitation set according to your requirements.
  2. Use pdftk or pdfpages (or something similar) to print the output in 2-up, 4-up, or whatever.

Regarding 1, here's a template:

enter image description here

\pagestyle{empty}% No page headers/footers
\setlength{\parindent}{0pt}% No paragraph indent
    Dear ##1,\par\medskip
    See you there,\par\medskip
    \textit{Random Randolfsky}

geometry sets the document layout and size, while lipsum provided some dummy text. etoolbox provides the list-processing capability via \docsvlist{<list of names>}. The main function is \do which processes each element of the comma separated list. I've renewed it to print some salutation, followed by the invitation, followed by the signature.

Since \clearpage only clears the page if it is non-empty, there is no concern issuing it at the start of \do.

share|improve this answer
oh, please use ragged right! this is a party, not a solemn symposium. –  barbara beeton Jun 22 '12 at 22:14
I have tried your solution. Thank you for the suggestion. The example was very helpful. I had trouble getting lipsum to work, but since I didn't need that to test the automatic names I went ahead and replaced it with actual text. It does automatically put names into the invites from a comma seperated list like I was wanting. =) Thank you! –  Marie Mikels Jun 24 '12 at 23:33
@MarieMikels: Exactly. lipsum is merely used to populate a document with dummy text and is not needed for the "end product". Consider using @_barbarabeeton's suggestion of \raggedright, just for fun. Also, if this answer helped you most, consider accepting it as such. See How do you accept an answer? –  Werner Jun 25 '12 at 0:38
Instead of \raggedright you should use the ragged2e package and \RaggedRight. Standard \raggedright looks awful. –  Christian Jun 25 '12 at 6:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.