20

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 create something like this:

enter image description here

\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}
Werner
  • 603,163
Dennis
  • 477
  • 5
    It seems you are looking for a \tabular environment with columns \begin{tabular}{r|l}. – Marco Daniel Nov 01 '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 01 '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 01 '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 01 '11 at 17:48
  • The updated URL of the example document seems to be http://europassd.cedefop.europa.eu/img/dynamic/c1477/type.FileContent.file/CVExamples2_nl_NL.pdf – mvkorpel Jul 07 '14 at 12:37

1 Answers1

15

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

lockstep
  • 250,273
  • 5
    You could also just use \SetLabelAlign{parright}{\parbox[t]{\labelwidth}{\raggedleft#1}} with the latest released version on enumitem. – Peter Grill Nov 01 '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 01 '11 at 18:08
  • @Dennis: Try to replace \setlist[description] with \setdescription -- this might (!) work for older enumitem versions. – lockstep Nov 01 '11 at 18:14
  • @lockstep \setdescription will compile the document, but the results are actually the same as my example. – Dennis Nov 01 '11 at 18:23
  • @Dennis: Just to be sure: You don't see a difference between align=parright and align=parleft? If so, I'm out of my depth. – lockstep Nov 01 '11 at 18:28
  • @lockstep: Nope. Sorry. – Dennis Nov 01 '11 at 18:33
  • @PeterGrill you should post this as a solution. (It gets the spacing nicer than in lockstep's solution.) – Alan Munn Nov 01 '11 at 18:42
  • @Alan: I edited my answer because I also noted the superior spacing. Should I refrain from using Peter Grill's suggestion (even with proper attribution)? – lockstep Nov 01 '11 at 18:44
  • 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 01 '11 at 18:45
  • @lockstep: Its fine to include it as you have done. – Peter Grill Nov 01 '11 at 18:46
  • @PeterGrill: I hope to return the favour soon. – lockstep Nov 01 '11 at 18:46
  • @lockstep No, of course not. :-) You might want to mention that the alternative version is only recommended if you have an old version of enumitem. – Alan Munn Nov 01 '11 at 18:50
  • Awesome work guys. Thanks everyone! Especially lockstep and Peter Grill. – Dennis Nov 01 '11 at 19:35
  • I forgot to update my MacTex distribution. Which contained an older version of the enumitem package. This is why the provided answer by lockstep didn't work at first. Run the TexLive Utility to update all packages. – Dennis Nov 01 '11 at 19:46
  • Note there is a missing \smash in parright. Compare its definition with that of parleft in the docs. – Javier Bezos Mar 27 '12 at 16:51
  • @JavierBezos Please feel free to correct my error, i.e., edit the missing \smash in. – lockstep Mar 27 '12 at 16:52