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 want a description list that looks like the following:

          Name | Joel Spolsky
       Address | Some address
                 Some zipcode
     Telephone | +31 123 456
        E-Mail | email@domain.org
Something more | Bashing latex in- 
     elaborate | to submission     

How would I accomplish this? I've tried using the enumitem package but it doesn't want to align the labels (not the items) to the right as in the above example. When using the multiline style option items either overlap or bump into eachother.

I'm trying to recreate something like this in LaTeX: http://europass.cedefop.europa.eu/img/dynamic/c1477/type.FileContent.file/CVExamples2_nl_NL.pdf

\usepackage{enumitem}
\setdescription{style=multiline,topsep=10pt,leftmargin=5cm,font=\normalfont}

\section{Experience}
\begin{description}
  \item[Data] 2011 - heden (20 weken) 
  \item[Beroep of functie] Software Developer
  \item[Voornaamste werkzaamheden en verantwoordelijkheden] Software ontwikkeling 
  \item[Naam en adres van de werkgever] Multicast Automatisering B.V. 
  \item[Soort onderneming of sector] Informatie Communicatie Technologie (ICT)
\end{description}
share|improve this question
5  
It seems you are looking for a \tabular environment with columns \begin{tabular}{r|l}. –  Marco Daniel Nov 1 '11 at 17:12
1  
When you say you've tried the enumitem package, what have you tried? Elaborate on how it hasn't worked... –  Seamus Nov 1 '11 at 17:21
1  
I will be using tabular as Marco suggested but I thought description lists were semantically more correct to use in this context. –  Dennis Nov 1 '11 at 17:29
1  
The problem with using a tabular environment for this is that it does not break across pages. Consequently, it's easier to stick to a list environment that allows this without trouble. –  Werner Nov 1 '11 at 17:48
add comment

1 Answer

up vote 12 down vote accepted

The enumitem package does not feature a parright alignment option, but (somewhat to my surprise) it was rather easy to create (as a carbon copy of the existing parleft option).

EDIT: Peter Grill pointed out \SetLabelAlign in a comment, and this actually results in superior spacing.

EDIT 2: The alternative version is only recommended if you have an old version of enumitem -- hat tip to Alan Munn.

\documentclass{article}

\usepackage{enumitem}

% Variant A
% \makeatletter
% \def\enit@align@parright{%
%   \def\enit@align##1{%
%     \nobreak
%     \strut\smash{\parbox[t]\labelwidth{\raggedleft##1}}}}
% \makeatother

% Variant B with superior spacing -- thanks to Peter Grill
\SetLabelAlign{parright}{\parbox[t]{\labelwidth}{\raggedleft#1}}

\setlist[description]{style=multiline,topsep=10pt,leftmargin=5cm,font=\normalfont,%
    align=parright}

\begin{document}

\section{Experience}
\begin{description}
  \item[Data] 2011 - heden (20 weken) 
  \item[Beroep of functie] Software Developer
  \item[Voornaamste werkzaamheden en verantwoordelijkheden] Software ontwikkeling 
  \item[Naam en adres van de werkgever] Multicast Automatisering B.V. 
  \item[Soort onderneming of sector] Informatie Communicatie Technologie (ICT)
\end{description}

\end{document}

enter image description here

share|improve this answer
5  
You could also just use \SetLabelAlign{parright}{\parbox[t]{\labelwidth}{\raggedleft#1}} with the latest released version on enumitem. –  Peter Grill Nov 1 '11 at 17:51
    
I've tried to use the above but it doesn't seem to work? Labels are not right-aligned. Or is it me? –  Dennis Nov 1 '11 at 18:08
    
@Dennis: Try to replace \setlist[description] with \setdescription -- this might (!) work for older enumitem versions. –  lockstep Nov 1 '11 at 18:14
    
@lockstep \setdescription will compile the document, but the results are actually the same as my example. –  Dennis Nov 1 '11 at 18:23
1  
@AlanMunn: Thanks, but since the solution was very similar to this one, I did not feel it warranted a separate answer. –  Peter Grill Nov 1 '11 at 18:45
show 11 more comments

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.