Theses, Books, Title pages ⇒ PRoblem with \label and \ref in legrand-orange-book
PRoblem with \label and \ref in legrand-orange-book
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
PRoblem with \label and \ref in legrand-orange-book
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
PRoblem with \label and \ref in legrand-orange-book
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.
Code: Select all
\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}
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 5098 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
PRoblem with \label and \ref in legrand-orange-book
\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

label
option and referencing.Stefan
PRoblem with \label and \ref in legrand-orange-book
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
Code: Select all
\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} .
https://mega.nz/#!g6YCnaBD!98EpmV8yrXjI ... LTy1tnJDGw
- Attachments
-
- problem_Ref.png (59.49 KiB) Viewed 5072 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
PRoblem with \label and \ref in legrand-orange-book
\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:

Stefan