Generalhyperref problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
bostjanv
Posts: 10
Joined: Sun Sep 20, 2009 10:44 am

hyperref problem

Post by bostjanv »

Hello,
Question 1: I processed the following file with pdflatex:

Code: Select all

%%-*-coding: utf-8-*-
\documentclass[11pt,a4paper,final]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{latexsym}
\usepackage{emlines2,subfigure,longtable,floatflt,color,graphicx}
\usepackage{hyperref}
\pagenumbering{arabic}
%\hypersetup{colorlinks=true}
%\hypersetup{unicode=true}
\begin{document}

\href{http://orgmode.org/org.html}{manual for \emph{Org mode} on \emph{Emacs}}
\end{document}
I found that using Acrobat Reader the hyperlink is accessed OK, but with gsview I get the message "Unknown target for link". Does anybody know how to fix this?
Question 2: How can I specify hyperlink boxes that do not use colored borders but rather background color?
Regards,
bostjanv
Last edited by Stefan Kottwitz on Sun Sep 20, 2009 4:43 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: hyperref problem

Post by josephwright »

Not sure how you are viewing a PDF with gsview! On the second issue, I always use "colorlinks,linkcolor=black,urlcolor=black" when loading hyperref.
Joseph Wright
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

hyperref problem

Post by Stefan Kottwitz »

Hi bostjanv,

that's very good example code above, because it's compilable for testing. I've made a small workaround to use a colored background instead of colored borders, just insert in your preamble

Code: Select all

\hypersetup{colorlinks=false,pdfborder={0 0 0}}
\let\stdhref\href
\renewcommand\href[2]{\stdhref{#1}{\colorbox{yellow}{#2}}}
It's redefining \href in order to use \colorbox, here just with yellow. I recommend to use xcolor instead of color, it provides more features like a lot of named colors.

Btw. the forum provides a code environment for posting LaTeX code, I've just edited your post above to use it.

Best regards,

Stefan
LaTeX.org admin
bostjanv
Posts: 10
Joined: Sun Sep 20, 2009 10:44 am

Re: hyperref problem

Post by bostjanv »

Hello,
Thanks for the complete answer to my Question 2.

Regarding Question 1 a previous post questioned whether gsview can be used to view pdf files. The manual clearly states that it can. There is one definite advantage to using gsview over Acrobat Reader (on Windows): gsview permits writing to a file that is being viewed while Acrobat Reader does not (at least I haven't been able to discover how). Therefore when one is writing a text using pdflatex the edit -> pdflatex -> view cycle is more convenient with gsview since the reader does not have to be closed and restarted on every view. If somebody knows how to write to a file with Acrobat Reader viewing it, I would appreciate to know.
Regards,
bostjanv
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

hyperref problem

Post by Stefan Kottwitz »

Some editors are able to close and reopen the Acrobat Reader by DDE commands as a workaround for that problem.
But there are other pdf viewers you could use, for instance the Sumatra PDF Viewer. Sumatra PDF is fast, portable and works with SyncTeX, providing forward and inverse search.

Stefan
LaTeX.org admin
bostjanv
Posts: 10
Joined: Sun Sep 20, 2009 10:44 am

Re: hyperref problem

Post by bostjanv »

Thanks, I'll remember that. Regards, bostjanv
Post Reply