I'm trying to set a custom colour for hyperref's link underlining. The MWE below shows what I'm doing. But the colour comes out different - it's the same kind of yellow but a different saturation, if I have to guess. I also haven't figured out how to match the line width to the line width I'm using for the section heading underlines.


% Packages
\usepackage{xcolor} % showframe loads this

% demo only

% theme colours and lengths
\definecolor{MyThemeColour}{cmyk}{0.10,0.10,1.00,0} % personal yellow

% outdent and underline section headings
    \bgroup\markoverwith{\textcolor{MyThemeColour}{\rule[-0.75ex]{1pt}{1pt}}}\ULon% 2pt 2pt

% make the PDF link underlining use my default colour
  \def\@pdfborder{0 0 1}% Overrides border definition set with colorlinks=true
  \def\@pdfborderstyle{/S/U/W 2}% Overrides border style set with colorlinks=true




(Compiling using lualatex in case that makes a difference.`




then all colors are internally converted into the rgb modell. A yellow in cmyk is not the same as yellow in rgb.

  • Perfect, thank you (& I would never have worked this out on my own!). – Lyndon Drake Jun 4 at 18:31
  • Any thoughts on how to set the line width? – Lyndon Drake Jun 4 at 18:31
  • I do not really understand what you mean by line width. I get "1 Lipsum" underlined. – Red-Cloud Jun 4 at 18:37
  • No worries, I figured it out - thanks again – Lyndon Drake Jun 4 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.