LaTeX forum ⇒ Theses, Books, Title pages ⇒ PRoblem with \label and \ref in legrand-orange-book

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
robintux
Posts: 3
Joined: Sat Oct 21, 2017 11:16 pm

PRoblem with \label and \ref in legrand-orange-book

Dear community,

My question is about the template legrand-orange-book, some could say how the references work in this template.

It seems to me that the newcounter and newtcolorbox commands modify the way you use the references.

Greetings.

Tags:

Stefan Kottwitz
Posts: 8666
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi,

welcome to the forum!

Can you explain the issue in more detail? What does not work? Is there an error message? It would be good if you would post some code that leads to the problem.

Stefan

robintux
Posts: 3
Joined: Sat Oct 21, 2017 11:16 pm
Of course, here the detail

as you can see in the attached image, at the end of the image, appears twice: "See Theorem 1.2".

The problem is that you should see
"See Theorem 1.1" and
"See Theorem 1.2"

as expected by the code used.

\begin{teorema}{}	\label{teo1}	Sea X una variable aleatoria definida en $(\Omega,\mathscr{A},\P)$. También sea $g$ una función medible Borel en $\mathbb{R}$. Entonces $g(X)$ es también una variable aleatoria.\end{teorema}  \begin{proof}[\textit{Prueba}]	$$\{g(X) \le y\}=\{X\in g^{-1}(-\infty,y]\},$$	y puesto que $g$ es una función medible Borel  es un conjunto Borel. Resulta que $\{g(X)\le y\} \in \mathscr{A}$ con lo que se completa la prueba.\end{proof}\begin{proposition}\label{pro1}Sean $X$ y $Y$variables aleatorias definidas en el mismo espacio de probabilidad $(\Omega,\mathscr{A},\P)$. Entonces,\begin{enumerate}\item $(aX + bY)(\omega)=aX(\omega) + bY(\omega) \quad \forall \omega\in\Omega, a,b\in \mathbb{R}$\item $(X - Y)(\omega)=X(\omega) - Y(\omega) \quad \forall \omega\in\Omega;$\item $\max(X,Y)$ y $\min(X,Y)$ \item $(X Y)(\omega)=X(\omega) Y(\omega) \quad \forall \omega\in\Omega,$\item $\left(\frac{X}{Y}\right)(\omega)=\frac{X(\omega)}{Y(\omega)} \quad \forall \omega\in\Omega,\text{ supuesto que}, \{Y=0\}=\emptyset$\end{enumerate}son variables aleatorias.\end{proposition}\begin{teorema}{}	\label{teo2}	Sean $X$ y $Y$ variables aleatorias definidas en $(\Omega,\mathscr{A},\P)$. Entonces  $X+Y$ y $XY$ son también variables aleatorias. Adicionalmente, $\{Y=0\}=\emptyset$, entonces $\frac{Y}{X}$ también  es una variable aleatoria.\end{teorema} Ver teorema \ref{teo2} Ver teorema \ref{teo1}

and that is precisely what does not allow me to advance, and so I come to the forum to ask wisdom.

Without more to add, greetings from Lima-Peru.

**Here I upload the complete source code
https://mega.nz/#!cvYDmLRL!Cn9SkcgZAyKX ... 5Iojl3Po6Y
Attachments
rerfe.png (54.88 KiB) Viewed 500 times

Stefan Kottwitz
Posts: 8666
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
I think with those tcolorboxes the label goes at an optional argument to the defined environment, instead of using \label, for proper support, such as:

\begin{teorema}[label=teo1]

I tried it and it did not yet work right away, but I guess knowing that piece may help you with a look into the tcolorbox manual regarding the label option and referencing.

Stefan

robintux
Posts: 3
Joined: Sat Oct 21, 2017 11:16 pm
Dear Stefan ,

But I continue with a problem in cross-references. Apparently the \ref command does not recognize the numbering created with the \newcounter command.

As you can see in the final part of the attached image, all references are made to Theorem 1.2, however Theorem 1.2 does not exist in the structure of the pdf.

The code of this part is follows

\begin{teorema}{}	Sea X una variable aleatoria definida en $(\Omega,\mathscr{A},\P)$. También sea $g$ una función medible Borel en $\mathbb{R}$. Entonces $g(X)$ es también una variable aleatoria.\end{teorema}\label{teorem:teo1}  \begin{proof}[\textit{Prueba}]	$$\{g(X) \le y\}=\{X\in g^{-1}(-\infty,y]\},$$	y puesto que $g$ es una función medible Borel  es un conjunto Borel. Resulta que $\{g(X)\le y\} \in \mathscr{A}$ con lo que se completa la prueba.\end{proof}\begin{proposition}\label{pro1}Sean $X$ y $Y$variables aleatorias definidas en el mismo espacio de probabilidad $(\Omega,\mathscr{A},\P)$. Entonces,\begin{enumerate}\item $(aX + bY)(\omega)=aX(\omega) + bY(\omega) \quad \forall \omega\in\Omega, a,b\in \mathbb{R}$\item $(X - Y)(\omega)=X(\omega) - Y(\omega) \quad \forall \omega\in\Omega;$\item $\max(X,Y)$ y $\min(X,Y)$ \item $(X Y)(\omega)=X(\omega) Y(\omega) \quad \forall \omega\in\Omega,$\item $\left(\frac{X}{Y}\right)(\omega)=\frac{X(\omega)}{Y(\omega)} \quad \forall \omega\in\Omega,\text{ supuesto que}, \{Y=0\}=\emptyset$\end{enumerate}son variables aleatorias.\end{proposition}  \begin{teorema}{ }%[label={teorem:teo2}]	Sean $X$ y $Y$ variables aleatorias definidas en $(\Omega,\mathscr{A},\P)$. Entonces  $X+Y$ y $XY$ son también variables aleatorias. Adicionalmente, $\{Y=0\}=\emptyset$, entonces $\frac{Y}{X}$ también  es una variable aleatoria.\end{teorema}\label{teorem:teo2} Ver teorema \ref{teorem:teo1}  y a la vez  Ver teorema \ref{teorem:teo2} .Luego  \\  Ver teorema \ref{teorem:teo1}  y a la vez  Ver teorema \ref{teorem:teo2} .

**The complete source code is posted on:
https://mega.nz/#!g6YCnaBD!98EpmV8yrXjI ... LTy1tnJDGw
Attachments
problem_Ref.png (59.49 KiB) Viewed 474 times

Stefan Kottwitz
Posts: 8666
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Labels should be within the environment, not after it, as I see here:

\end{teorema}\label{teorem:teo1}

I cannot access mega.nz. Perhaps you can post it as attachment? It can be removed later. We just should keep problem related discussion (code, screenshot) here but for sure we should protect privacy and don't keep whole documents. Or create testable small code (instruction: minimal working example).

Stefan