Take the 2-minute tour ×
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 writing a letter using LaTeX's letter template, in which I include my e-mail address and phone numbers in the \address section. I would like to use icons from the marvosym package instead of writing "E-mail:" etc. Further, I would prefer for the e-mail address and phone numbers to be aligned as in a table.

Here is the code I try to use in the \address section:

\address{Kurt Han Peek \\ Piet Heinlaan 23 \\ 2341 SG  Oegstgeest \\ \begin{tabbing} \Letter \= \hspace{0.5em}\= kurt.peek@gmail.com \\ \Mobilefone \> \>06-14920959 \\ \Telefon \> \> (071) 517 7081 \end{tabbing}}

However, I get the error: ! LaTeX Error: Something's wrong--perhaps a missing \item. in TeXworks. I suspect the tabbing environment can't be used in the \address, because it does work in the main text. I have also tried using a tabular environment which works, but the cells have some "padding", so the marvosym icons then are not left-aligned with the address above.

Any ideas on how to solve this would be much appreciated.

P.S. For the sake of completeness, here is the complete LaTeX code:

\documentclass{letter}
\usepackage{graphicx}
\usepackage[margin=2cm]{geometry}
\usepackage{marvosym}   
\usepackage[pdfborder=0]{hyperref}

%\address{Kurt Han Peek \\ Piet Heinlaan 23 \\ 2341 SG  Oegstgeest \\ \Letter~\href{mailto:kurt.peek@gmail.com}{kurt.peek@gmail.com} \\ %\Mobilefone~0614920959 \\ \Telefon~  071 517 7081}

\address{Kurt Han Peek \\ Piet Heinlaan 23 \\ 2341 SG  Oegstgeest \\ \begin{tabbing} \Letter \= \hspace{0.5em}\= kurt.peek@gmail.com \\ \Mobilefone \> \>06-14920959 \\ \Telefon \> \> (071) 517 7081 \end{tabbing}}

\date{23 februari 2012}
\begin{document}
\begin{letter}{TNO \\ t.a.v. Maaike Blikslager \\ High Tech Campus 5 \\ 5656 AE  Eindhoven}
\opening{Beste ...,}
Graag wil ik solliciteren op de functie .... Het werk van de ...groep sluit goed aan bij interesses en carri\`eredoelen, ik en zou me verheugen om mijn kandidatuur persoonlijk met u te bespreken.

 \begin{tabular}{r@{\hspace{1em}}l}
  \Letter&\href{mailto:...@gmail.com}{...@gmail.com}\\                        
  \Mobilefone&06 14920959\\                          
  \Telefon&(071) 517 7081\\ \end{tabular}

\begin{tabbing}
\Letter \= \hspace{0.5em} \= kurt.peek@gmail.com \\
\Mobilefone \> \>06-14920959 \\
\Telefon \> \> (071) 517 7081
\end{tabbing}

Bedankt voor uw tijd, en ik verheug me op uw reactie.

\closing{Met vriendelijke groet, \\
%\fromsig{\includegraphics[scale=0.5]{signature_kurt.jpg}} \\
\fromname{Kurt Peek}
}

\end{letter}
\end{document}
share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can "simulate" the tabbing behaviour using \hbox to <length>{...}, the following code is self-explanatory I hope:

\def\addresssymbol#1{\hbox to 1.2em{#1}} % <-- set a good length here

\address{Kurt Han Peek \\ Piet Heinlaan 23 \\ 2341 SG  Oegstgeest
\\ \addresssymbol{\Letter} kurt.peek@gmail.com
\\ \addresssymbol{\Mobilefone} 06-14920959
\\ \addresssymbol{\Telefon} (071) 517 7081
}
share|improve this answer
    
Awesome! Works like a charm. Thanks, tohecz! –  khpeek Feb 24 '12 at 12:47
    
In that case you should mark the answer as accepted so that others see the problem was solved (see the FAQ here) –  tohecz Feb 24 '12 at 13:20

You can exploit the fact that a minipage containing only a tabbing environment will be as wide as necessary:

\address{Kurt Han Peek \\ Piet Heinlaan 23 \\ 2341 SG  Oegstgeest \\
  \begin{minipage}{\textwidth}
  \begin{tabbing}
  \Letter \= \hspace{0.5em}\= kurt.peek@gmail.com \\
  \Mobilefone \> \>06-14920959 \\
  \Telefon \> \> (071) 517 7081
  \end{tabbing}
  \end{minipage}}

But probably you can make better use of a tabular environment, that will free you from the necessity to guess at the symbols' widths:

\address{Kurt Han Peek \\ Piet Heinlaan 23 \\ 2341 SG  Oegstgeest \\
  \begin{tabular}{@{}l@{ }l}
  \Letter     & \texttt{kurt.peek@gmail.com} \\
  \Mobilefone & 06-14920959 \\
  \Telefon    & (071) 517 7081
  \end{tabular}}
share|improve this answer

Your Answer

 
discard

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.