# using latex to produce conference ID badges ?

989 views

### Sebastian

Dec 11, 2007, 4:24:13 PM12/11/07
to
Hello, I have a list of people attending to conference organized by my
department and to avoid using MS stuff i wanted to prepare conference ID
for them in latex (standard 5,5cmx8,9cm or something like that).
Is it possible to use some latex package to automate this thing as much
as possible?
I wanted every ID included my department logo as watermark and also
participant name and affiliation.
Can these names be read from separate table and automatically put into
document?

Regards
Sebastian

Message has been deleted

### Martin Heller

Dec 11, 2007, 5:12:03 PM12/11/07
to
Sebastian skrev:

csvtools makes this kind of thing pretty easy

\documentclass{article}
\usepackage{filecontents}
\usepackage{csvtools}
\usepackage[margin=5mm,paperwidth=8.9cm,paperheight=5.5cm]{geometry}
\usepackage{eso-pic}
\setlength\unitlength{1mm}
\put(64,5){\rule{2cm}{4.5cm}}%
}

\begin{filecontents*}{names.csv}
First,Last,Affiliation
Foo,Bar,Baz
John,Doh,Department of Something
A.,nonym,Institute of Nothing
\end{filecontents*}

\begin{document}
\applyCSVfile{names.csv}{%
\noindent
\begin{minipage}{5.9cm}
\sffamily
{\Large\insertFirst~\insertLast\par}
{\large\itshape\insertAffiliation}%
\end{minipage}\newpage
}
\end{document}

### Sebastian

Dec 12, 2007, 2:15:08 PM12/12/07
to
it is maybe easy but i have some problems with placing picture "in the
background" and also is looks that is huge margin from right side larger
than 5mm even if i remove code for rule placing.:(

my example:
%& --translate-file=cp1250pl
\documentclass[10pt]{article}
\usepackage{polski}
\usepackage[dvips]{graphics}
\usepackage{filecontents}
\usepackage{csvtools}
\pagestyle{empty}
\usepackage[left=5mm,right=5mm,paperwidth=8.9cm,paperheight=5.5cm]{geometry}
\usepackage{eso-pic}
}
\normalsize\normalfont
\begin{document}
\begin{filecontents*}{users.csv}
ImieNaz,Uczelnia
\end{filecontents*}
\applyCSVfile{users.csv}{%

\noindent
\begin{minipage}{5.9cm}
\sffamily

{\Large\insertImieNaz \par}
{\centering \large\itshape\insertUczelnia}

\end{minipage}
\newpage
}
\end{document}

and also it looks that filecontents* section must be placed after
\begin{document} otherwise i got an error "missing \begin{document}

:(

Sebastian

### Martin Heller

Dec 12, 2007, 2:56:21 PM12/12/07
to
Sebastian skrev:

> it is maybe easy but i have some problems with placing picture "in the
> background" and

Put things for the background in \AddToShipoutPicture.

> also is looks that is huge margin from right side larger
> than 5mm even if i remove code for rule placing.:(

> \applyCSVfile{users.csv}{%
> \noindent
> \begin{minipage}{5.9cm}
^^^^^
This sets the width of the text. Don't use the minipage if you
want the text to fill the whole textwidth.

> and also it looks that filecontents* section must be placed after
> \begin{document} otherwise i got an error "missing \begin{document}

That error must be related to something else. The filecontents
environment from LaTeX must go *before* \begin{document}. The
fact that you can put it after is caused by the hacks in
filecontents.sty. You don't need to generate the csv file from
the document source. You can generate it externally and just
extract data in the document.

\documentclass[10pt]{article}
%\usepackage{polski}
\usepackage{graphics}
\usepackage{filecontents}
\usepackage{csvtools}
\usepackage{xcolor}

\pagestyle{empty}
\usepackage[left=5mm,right=5mm,paperwidth=8.9cm,paperheight=5.5cm]{geometry}
\usepackage{eso-pic}

\put(0,0){\color{red}\rule{1cm}{5.5cm}}
}

\begin{filecontents*}{users.csv}
ImieNaz,Uczelnia
\end{filecontents*}

\begin{document}

\applyCSVfile{users.csv}{%
\noindent
\sffamily
{\Large\insertImieNaz \par}
{\centering \large\itshape\insertUczelnia\par}
Some long text that fills the whole textwidth and
wraps to a new line.
\newpage
}

\end{document}

### Sebastian

Dec 12, 2007, 4:16:21 PM12/12/07
to
Thanks it helps me a lot.if I want include some png image do I have to
use \put command? or simple \includegrapchis or \pgfuseimage is enough?

### Martin Heller

Dec 12, 2007, 6:35:14 PM12/12/07
to
Sebastian skrev:

> Thanks it helps me a lot.if I want include some png image do I have to
> use \put command? or simple \includegrapchis or \pgfuseimage is enough?

You need to use \includegraphics or \pgfuseimage inside a \put
png you need to compile with pdflatex or go via dvipdfm(x) to pdf.

### Sebastian

Dec 12, 2007, 6:38:31 PM12/12/07
to
Martin Heller pisze:

Thanks it works..it is possible to put this image as watermark? with
some kind of opacity...

Sebastian

### Martin Heller

Dec 12, 2007, 7:58:41 PM12/12/07
to
Sebastian skrev:

> Thanks it works..it is possible to put this image as watermark? with
> some kind of opacity...

It is possible to add a imagemask using pgf but doing the image
manipulation with image manipulation software is easier than
doing it via LaTeX macros.

### Sebastian

Dec 13, 2007, 4:17:18 PM12/13/07
to
Martin Heller pisze:

yes thats true..sorry that I found another problem. I prepared IDs and
they looks great but...on a4 paper put together they have no border..so
i guess i should create framebox of the size declared in geometry but
but \framebox is fragile and I dont know if nesting works in such
environments..something like
\framebox(8.7cm,5.5cm){}
\}

or \framebox(8.7cm,5.5cm){
}
}
produces errors.

Regards
Sebastian

### Martin Heller

Dec 13, 2007, 4:35:27 PM12/13/07
to
Sebastian skrev:

> sorry that I found another problem. I prepared IDs and
> they looks great but...on a4 paper put together they have no border..so
> i guess i should create framebox of the size declared in geometry but

I thought you wanted to create each card on a separate pages with
the dimension 8.9cm x 5.5cm? Add `dvips' to the geometry option
list if you use latex and dvips and don't want to tell dvips the
pagesize yourself.

> but \framebox is fragile and I dont know if nesting works in such
> environments..something like
> \framebox(8.7cm,5.5cm){}
> \}
>
> or \framebox(8.7cm,5.5cm){
> }
> }
> produces errors.

This is not related to fragile commands. Everything in
\AddToShipoutPicture have to be \put in place. Post a complete
running example of what you are doing.