2

Within my document I need to refer to two equations and to the overall label of subequations. I have the packages hyperref and cleverref included in the structure of the document. However latex gives an error.

References `eq:MSE2' and `eq:abc' in reference range on page 3 have different types `equation' and `subequation'

So it is not possible to have a reference to a equation and to the overall label of the subequations.

Does anybody have any idea how to solve this reference in one command?

Thanks in advance.

\documentclass[10pt,showtrim,openright]{scrreprt} 

\usepackage[
includemp,
                  showframe,
                  reversemp,
            paperwidth=20.10cm,
            paperheight=25.80cm,
            top=2.30cm,
            bottom=3.4cm,
            inner=2.7cm,
            outer=2.7cm,
            marginparwidth=1.6cm, % Fixed for now
            marginparsep=0.4cm
            ]{geometry}

\usepackage{amsmath,hyperref,cleveref}

\usepackage{etoolbox}%control vspave in ToC

\usepackage{todonotes}% todo notes chapter 5
\usepackage{textcomp} % for degree symbol in memoir
\usepackage{booktabs} % for tabular lines
\usepackage{enumitem} % for no spacing when itemize
\usepackage{longtable} % allows long table for nomenclature
% \usepackage{adjustbox}
% \usepackage{marginnote}

\usepackage{floatrow}               % Set up captions of floats
\usepackage{marginfix}              % Make marginpars float freely
\usepackage{caption}   % Correctly placed anchors for hyperlinks
\usepackage{changepage}              % to adjust the width 

\usepackage[footwidth=textwithmarginpar]{scrlayer-scrpage} % page styl

\begin{document}


\begin{equation}
\mathrm{MSE}= \sigma_{p}^2+\sigma_o^2 -2 \sigma_p \sigma_o \rho_{po}+
\left( \overline{p} - \overline{o}\right) ^{2} 
 \label{eq:MSE2}
\end{equation}

\begin{equation}
\mathrm{MSE}={\sigma_o^2}(1-\alpha+\beta+\gamma)
 \label{eq:MSEnormo}
\end{equation}

\begin{subequations} \label{eq:abc}
\begin{align}
\alpha&=\rho_{p o}^2 \label{eq:a}  \\
\beta&=\left( \rho_{p o} - \frac{\sigma_{p}}  {\sigma_{o}}\right)^2  
\label{eq:b} \\
\gamma&=\frac{\left( \overline{p}-\overline{o}\right) ^{2}}{\sigma_{o}^2}. 
\label{eq:c}
\end{align}
\end{subequations}

\cref{eq:MSE2,eq:MSEnormo,eq:abc}

\end{document}

enter image description here

1 Answer 1

4

You need to do \label[equation]{eq:abc}, because the current counter is subequation.

\documentclass[10pt,showtrim,openright]{scrreprt} 

\usepackage[
includemp,
                  showframe,
                  reversemp,
            paperwidth=20.10cm,
            paperheight=25.80cm,
            top=2.30cm,
            bottom=3.4cm,
            inner=2.7cm,
            outer=2.7cm,
            marginparwidth=1.6cm, % Fixed for now
            marginparsep=0.4cm
            ]{geometry}

\usepackage{amsmath,hyperref,cleveref}

\usepackage{etoolbox}%control vspave in ToC

\usepackage{todonotes}% todo notes chapter 5
\usepackage{textcomp} % for degree symbol in memoir
\usepackage{booktabs} % for tabular lines
\usepackage{enumitem} % for no spacing when itemize
\usepackage{longtable} % allows long table for nomenclature
% \usepackage{adjustbox}
% \usepackage{marginnote}

\usepackage{floatrow}               % Set up captions of floats
\usepackage{marginfix}              % Make marginpars float freely
\usepackage{caption}   % Correctly placed anchors for hyperlinks
\usepackage{changepage}              % to adjust the width 

\usepackage[footwidth=textwithmarginpar]{scrlayer-scrpage} % page styl

\begin{document}


\begin{equation}
\mathrm{MSE}= \sigma_{p}^2+\sigma_o^2 -2 \sigma_p \sigma_o \rho_{po}+
\left( \overline{p} - \overline{o}\right) ^{2} 
 \label{eq:MSE2}
\end{equation}

\begin{equation}
\mathrm{MSE}={\sigma_o^2}(1-\alpha+\beta+\gamma)
 \label{eq:MSEnormo}
\end{equation}

\begin{subequations} \label[equation]{eq:abc}
\begin{align}
\alpha&=\rho_{p o}^2 \label{eq:a}  \\
\beta&=\left( \rho_{p o} - \frac{\sigma_{p}}  {\sigma_{o}}\right)^2  
\label{eq:b} \\
\gamma&=\frac{\left( \overline{p}-\overline{o}\right) ^{2}}{\sigma_{o}^2}. 
\label{eq:c}
\end{align}
\end{subequations}

\cref{eq:MSE2,eq:MSEnormo,eq:abc}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .