我正在使用\fullref
问题中的命令的变体\nameref——如何显示部分名称及其编号,我的一个叫做\typeref
:
\documentclass[12pt,a4paper,english]{abntex2}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[nameinlink]{cleveref}
\newcommand*{\typeref}[1]{\hyperref[{#1}]{\Cref{#1}}} % One single link
\newcommand*{\fullref}[1]{\hyperref[{#1}]{\Cref{#1}: \nameref{#1}}} % One single link
\begin{document}
\typeref{firstlabel}.
\typeref{secondlabel}.
\typeref{firstlabel,secondlabel}.
\cleardoublepage
\begin{figure}[h]
\caption{Caption 1}
\label{firstlabel}
Figure 1
\end{figure}
\cleardoublepage
\begin{figure}[h]
\caption{Caption 2}
\label{secondlabel}
Figure 2
\end{figure}
\end{document}
正确生成了 PDF 文件:
但是当编译这个时,每次我编译/重新编译 PDF 时 hyperref 都会不断弹出警告:
Redoing nameref's sectioning
Redoing nameref's label
LaTeX Warning: Hyper reference `firstlabel,secondlabel' on page 1 undefined on
input line 15.
[1{D:/User/Documents/latex/texmfs/data/pdftex/config/pdftex.map}] [2] [3]
[4] [5] (test3.aux)
LaTeX Warning: There were undefined references.
我怎样才能hyperref
不再认为存在未定义的引用?