nccmath:fleqn 编号

nccmath:fleqn 编号

以下示例说明了 nccmath/fleqn 与 hyperref 的不兼容性

\documentclass{article}
\usepackage{nccmath}
\numberwithin{equation}{section}
\setlength{\parindent}{0.0ex}

% comment out hyperref to see proper equation references
\usepackage[colorlinks=true]{hyperref}

\begin{document}

\section{First section}
Hello world
\begin{fleqn}
\begin{equation}\label{eqnA}
    \qquad\text{equation A:}\quad x + 3y = 7
\end{equation}
\end{fleqn}

\vspace{5in}
Goodby world
\begin{fleqn}
\begin{equation}\label{eqnB}
    \qquad\text{equation B:}\quad 5x + 2y = 3
\end{equation}
\end{fleqn}

\newpage
\section{Second section}
reference to equation B: \eqref{eqnB}\\
reference to equation A: \eqref{eqnA}

\end{document}

答案1

加载nccmath hyperref

\documentclass{article}

\usepackage[colorlinks=true]{hyperref}

\usepackage{nccmath}
\numberwithin{equation}{section}

\begin{document}

\section{First section}
Hello world
\begin{fleqn}
\begin{equation}\label{eqnA}
    \qquad\text{equation A:}\quad x + 3y = 7
\end{equation}
\end{fleqn}

\vspace{5in}
Goodby world
\begin{fleqn}
\begin{equation}\label{eqnB}
    \qquad\text{equation B:}\quad 5x + 2y = 3
\end{equation}
\end{fleqn}

\newpage
\section{Second section}
reference to equation B: \eqref{eqnB}\\
reference to equation A: \eqref{eqnA}

\end{document}

在此处输入图片描述

相关内容