6

I have used tcolorbox as an item to highlight some content. It works fine in general.

MWE:

\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{adjustbox}
\usepackage[most]{tcolorbox}
%
\begin{document}
%
\begin{itemize}
    \item[\textcolor{DarkGreen}{\textbullet}]\adjustbox{valign=t}{%
         \begin{tcolorbox}[width=0.934\textwidth,colback={white},title={Title},colbacktitle={DarkGreen},coltitle=white,colframe={DarkGreen}]
         \parskip=5pt

          Some text
          \end{tcolorbox}
          }
    \item Some Item 
\end{itemize}
\end{document}

However, whenever I have to use another list environment or centered table/figure, the item dot is pushed inside the box. I want that item dot to remain outside of the box. Please tell me how to fix this.

\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{adjustbox}
\usepackage[most]{tcolorbox}
%
\begin{document}
%
\begin{itemize}
    \item[\textcolor{DarkGreen}{\textbullet}]\adjustbox{valign=t}{%
         \begin{tcolorbox}[width=0.934\textwidth,colback={white},title={Title},colbacktitle={DarkGreen},coltitle=white,colframe={DarkGreen}]
         \parskip=5pt

          Some text
          \begin{enumerate}
               \item A
               \item B
          \end{enumerate}
          \end{tcolorbox}
          }
    \item Some Item 
\end{itemize}
\end{document}
0
9

Start the paragraph before inserting the box:

\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{adjustbox}
\usepackage[most]{tcolorbox}
%
\begin{document}
%
\begin{itemize}
    \item[\textcolor{DarkGreen}{\textbullet}]
    \leavevmode %<--------------
    \adjustbox{valign=t}{%
         \begin{tcolorbox}[width=0.934\textwidth,colback={white},title={Title},colbacktitle={DarkGreen},coltitle=white,colframe={DarkGreen}]
         \parskip=5pt

          Some text
          \begin{enumerate}
               \item A
               \item B
          \end{enumerate}
          \end{tcolorbox}
          }
    \item Some Item
\end{itemize}
\end{document}

enter image description here

1
  • Thanks! This solved the problem. However, the tcolorbox in this environment refuses to break between pages. Any idea of how to achieve breakable tcolorbox in the above environment?
    – g_vasare
    Apr 9 '19 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.