LaTeX forum ⇒ Theses, Books, Title pagesPRoblem 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

Postby robintux » Sat Oct 21, 2017 11:31 pm

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.

I hope we can talk about this topic.

Greetings.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Oct 22, 2017 1:20 am

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
Site admin

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

Postby robintux » Thu Oct 26, 2017 12:44 am

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.

  1. \begin{teorema}{}
  2. \label{teo1}
  3. 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.
  4. \end{teorema}
  5.  
  6.  
  7. \begin{proof}[\textit{Prueba}]
  8. $$
  9. \{g(X) \le y\}=\{X\in g^{-1}(-\infty,y]\},
  10. $$ 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.
  11. \end{proof}
  12. \begin{proposition}\label{pro1}
  13. Sean $X$ y $Y$variables aleatorias definidas en el mismo espacio de probabilidad $(\Omega,\mathscr{A},\P)$. Entonces,
  14. \begin{enumerate}
  15. \item $(aX + bY)(\omega)=aX(\omega) + bY(\omega) \quad \forall \omega\in\Omega, a,b\in \mathbb{R}$
  16. \item $(X - Y)(\omega)=X(\omega) - Y(\omega) \quad \forall \omega\in\Omega;$
  17. \item $\max(X,Y)$ y $\min(X,Y)$
  18. \item $(X Y)(\omega)=X(\omega) Y(\omega) \quad \forall \omega\in\Omega,$
  19. \item $\left(\frac{X}{Y}\right)(\omega)=\frac{X(\omega)}{Y(\omega)} \quad \forall \omega\in\Omega,\text{ supuesto que}, \{Y=0\}=\emptyset$
  20. \end{enumerate}
  21. son variables aleatorias.
  22. \end{proposition}
  23. \begin{teorema}{}
  24. \label{teo2}
  25. 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.
  26. \end{teorema}
  27.  
  28. Ver teorema \ref{teo2}
  29.  
  30. 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
rerfe.png (54.88 KiB) Viewed 91 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Oct 26, 2017 4:01 am

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
Site admin

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

Postby robintux » Wed Nov 01, 2017 9:56 pm

Dear Stefan ,

thanks for your help .

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

  1. \begin{teorema}{}
  2. 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.
  3. \end{teorema}\label{teorem:teo1}
  4.  
  5.  
  6. \begin{proof}[\textit{Prueba}]
  7. $$
  8. \{g(X) \le y\}=\{X\in g^{-1}(-\infty,y]\},
  9. $$ 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.
  10. \end{proof}
  11. \begin{proposition}\label{pro1}
  12. Sean $X$ y $Y$variables aleatorias definidas en el mismo espacio de probabilidad $(\Omega,\mathscr{A},\P)$. Entonces,
  13. \begin{enumerate}
  14. \item $(aX + bY)(\omega)=aX(\omega) + bY(\omega) \quad \forall \omega\in\Omega, a,b\in \mathbb{R}$
  15. \item $(X - Y)(\omega)=X(\omega) - Y(\omega) \quad \forall \omega\in\Omega;$
  16. \item $\max(X,Y)$ y $\min(X,Y)$
  17. \item $(X Y)(\omega)=X(\omega) Y(\omega) \quad \forall \omega\in\Omega,$
  18. \item $\left(\frac{X}{Y}\right)(\omega)=\frac{X(\omega)}{Y(\omega)} \quad \forall \omega\in\Omega,\text{ supuesto que}, \{Y=0\}=\emptyset$
  19. \end{enumerate}
  20. son variables aleatorias.
  21. \end{proposition}
  22.  
  23.  
  24. \begin{teorema}{ }%[label={teorem:teo2}]
  25. 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.
  26. \end{teorema}\label{teorem:teo2}
  27.  
  28. Ver teorema \ref{teorem:teo1} y a la vez Ver teorema \ref{teorem:teo2} .
  29. Luego \\
  30.  
  31.  
  32. 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
problem_Ref.png (59.49 KiB) Viewed 65 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8453
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed Nov 01, 2017 10:00 pm

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: Infominimal working example).

Stefan
Site admin


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests