Generalframe box don't contain enumerate

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
allevo
Posts: 49
Joined: Sat Apr 11, 2009 12:09 pm

frame box don't contain enumerate

Post by allevo »

hi!!!
i'd like create a framebox in which i can put a enumerate list.

Code: Select all

\newcommand\example[1]
{  example \hspace{10mm}
{     \framebox{#1}  }
}
but this generate an error:

Code: Select all

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

frame box don't contain enumerate

Post by gmedina »

Hi allevo,

enclose the enumerate environment using a \parbox, as the following example suggests:

Code: Select all

\documentclass{article}

\newcommand\example[1]
  {example \hspace{10mm}
     \framebox{#1}}

\begin{document}

\example{\parbox{6cm}{%
\begin{enumerate}
  \item first item
  \item second item
\end{enumerate}}}

\end{document} 
Of course, set the box width according to your needs.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply