0

I'm using Hyperref in DVI>PS>PDF compile, but it doesn't work in TOC. I need help. Thanks for your comments.

\documentclass[12pt,twoside,letterpaper,spanish]{book}
%----------------------------------------------------------
%\usepackage[margin=2cm]{geometry}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{lmodern}
\usepackage{natbib}
%\usepackage{epstopdf}
\usepackage[table]{xcolor}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{mathabx}
\usepackage{pst-all}
\usepackage[dvips]{graphicx}
\usepackage{rotating}
\usepackage[font=small,labelsep=period]{caption}
\usepackage{colortbl,enumitem}
\usepackage{tabularx}
\usepackage{longtable,tabu}
\usepackage{setspace}
\usepackage{pbox}
\usepackage{multirow}
\usepackage{ragged2e}
\usepackage{fancyhdr}
\setlength{\textwidth}{15.59cm}
\pagestyle{fancy}
\usepackage{booktabs}
\usepackage{fancybox}
\usepackage{lipsum}
\usepackage{shadowtext} %Paquete Sombras
\usepackage{type1cm} % Paquete tamaño de fuente
\usepackage[colorinlistoftodos, textwidth=2cm, shadow,textsize=scriptsize]{todonotes}
\usepackage[skins,most,many,breakable]{tcolorbox}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\usepackage[letterpaper]{geometry}
\geometry{letterpaper,verbose,
tmargin=2.5cm,
bmargin=2cm,
lmargin=4cm,
rmargin=2cm
}
\usepackage[perpage,ragged]{footmisc}
\usepackage{perpage} %the perpage package
\MakePerPage{footnote} %the perpage package command
%----------------------------------------------------------------------------
\usepackage[titles]{tocloft}% http://ctan.org/pkg/tocloft
\renewcommand\cftchapaftersnum{.}% adds dot after chapter title in ToC
\renewcommand\cftchapdotsep{\cftdotsep}% adds leader dots from chapter titles to page numbers
\renewcommand{\cftsecaftersnum}{.}% adds dot after section title in ToC
%----------------------------------------------------------------------------
\usepackage{listings}
\lstset
{
    language={[LaTeX]TeX},
    basicstyle=\tt\color{black},
    literate=%
    {é}{{\'{e}}}1
    {á}{{\'{a}}}1
    {ó}{{\'{o}}}1
    {ú}{{\'{u}}}1
    {í}{{\'{i}}}1,
}
\usepackage{siunitx}
\sisetup{output-decimal-marker = {,}}
\sisetup{group-digits = integer}
\sisetup{group-minimum-digits = 4}
\sisetup{group-separator = {.}}
%----------------------------------------------------------------------------
\usepackage{varwidth}
\DeclareCaptionFormat{myformat}{%
    % #1: label (e.g. "Table 1")
    % #2: separator (e.g. ": ")
    % #3: caption text
    \begin{varwidth}{\linewidth}%
        \centering
        #1#2#3%
    \end{varwidth}%
}
%\usepackage{showframe}
%----------------------------------------------------------------------------
\usepackage[hyphens]{url}
\usepackage[dvips]{hyperref}
\hypersetup{
    colorlinks,
    linktoc=all,
    linktocpage=true,
    citecolor=blue,
    breaklinks=true,
    filecolor=blue,
    linkcolor=blue,
    urlcolor=blue
}
\usepackage[anythingbreaks]{breakurl}
%----------------------------------------------------------------------------
\definecolor{azulo}{RGB}{0,163,243}

enter image description here enter image description here

  • Hi welcome ... you've only included your preamble. could you please supply a minimal working example. – Tina Nov 14 '17 at 3:54
1

You are loading hyperref with options

linktoc=all,
linktocpage=true,

the second one says to put a link only in the page number listed in the TOC, and it overrides the former one which instructed to put a link also in the page number. I guess this is the problem here.


Well, I tested minimal document with the preamble you posted and as expected it produces links in the page numbers, which are coloured:

enter image description here

contrarily to the screenshot you posted.

There must be some other customization done (for example yours has Contenido, not Índice general).

| improve this answer | |

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.