1

I have problem using the package hyperref. When I compile my tex using dvi-ps and ps-pdf, the link is created but nothing happened when I click on the link. However, it works when I use pdflatex. I have tried to define the driver dvips but it is still not working.

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[]{hyperref}
\begin{document}
\frontmatter
\tableofcontents
\clearpage
\addcontentsline{toc}{chapter}{Foreword}

\Blindtext
\clearpage

\addcontentsline{toc}{chapter}{Dummy entry}
{\huge {\bf Dummy entry}}

\mainmatter
\chapter{First Chapter}
\end{document}
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. You might also want to add to your question how you're including the pdfs etc. – Aradnix Aug 29 '14 at 1:38
  • Hi, thanks for the reply. \begin{document} \frontmatter \tableofcontents \clearpage \addcontentsline{toc}{chapter}{Foreword} {\huge {\bf Foreword}} \Blindtext \clearpage \addcontentsline{toc}{chapter}{Dummy entry} {\huge {\bf Dummy entry}} \mainmatter \chapter{First Chapter} \end{document} How I include the pdfs? I am not too sure about this. What I did is just compile the tex file using Latex, then dvi-ps, ps-pdf. The link is not giving me any response. However, PDFLATEX works well. – Raymond Aug 29 '14 at 1:58
  • Ehm... instead of write a comment, edit your own question and add it, check the link above if you don`t know how. But basically if you type 4 spaces before the texts, this looks like code. -_\ – Aradnix Aug 29 '14 at 2:03
  • thanks for the advice. Do you have any idea why does this happen? – Raymond Aug 29 '14 at 2:07
  • No, but why do you use dvi-ps and ps-pdf for compile and not directly pdflatex for get the pdf? Is there any good reason for that? And you forget the preamble on your MWE, you must start with \documentaclass{...} if not it's impossible to know what are you doing. – Aradnix Aug 29 '14 at 2:13
2

You can use eps files together with pdflatex. In a modern texsystem you only need to load \usepackage{epstopdf}. Or convert your eps to pdf before the compilation.

Beside this: your example doesn't work with pdflatex either as your \addcontentsline commands have no sensible anchor. Use \phantomsection:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage[]{hyperref}
\begin{document}
\frontmatter
\tableofcontents
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{Foreword}

\Blindtext
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{Dummy entry}
{\huge {\bf Dummy entry}}

\mainmatter
\chapter{First Chapter}
\end{document}

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.