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'd like to augment the embedded enumerated list inside tabular to have custom labels. I am using Yiannis Lazarides's tabular example, but would like to add a custom label that can do circled number as in Stefan Kottwitz's solution

So combined, this is what I'm trying to do:

\documentclass{article}
\usepackage{enumitem}
\usepackage{tikz}
\usepackage[demo]{graphicx}
\newcommand*\numcircledtikz[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}

\begin{document}


\begin{table}[!h] 
\begin{minipage}{1\textwidth}\centering
\begin{tabular}{p{.8\textwidth} | p{.2\textwidth} } 
    \raisebox{\dimexpr\ht\strutbox-\height\relax}{\includegraphics[width=0.8\textwidth]{test}}
    &
    \begin{enumerate}[label=\protect\numcircledtikz{\arabic*}]
        \item ext steps\ldots
        \item num. circled  
        \end{enumerate} \\      
\end{tabular}\end{minipage}\end{table}

\end{document}

And this is the error messages I get:

! Missing number, treated as zero. <to be read again> 
               \c@*  l.62 ...e}[label=\protect\numcircledtikz{\arabic*}
                                              ] ?

When I try something more simple [label=\textcircled{\arabic*}], I get the same error message. How should I fix this error?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Without a complete example of your actual code, it's difficult to see where the problem might be. However, this works:

\documentclass{article}
\usepackage{enumitem}
\usepackage{tikz}

\newcommand*\numcircledtikz[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}

\begin{document}

\begin{tabular}{|p{4cm}|}
\hline
\textbf{Name:} Foo \\
\hline
\textbf{Main success scenario:}
\begin{enumerate}[label=\protect\numcircledtikz{\arabic*}]
  \item [\numcircledtikz{1}]Entry action
  \item Next steps\ldots
\end{enumerate}\\
\hline
\end{tabular}

\end{document}

enter image description here

share|improve this answer
    
I thought I had in my preamble \usepackage{enumitem} but I did not. So after checking that, now the code works. Thank you. –  Sal Jr Jul 25 '12 at 16:10
add comment

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.