4
\documentclass{article}
\usepackage{amsmath,amsthm,amssymb,parskip}
\usepackage{graphicx,float,hyperref}
\usepackage[margin=1in]{geometry}
\usepackage{titling,multicol}
\usepackage{tcolorbox}
\tcbuselibrary{theorems}
\newtcbtheorem{mytheo*}{}%
{colback=purple!5,colframe=blue!100!,fonttitle=\bfseries}{th}

\begin{document}

\begin{mytheo*}{title...}{}
text...
\end{mytheo*}

\end{document}

I am trying to make the theorem unnumbered, but I have not managed to figure out how to remove the number 1 and the colon that appear at the beginning of the theorem title. Does anyone know how to do this?

9

There is a misunderstanding by the OP what \newtcbtheorem does actually:

\newtcbtheorem{foo}{...}{...}{...} will actually define both the numbered theorem - like enviroment foo and foo*, so \newtcbtheorem{foo*} will actually define foo* and foo**, leaving foo* being numbered however and foo** is the unnumbered version.

See page 340 of current tcolorbox manual for a description of this.

In addition, hyperref should be loaded as last package as almost always in 98% of all cases.

As a reply to the comment below by Bryan-M-H:

The unstarred version of the theorem has an additional mandatory argument that is meant for the label, see the changed example where the label is given as {foo}, which is extended to th:foo since the definition of the theorem has th as label prefix.

Related (but not duplicate) Counter for tcolorbox

Also related (no duplicate too): Problem with tcolorbox package

\documentclass{article}
\usepackage{amsmath,amsthm,amssymb,parskip}
\usepackage[margin=1in]{geometry}
\usepackage{titling,multicol}
\usepackage[most]{tcolorbox}

\usepackage{graphicx,float}
\usepackage{hyperref}

\newtcbtheorem{mytheo}{My theorem}{colback=purple!5,colframe=blue!100!,fonttitle=\bfseries}{th}

\begin{document}

\begin{mytheo*}{}
  text...
\end{mytheo*}

See \ref{th:foo} 

\begin{mytheo}{Foo}{foo}
  text...
\end{mytheo}

\end{document}

enter image description here

  • I tried to use the unstarred version of this in the body of the document, but found that the first letter of my theorem text was eaten up. [The word "text" came out as "ext" in the pink box.] What do I need to change? \begin{mytheo}{Fowler's Folly} text... \end{mytheo} – Bryan M-H Feb 17 '18 at 14:25
  • 1
    @BryanM-H: See my extended answer: You forgot the 2nd mandatory argument that is meant for the label of the unstarred environment. If you don't need a label, use {} – user31729 Feb 17 '18 at 15:17

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.