对方程和子方程的一个引用

对方程和子方程的一个引用

在我的文档中,我需要引用两个方程式和子方程式的总体标签。我在文档结构中包含了 hyperref 和 cleverref 包。但是 latex 给出了错误。

References `eq:MSE2' and `eq:abc' in reference range on page 3 have different types `equation' and `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{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}

在此处输入图片描述

答案1

您需要这样做\label[equation]{eq:abc},因为当前计数器是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}

在此处输入图片描述

相关内容