9

I want to make a tcolorbox that says Definition: in the title and that is it.

\documentclass{article}
\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems}
%  defi enviro                                                                      
\tcbset{
  theorem/.style args = {#1}{%                                                      
    title = {\mbox{#1} :},
  }
}
\tcbmaketheorem{Definition}{Definition}{%                                         
  colframe = gray!black!50,
  fonttitle = \bfseries
}
\begin{document}
\begin{Definition}{Definition}
  Some definition.
\end{Definition}
\end{document}

2 Answers 2

5

Since you don't want numbering, nor anything special, you can simply use \newtcolorbox:

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

\newtcolorbox{mydef}{title=Definition:}

\begin{document}

\begin{mydef}
\lipsum[4]
\end{mydef}

\end{document}

enter image description here

9

See if this is what you want to achieve:

enter image description here

\documentclass{article}
\usepackage[most]{tcolorbox}
\tcbuselibrary{theorems}

\newtcbtheorem{Definitions}{Definition}%
{colframe=gray!50!black,fonttitle=\bfseries}{}

\begin{document}
\begin{Definitions}{This is my definition}{}
  Some definition.
\end{Definitions}
\end{document} 

Remarks

  1. I changed colframe=gray!black!50 to colframe=gray!50!black ...
  2. I used \newtcbtheorem instead of \tcbmaketheorem because the latter is considered deprecated.
3
  • I don't want my definitions indexed or any optional arguments.
    – dustin
    Aug 31, 2013 at 15:14
  • @dustin I apologize for misunderstanding your question. I thought you wanted something like this, seeing your code. Aug 31, 2013 at 17:32
  • It isn't a big deal. I was just clarifying with my comment.
    – dustin
    Aug 31, 2013 at 17:44

You must log in to answer this question.

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