给一个比较完整的 MWE, 根据 `texdoc hyperref` 中 sec 9.1 Package Compatibility 一节的第 2 小节,
![](https://wenda.latexstudio.net/data/attach/210215/EZgtRseO.png)
可以使用 `gather` 环境代替 `equation` 环境, 反正单行公式二者并不会有什么区别, 而且 sec 9.1.2 中还提到了
> The environments equation and eqnarray are not supported too well. For example, there might be spacing problems
虽然我不知道这个 spacing problem 在哪里. 下面是完整的 MWE, 为可以正确引用的公式环境
```latex
\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{gather}
this is gather\label{gather}\\gather\notag
\end{gather}
\lipsum[1]
\begin{equation}
this is equation1\label{equation1}
\end{equation}
\lipsum[1]
\begin{gather}
this is gather with tags\tag{gather}\label{gatherwithtag}
\end{gather}
\lipsum[1]
\begin{equation*}
this is equation*\tag{tag}\label{equation*}
\end{equation*}
\lipsum[1]
\begin{equation}
this is equation2\label{equation2}
\end{equation}
\lipsum[1]
\begin{align}
line 1\label{align1}\\
line 2\tag{line2}\label{align2}\\
line 3\notag\\
line 4\label{align4}
\end{align}
\lipsum[1]
refs: \ref{gather}, \ref{equation1}, \ref{gatherwithtag}, \ref{equation*}, \ref{equation2}, \ref{align1}, \ref{align2}, \ref{align4}
\end{document}
```
一周热门 更多>