32

How to do right align a description list using beamer?

      Name | Joel Spolsky
   Address | Some address    

Using the enumitem package as suggested in Description list with right alignment of labels does not seem to work with the beamer package

1 Answer 1

50
+50

With beamer package, the description environment can use an optional argument: a text to fix the maximum width of terms (cf. section 12.1 "Itemizations, Enumerations, and Descriptions", p.113 of beamer guide v3.26).

Example:

\documentclass{beamer}
\setbeamercolor{normal text}{bg=cyan!10}
\begin{document}
\begin{frame}
  \begin{description}[Other description]
  \item[Name] Joel Spolsky
  \item[Address] Some address  
  \item[Other description] Some description
  \end{description}
\end{frame}
\end{document}

enter image description here

How to align items to the left

By default, items are aligned to the right. To align items to the the left :

  • in your preamble, define the predefined option align left for the template description item:

     \defbeamertemplate{description item}{align left}{\insertdescriptionitem\hfill}
    
  • apply this prefined option before a description list:

     \setbeamertemplate{description item}[align left]
    

Example:

enter image description here

\documentclass{beamer}
\setbeamercolor{normal text}{bg=gray!5}
\defbeamertemplate{description item}{align left}{\insertdescriptionitem\hfill}
\begin{document}
\begin{frame}
  \begin{block}{Default}
    \setbeamertemplate{description item}[default]
    \begin{description}[Other description]
    \item[Name] Joel Spolsky
    \item[Address] Some address  
    \item[Other description] Some description
    \end{description}
  \end{block}
  \begin{block}{Align left}
    \setbeamertemplate{description item}[align left]
    \begin{description}[Other description]
    \item[Name] Joel Spolsky
    \item[Address] Some address  
    \item[Other description] Some description
    \end{description}
  \end{block}
\end{frame}
\end{document}
8
  • (+1): Good solution. Is there any way to align items to left?
    – MYaseen208
    Mar 4, 2014 at 17:08
  • @MYaseen208 I edited my answer. Mar 4, 2014 at 23:19
  • Simply Awesome!!! I Opened the bounty and will reward you soon. Thanks
    – MYaseen208
    Mar 5, 2014 at 2:29
  • 1
    Can you guide me how to use \setbeamertemplate{description item}[align left] globally? Thanks
    – MYaseen208
    Mar 5, 2014 at 4:55
  • 2
    @MYaseen208 To change alignment globally, insert this line before your first frame (or in your preamble). Mar 5, 2014 at 6:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .