2

Im writing a thesis and uses \cref for my references. However every single \cref provides a Warning stating 'Suppressing empty link'. I could ignore this warnings, but its actually so many of them that they starts to clog up the message log. Any ideas how to remove these empty links?

\hypersetup{
colorlinks = true,
citecolor = title,
linkcolor = title,
    urlcolor = title
}
\usepackage[noabbrev]{cleveref}
\creflabelformat{figure}{\color{tudelft-dark-blue} \textbf{#1#2#3}}
\crefname{figure}{figure}{figures}
\creflabelformat{table}{\color{tudelft-dark-blue} \textbf{#1#2#3}}
\crefname{table}{table}{table}
\creflabelformat{equation}{[#1#2#3]}
\creflabelformat{equation}{\color{tudelft-dark-blue}(#1#2#3)}
\crefname{equation}{\color{tudelft-dark-blue}equation}{equations}
\crefrangeformat{equation}{eq. #3[#1]#4--#5[#2]#6}
\crefrangeformat{equation}{equation #3#1#4--#5#2#6}

enter image description here

2
  • 2
    can you not make a small self-contained document that shows the problem, so people can debug it? Commented Nov 20, 2016 at 11:04
  • 1
    Maybe unrelated to OP, but I was getting these warnings, when I put \label{} BEFORE \caption{}, in a figure environment, instead of AFTER. It was producing bad/empty references. The solution was to switch to correct order \caption, then \label. Commented May 9, 2021 at 21:10

1 Answer 1

2

The references are indeed empty:

\creflabelformat{figure}{\color{tudelft-dark-blue} \textbf{#1#2#3}}

#1 is the reference text, #2 the start link and #3 the end link. The order should be #2#1#3:

\documentclass{article}
\usepackage{xcolor}
\colorlet{title}{blue}
\colorlet{tudelft-dark-blue}{blue!50!black}
\usepackage{hyperref}

\hypersetup{
colorlinks = true,
citecolor = title,
linkcolor = title,
    urlcolor = title
}
\usepackage[noabbrev]{cleveref}
\creflabelformat{figure}{\color{tudelft-dark-blue} \textbf{#2#1#3}}
\crefname{figure}{figure}{figures}
\creflabelformat{table}{\color{tudelft-dark-blue} \textbf{#2#1#3}}
\crefname{table}{table}{table}
\creflabelformat{equation}{[#2#1#3]}
\creflabelformat{equation}{\color{tudelft-dark-blue}(#2#1#3)}
\crefname{equation}{\color{tudelft-dark-blue}equation}{equations}
\crefrangeformat{equation}{eq. #3[#1]#4--#5[#2]#6}
\crefrangeformat{equation}{equation #3#1#4--#5#2#6}

\begin{document}
  \section{Section}\label{sec:section}
  \begin{equation}E=mc^2\label{eq:equation}\end{equation}
  \begin{figure}\caption{Caption}\label{fig:figure}\end{figure}

  Section \cref{sec:section}\\
  Equation \cref{eq:equation}\\
  Figure \cref{fig:figure}
\end{document}
1
  • So sorry i didnt provide a small self-contained document that shows the problem. Didnt know the numbering within the equation had any indications thank you Heiko Commented Nov 20, 2016 at 12:08

You must log in to answer this question.

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