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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do a lot of itemize lists in beamer presentation which, in a later step, I want to format nicely, for instance, typeset everything up to the first colon in boldface and the remaining part scriptsize inside a \parbox. A common idiom I use is to define a custom \Item command for this purpose that parses the item text and emits a \item with the intended formatting:



\def\Item#1:#2\endItem{\item \parbox{2cm}{\strut\textbf{#1:}}\parbox[t]{\linewidth-2cm}{\footnotesize#2}}
\begin{frame}{A frame}
  Common metasyntactic variables (used to name absolutely anything)
    \Item foo: f*cked over and over? Well, we do not really know the meaning of this beast.\endItem
    \Item bar: beyond all reason?\endItem


enter image description here However, to scan the "rest" of the item's text as a macro argument, I have to finish eacht item by an explicit end marker \endItem, which I would like to avoid. As in this related question, I also do not want to put the item's text into groups of curly braces.

Is there another, more elegant way to scan to the end of an \item?

share|improve this question
It's actually fubar, which evolved into foobar. – Werner May 10 '12 at 21:27
You can use \par as delimiter, instead of \endItem, but you'll need to leave a blank line at the end of each item. – egreg May 10 '12 at 21:30
@Werner: I know. My example is furchtbar :-) – Daniel May 11 '12 at 6:50
@egreg: I did consider this, but refrained from it I consider it as too fragile. The fact that the blank lines suddenly are mandatory would be a clear violation of the principle of least surprise for anybody editing my stuff. – Daniel May 11 '12 at 6:59
@Daniel TeX is not a language for general parsing; it's designed for typesetting paragraphs. In order to gather some user input for processing you have to delimit it in some way. An "inner" environment, using the environ package, might be a better solution than using \endItem. – egreg May 11 '12 at 9:17

You can recreate the same effect with a description list and some styling. Unfortunately, beamer doesn't have a template for the description part of the the description list. So setting the font size to \footnotesize has to involve some hack. Maybe someone can come up with a less intrusive one.


\setbeamertemplate{description item}{%
    \usebeamertemplate*{itemize item} %
\setbeamercolor{description item}{fg=black}
\setbeamerfont{description item}{series=\bfseries,size=\normalsize}
\setbeamersize{description width=2cm}



\begin{frame}{A useless list}
    \item[first] This is the first list item
    \item[bar] And this is the second one



share|improve this answer
+1 Neat trick, which, however only solves this particular example. (Thats always the problem with MWEs, in the end you have oversimplified...). I am actually seeking a general solution that would also work if I want to parse into more than two parts. Moreover, I need to mix my customized \Items and ordinary \items within the same list. – Daniel May 11 '12 at 6:56

Your Answer


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.