0

In reference to a similar post, I am trying to replace the numbering of \item with a bracketed word. However, if the renamed bullet is long enough, it ends up out of the box:

\documentclass{article}
\usepackage{tcolorbox}

\begin{document}

\begin{tcolorbox}
\begin{itemize}
     \item[{[blablababakbakbakb]}] \lipsum[1]
     \item[{[blubllanlanlanlan]}] \lipsum[2]
\end{itemize}
\end{tcolorbox}

\end{document}

enter image description here

Any idea of how to get around this?

  • 1
    You are using the wrong list. Use description instead of itemize. – Ulrike Fischer Jan 31 '17 at 8:09
  • This is no tcolorbox problem. Without the tcolorbox around the itemize, the leakage of the labels into margin would even be larger – user31729 Jan 31 '17 at 9:25
  • thanks, but \description compiles the list similarly to what is proposed in the answer below. What I wanted, if possible, is to have something like above, but inside the box. – RobertP. Jan 31 '17 at 14:21
  • Answer updated. – Salim Bou Jan 31 '17 at 14:39
1

You can customize list dimensions with enumitem package, in your case just increase itemindent and add align=left to align label with left side

\documentclass{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{tcolorbox}

\begin{document}

\begin{tcolorbox}
\begin{itemize}[itemindent=2.5cm,labelsep=4mm,labelwidth=3cm,align=left]
     \item[{[blablababakbakbakb]}] \lipsum[1]
     \item[{[blubllanlanlanlan]}] \lipsum[2]
\end{itemize}
\end{tcolorbox}

\end{document}

enter image description here

Update

If you need all text to be indented you can just increase leftmargin

\documentclass{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{tcolorbox}

\begin{document}

\begin{tcolorbox}
\begin{itemize}[leftmargin=3.2cm]
     \item[{[blablababakbakbakb]}] \lipsum[1]
     \item[{[blubllanlanlanlan]}] \lipsum[2]
\end{itemize}
\end{tcolorbox}

\end{document}
  • thank you for your help! this sounds good, although I was thinking about something slightly different. What I wanted, if possible, is to have the entire text of a bullet completely indented and the bullet inside the box. Does that make sense? – RobertP. Jan 31 '17 at 14:22

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.