This question is posted as a requested follow-on from options for appearance of links in hyperref , to clear up some odd behaviour in hyperref.
In the snippet below, the two \usepackage commands both work, but linkcolor=.
throws an error when combined with colorlinks=true
(error text shown at end of post).
\documentclass{article}
\usepackage[colorlinks=true,linkcolor=]{hyperref}
%\usepackage[linkcolor=.]{hyperref}
\begin{document}
See Figure~\ref{fig}
\begin{figure}
\caption{This is an empty figure \label{fig}}
\end{figure}
\end{document}
If I use the line
\usepackage[colorlinks=true,linkcolor=.]{hyperref}
(note the dot), I get error text:
LaTeX Error: Undefined color
and the error comes immediately after the closing brace of \ref{}
The effect I wanted to achieve was to remove boxes around links and leave all links text color except actual URLs, so when I used this command I also had urlcolor=blue
in the options, but that was not needed to reproduce the error. But the following line did work, in that all links but URLs were invisible:
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=]{hyperref}
Using MiKTeX-pdfTeX 2.9.6959 (1.40.20) (MiKTeX 2.9.6960) on Windows 10
\usepackage{xcolor}
. – Ulrike Fischer Mar 4 '19 at 23:36linkcolor=.
as this is setting the colour to.
, which is a non-existent colour. SImialrly, withlinkcolor=
you are remving all colour so the lins are invisible. Doesn't\usepackage[colorlinks=true,linkcolor=black]{hyperref}
give what you want? – user30471 Mar 4 '19 at 23:38