I have the following:

    how to cite thm in title

So far it is mostly working, but for the title, I would like to have it be "Theorem X.XX" for the theorem number. I'm just not sure how to keep track of the theorem number in the title.

enter image description here

1 Answer 1


The tcolorbox package has a library for theorem. See section 18 of the manual. The library has the command \NewTcbTheorem[⟨init options⟩]{⟨name⟩}{⟨display name⟩}{⟨options⟩}{⟨prefix⟩} that define a theorem like environment.

  • name : is the name of your environment
  • display name : how would the name appear
  • options : as usual
  • prefix : a prefix that will be add to the label.

Your environment will have two mandatory arguments. The first one is the title of the theorem. The second one is the label.

So here is one way to do what you want



\NewTcbTheorem[number within=section]{mytheorem}{My Theorem}%

\usepackage{hyperref}    % for the command \nameref{}



\begin{mytheorem}{This is my title}{theoexample}
This is the text of the theorem. The counter is automatically assigned and,
in this example, prefixed with the section number. This theorem is numbered with
\ref{th:theoexample}, it is given on page~\pageref{th:theoexample},
and it is titled : \nameref{th:theoexample}.

  • exactly what I needed! thank you
    – stone327
    Commented Jul 10 at 13:32
  • @stone327 If this answer your question, you can accept it with the green check mark. This is how we keep track of answered/unanswered question. And glad I could help Commented Jul 11 at 0:18

You must log in to answer this question.

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