5

How do I disable hyperlinks? My references are showing as green but I don't like it. Code below:

\documentclass[pdftex,12pt,a4paper]{report}
\usepackage{titlesec}
\titleformat{\chapter}{\bfseries\huge}{\thechapter.}{20pt}{\huge}

\usepackage[top=3cm, bottom=3cm, left=3.5cm, right=3cm]{geometry}

% graphics images
\usepackage[pdftex]{graphicx}
\usepackage[toc,page]{appendix}
\usepackage{slashbox}

% 1.5 line spacing
\usepackage{setspace}
\usepackage{tabu}
\usepackage{tabularx}
\onehalfspacing

% maths symbols
\usepackage{amsmath}
%\usepackage[math-style = upright]{unicode-math}

% table package
\usepackage{multirow}

% citation style
%\usepackage[colorlinks=true,linkcolor=black]{hyperref}
\usepackage[pdfpagelabels=false,pdfpagelabels=false,hyperindex=false,pageanchor=false]{hyperref}
\makeatletter
\let\Hy@linktoc\Hy@linktoc@none
\makeatother

\usepackage[square,sort,comma,numbers]{natbib}
\usepackage{amsfonts}

%\renewcommand{\chaptername}{}

\usepackage{tikz,colortbl}
\usetikzlibrary{calc}
\usepackage{zref-savepos}

\usepackage[bf,small,tableposition=top]{caption}
\usepackage{subfig}
\usepackage{float}
\usepackage{url}
\usepackage{pdfpages}

\begin{document}

% cover
%\input{cover_report.tex}
\includepdf[pages=1]{CoverPage}

% abstract
\setcounter{page}{1}
\pagenumbering{roman}
\input{abstract.tex}

% acknowledgement
\input{acknowledgements.tex}

% table of content
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{intro.tex}
\input{literature.tex}
\input{dataset.tex}
\input{module_design.tex}
\input{training.tex}
\input{results.tex}
\input{conclusion.tex}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
% references
\bibliographystyle{unsrtnat}
\bibliography{fyp}

\end{document}
2
  • 7
    You ask how to make all link black colored, right? Read your own code, pay attention to commented lines.
    – Johannes_B
    Jul 17, 2016 at 16:24
  • 4
    By the way, your examples are useless to us, because we don't have the files. They aren't needed on the other hand, so you can throw them out for a code example.
    – Johannes_B
    Jul 17, 2016 at 16:25

3 Answers 3

4

Use allcolors=black instead of linkcolor=black.

(Why do you load hyperref if you don't want it?)

3
  • 2
    Thanks ! I had to submit a softcopy and a hardcopy of my report. The references in green were not appearing in the printed copy and my team still wanted linked the references in softcopy.
    – Kong
    Jul 18, 2016 at 3:38
  • 1
    If the final document is to be distributed on paper, it may still be handy to have working links in a personal copy (e.g. a list of figures). Alternatively DOIs in a reference section might be set in a typewriter font, indicating that they are clickable (or indicating enough to wave the cursor over them and see it change)
    – Chris H
    Jul 18, 2016 at 8:35
  • If the document already uses href commands, you'll get a compile error if you stop loading hyperref.
    – skirodge
    Feb 5 at 18:51
23

Package hyperref provides option hidelinks for links without optical markup.

1
  • Since it is clear what the OP's intention was, I think this should be the accepted answer, because that's the hyperref way of hiding links without losing the hyperlink functionality.
    – beatngu13
    Jul 18, 2016 at 7:52
7

If you want to (temporarily) disable hyperref you can use the draft option:

\usepackage[draft]{hyperref}

or

\hypersetup{draft}

In your case:

\usepackage[
draft,
pdfpagelabels=false,
pdfpagelabels=false,
hyperindex=false,
pageanchor=false
]{hyperref}

Switch to final if you want to enable hyperref again.

As mentioned before, if you don't want hyperlinks at all, don't load the package. If you simply want to change their appearance, checkout this answer.

You must log in to answer this question.

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