I would like to use the hypperref
to create blue links for only toc sections and subsections.
\documentclass[12pt,oneside]{book}
\usepackage{amsmath,amssymb,amsthm,amstext,amscd,amsfonts,amsbsy,amsxtra,latexsym,cite,hyperref}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage{ytableau}
\usepackage{titlesec}
\usepackage{mathrsfs}
\usepackage{verbatim} % math stuff % more math stuff
\usepackage{graphicx} % including figures
\usepackage[lofdepth]{subfig} % subfigures
\usepackage[left=1.0in,right=1.0in,%
top=1.0in,bottom=1.0in]{geometry} % margin control
\usepackage[toc,page]{appendix} % appendix stuff
\usepackage{times} % Times New Roman font
\usepackage{color} % colored text
\usepackage{float}
\usepackage[square, numbers]{natbib} % nicer citing
\usepackage{indentfirst} % indents first paragraph of every section
\usepackage{setspace} % manual line spacing control
\usepackage{fancyhdr} % these 5 lines are for header/footer:
\fancypagestyle{plain}{
\fancyhead[R]{\thepage}\fancyhead[L]{}\fancyfoot[C]{}
\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}
\setlength{\headheight}{15pt}
\usepackage{titlesec} % these 4 lines are for formatting chapter titles:
\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries\centering}
{\vspace{8ex}\chaptertitlename\ \thechapter}{20pt}{\Huge}
\renewcommand{\headrulewidth}{0pt}}
\pagestyle{plain}
\setlength{\headheight}{15pt}
\usepackage{titlesec} % these 4 lines are for formatting chapter titles:
\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries\centering}
{\vspace{8ex}\chaptertitlename\ \thechapter}{20pt}{\Huge}
\hypersetup{
colorlinks=true, % make the links colored
linkcolor=blue, % color TOC links in blue
linktoc=all % 'all' will create links for everything in the TOC
}
After some more stuff, I start my document, which minimally looks like this:
\begin{document}
\renewcommand{\contentsname}{Table of Contents}
\tableofcontents
\mainmatter
\include{mainmatter/chapter1/chapter1}
\include{mainmatter/chapter2/chapter2}
\backmatter
\include{backmatter/bibliography}
\end{document}
The mainmatter sections are where the problem arises; all equation labels are colored blue, and references (e.g. "[21]") are colored green. Nowhere did I even specify green to be a color, and in the hyppersetup
fragment above I specified to create links only for the toc, and not for labels/references within the document.
I didn't include specific matter I had in the main sections because I didn't think it was relevant. Please let me know if I should add any should it help.