# How to color a link using hyperref package [duplicate]

I'm trying to color one word using hyperref package as a homework to school,I was looking for some examples in the internet how to do it...but whatever I did it doesn't work.

My preamble:

   \documentclass[a4paper,10pt]{article}
\usepackage[margin=2cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[OT4]{polski}
\usepackage[polish]{babel}
\usepackage{color}
\usepackage{enumitem}
\usepackage{makeidx}
\usepackage{multirow}
\usepackage{caption}
\makeindex
\usepackage{hyperref}
\begin{document}

Źródło tekstu i ilustracji: \href{https://pl.wikipedia.org/wiki/Stanis%C5%82aw_Lem}{Wikipedia}

\end{document}


Now In PDF i need to have this looks like this

i guess its color Magenta in package hyperref but i dont know what commands i should use now in my code to color this

• option colorlinks, also please post a full minimal example so we have something to just copy and test. We have no idea what your preamble looks like her. BTW: welcome to the site. – daleif Nov 2 '17 at 11:44
• @daleif and where I sould write this? – Julia Orfin Nov 2 '17 at 11:46
• \usepackage[colorlinks]{hyperref} or later on \hypersetup{colorlinks} – user31729 Nov 2 '17 at 11:55
• and what command i sould use in line with word "Wikipedia" to make it in color Magenta? – Julia Orfin Nov 2 '17 at 11:56
• @Julia: There is a manual to be read by users ;-) – user31729 Nov 2 '17 at 11:58

To get colored links, give hyperref the colorlinks option either as

\usepackage[colorlinks]{hyperref}


or after loading hyperref issue

\hypersetup{colorlinks}


You can control the four hyperref colors via

linkcolor=colorname,
citecolor=colorname,
filecolor=colorname,
urlcolor=colorname,


where colorname is an existing colorname. By default urlcolor is magenta under colorlinks.