1

I'm trying to write some text with bullet representation within a box. My code is

\begin{document}    
\usepackage{amssymb}
\usepackage{fancybox}  
\usepackage[breakable]{tcolorbox}  
\usepackage{graphicx}  
\begin{document}   
\framebox[1.1\width]{\begin{itemize}    
        \item[$\checkmark$] \textbf{Notation:} From now on, we shall write 
        $b + c$ and $bc$ be instead of $b \vee c$ and $b \wedge c$.
\end{itemize}} 
\end{document}

The whole text is inside the box but the problem is the bullet check mark disappears. The error shows 'Something's wrong--perhaps a missing \item. \end{itemize}}'

1 Answer 1

1

Don't try to use itemize inside of a box. itemize operates in vertical mode, while \framebox operates in horizontal mode.

Instead, just place the check at the lead of the text.

\documentclass{article}
\usepackage{amssymb}
\usepackage{fancybox}  
\usepackage[breakable]{tcolorbox}  
\usepackage{graphicx}  
\begin{document}   
\framebox[1.1\width]{    
        $\checkmark$ \textbf{Notation:} From now on, we shall write 
        $b + c$ and $bc$ be instead of $b \vee c$ and $b \wedge c$.} 
\end{document}

enter image description here

If line breaking or itemize are a necessity, then you must place a wrapper around the itemize that supports vertical mode, such as minipage or \parbox:

\documentclass{article}
\usepackage{amssymb}
\usepackage{fancybox}  
\usepackage[breakable]{tcolorbox}  
\usepackage{graphicx}  
\begin{document}   
\fbox{\begin{minipage}{3in}
  \begin{itemize}
     \item[$\checkmark$] \textbf{Notation:} From now on, we shall write 
        $b + c$ and $bc$ be instead of $b \vee c$ and $b \wedge c$. 
     \item Hi mom
  \end{itemize}
\end{minipage}}
\end{document}

enter image description here

As projetmbc notes, a tcolorbox may be a better choice even, depending on your application. Note that tcolorbox gives wide flexibility on colors, sizes, margins, etc. So consult the manual if you wish to use this technique, to see what your options are.

\documentclass{article}
\usepackage{amssymb}
\usepackage{fancybox}  
\usepackage[breakable]{tcolorbox}  
\usepackage{graphicx}
\usepackage{tcolorbox}  
\begin{document}   
\begin{tcolorbox}[width=3in]
  \begin{itemize}
     \item[$\checkmark$] \textbf{Notation:} From now on, we shall write 
        $b + c$ and $bc$ be instead of $b \vee c$ and $b \wedge c$. 
     \item Hi mom
  \end{itemize}
\end{tcolorbox}
\end{document}

enter image description here

11
  • and how do I break this line, if needed?
    – Manjoy Das
    Apr 21, 2021 at 19:16
  • @ManjoyDas You can place a minipage or perhaps a \parbox inside the \framebox. If you do that, you can then use \itemize or other linebreaking mechanisms. Apr 21, 2021 at 19:18
  • I used \parbox. \framebox{% \parbox{\textwidth}{% \bfseries \begin{itemize} \item[$\checkmark$] \textbf{Notation:} To simplify notations, from now on, we shall write $b + c$ and $bc$ be instead of $b \vee c$ and $b \wedge c$. \end{itemize}}}. But that makes the total text bold.
    – Manjoy Das
    Apr 21, 2021 at 19:20
  • @ManjoyDas I added to my answer to cover the possibility of line breaks. Apr 21, 2021 at 19:22
  • 1
    @ManjoyDas As I just edited, if you go the tcolorbox route, please consult the documentation, as it provides wide flexibility to control all the parameters of interest, too much to go into here. Apr 21, 2021 at 19:38

You must log in to answer this question.

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