I would like to use nice package tcolorbox
for frames together with modern reference system zref
.
My \newtcbtheorem
looks like:
\newtcbtheorem[auto counter,number within=chapter]{mathexam}{MyExample}{%
% colback=purple!5,
% colframe=blue!100!,
fonttitle=\itshape, % \bfseries,
fontupper=\small,
fontlower=\footnotesize,
enforce breakable, % breakable,
compress page,
enhanced,
arc=1pt, left=0pt,right=0pt
}{mai}
but it produce:
LaTeX Warning: Reference `mai:exam038' on page 12 undefined on input line 262.
although I did the translation several times.Is it even possible to use both libraries together?
My motivation to use zref
package is to create multivolume book with my school notes from different subjects. Package zref-xref
can be used instead of xr-hyper
as it is shown in the Heiko Oberdiek's solution.
My complete MNWE is:
\documentclass{scrbook}
\usepackage[most]{tcolorbox}
\newtcbtheorem[auto counter,number within=chapter]{mathexam}{Problem}{%
% colback=purple!5,
% colframe=blue!100!,
fonttitle=\itshape, % \bfseries,
fontupper=\small,
fontlower=\footnotesize,
enforce breakable, % breakable,
compress page,
enhanced,
arc=1pt, left=0pt,right=0pt
}{mai}
\usepackage{nameref}
\usepackage[user, counter]{zref}
% \usepackage{zref-xr}
% \zexternaldocument*{example}
\begin{document}
\chapter{Algebra}\zlabel{chap:math1}
This is a test for math.
\begin{equation}
E=mc^2 \zlabel{eq:1}
\end{equation}
This is a second test for math.
\begin{equation}
r = \sqrt{x^2 + y^2} \zlabel{eq:2}
\end{equation}
In the document A there is chapter \nameref{chap:math1} see the eqation \zref{eq:2}.
Solve the problem shown in example \zref{exam038}
\section{Bunch of examples}
Let's solve following problems
\begin{mathexam}{Gauss method}{exam038}
\(3x + 4y = 5\)
\end{mathexam}
\end{document}