GeneralNumbering Issue in Cross-Referencing a Definition Block

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
ranaya123
Posts: 8
Joined: Wed Apr 02, 2025 8:08 am

Numbering Issue in Cross-Referencing a Definition Block

Post by ranaya123 »

I have some definition blocks written in my Latex code. These blocks give a nice graphical view to my definitions and here's how the code looks like:

In preamb:

Code: Select all

\newtcbtheorem[number within=section]{definition}{Definition}
    {
    	theorem style = plain apart, enhanced, frame hidden, breakable,
    	boxrule=2mm,titlerule=0mm,toptitle=1mm,bottomtitle=1mm,
    	fonttitle=\bfseries\large, fontupper=\normalsize,
    	coltitle=black!60!PinkNude, colbacktitle=white!70!PinkNude,
    	colback=white!80!PinkNude
 }{def}
And here's an example definition block:

Code: Select all

 \begin{definition}{}{}\label{def:2_1}
  \begin{itemize}[leftmargin=*]
    	\item The \textit{inertial delay} is the time delay consumed by an electrical signal to activate a single MOSFET transistor.
    	\vspace*{1mm}
        \item The \textit{inertial delay} is the time delay consumed by an electrical signal to activate a single MOSFET transistor.
  \end{itemize}
  \end{definition}
And the cross reference:

we define the inertial delay ($\tau$\textsubscript{D}) of a MOSFET in the definition block \ref{def:2_1}.

However, this does not produce the correct cross referencing as shown below:
notes111.png
notes111.png (51.15 KiB) Viewed 382 times
Can anybody shed a light on to what's happening here? Why the cross-referencing is wrong here?

Thanks and Regards

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

ranaya123
Posts: 8
Joined: Wed Apr 02, 2025 8:08 am

Re: Numbering Issue in Cross-Referencing a Definition Block

Post by ranaya123 »

I found the solution by myself. The trick is to use referencing as follows:

So the second argument (within the bracket) of the definition block is therefore the cross referencing! I didn't know that.

Code: Select all

\begin{definition}{}{2_1} 
\ref{def:2_1}
Post Reply