5

Hi I am using TeXmaker (version 4.4.1 (compiled with Qt 5.4.2 and Poppler 0.38.0)) to compile LaTeX. I am facing problem with hyperlinks. None of my hyperlinks are clickable. They don't even follow the format I have specified in the hypersetup arguments.

I have written the following script:

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,      
    urlcolor=cyan,
}

\urlstyle{same}


\begin{document}

\href{url address}{sample text}

\end{document}

This does print the sample text but it just appears as text.

Not sure what's the problem or how to debug.

EDIT: I have used to documentclass line. Didn't put it here, sorry. Here is the code before \hyperref

\documentclass[12pt,a4paper,draft]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

EDIT 2 :I compile PDFLaTeX. Then use Document Veiwer (Ubuntu 16.04) to view PDFs. I used Adobe Acrobat Reader with WINE too. Same problem persists with hyperlink.

3
  • 1
    Welcome, as there is no documentclass line, your example cannot work.
    – Johannes_B
    Jul 6, 2018 at 5:32
  • What PDF viewer are you using?
    – Werner
    Jul 6, 2018 at 5:46
  • 2
    Do you maybe specify draft as one of the options passed to the document class?
    – Mico
    Jul 6, 2018 at 6:15

1 Answer 1

5

Based on your given code you need to comment class option draft to get hyperlinks.

Please see the manual for package hyperref (texdoc hyperref -- manual.pdf):

manual hyperref

Please see the follwowing MWE (important code changing marked with <=======)

\documentclass[%
  12pt,
  a4paper,
% draft     % <=========================================================
]{article}

\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\usepackage{hyperref}
\hypersetup{
  colorlinks=true,
  linkcolor=blue,
  urlcolor=cyan,
}
\urlstyle{same}


\begin{document}

\href{url address}{sample text}

\end{document}

with the following resulting pdf:

resulting pdf

You must log in to answer this question.

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