In a question I asked before, I implemented method 2 by feculededentier. However, now I am facing difficulty in referring to different examples in this case. For example, what should be the Latex code for "as shown in Example 1.2"?
Cross-referencing – Referring to Example Numbers in TColorBox in LaTeX
cross-referencingtcolorbox
Best Answer
You have to slightly change the definition. Make it 2 arguments with first one as optional:
And then use the
label=<name>
key likeNow you can use
Example~\ref{second}
to refer to these boxes.Full example (taken and modified from the answer linked in the question)
cleveref
version:You can load
cleveref
package and usecrefname
in the options to reduce typing.