Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using pdflatex.

The following creates a live link the the first URL ("mousse" with no French accent). When I click on it in the PDF, I am brought to that page. The second URL (containing two acute French accents) looks right in the PDF but the link is dead.

When I use latex and dvipdfm, two live links are created but they do not bring me to the proper place.

How can I get live URLs in my PDF, when the URLs contain European accented characters?

\documentclass[11pt]{article}
\usepackage{url}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\begin{document}

This creates a live link in the PDF:

\url{http://www.larousse.fr/dictionnaires/francais-anglais/mousse/52833}

The following looks all right in the PDF but is a dead link:

\url{http://www.larousse.fr/dictionnaires/francais-anglais/écrémer/27576?q=écrémé}
\end{document}
share|improve this question
    
The start of my log file says: This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/Fink) –  Jacob Wegelin Sep 11 '13 at 0:49
add comment

2 Answers

The URL should be percent encoded:

\href{http://www.larousse.fr/dictionnaires/francais-anglais/%C3%A9cr%C3%A9mer/27576?q=%C3%A9cr%C3%A9m%C3%A9}{%
  \nolinkurl{http://www.larousse.fr/dictionnaires/francais-anglais/écrémer/27576?q=écrémé}}

Copying and pasting the URL from the location bar of the browser (firefox, ...) usually gets the percent encoded version of the URL.

share|improve this answer
    
Copying the URL from Firefox 23.0.1 on a Mac 10.6.8 got the percent-encoded URL. Copying the URL from Safari 10.6.8 on the same Mac did not get the percent encoding. This answered my question. –  Jacob Wegelin Sep 11 '13 at 2:02
    
@JacobWegelin Since you this answers your question, please consider marking it as ‘Accepted’ by clicking on the tickmark below the vote count (see How do you accept an answer?). This assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Adam Liter Sep 11 '13 at 3:50
add comment

You can also use \url{} and escape the percentage symbols with a backslash. Maybe not as clean as the other answer but I couldn't make it work as explained so I used this approach and it worked.

As an example, for the url http://es.wikipedia.org/wiki/Problema_de_satisfacci%C3%B3n_de_restricciones, the code would be this:

\url{http://es.wikipedia.org/wiki/Problema_de_satisfacci\%C3\%B3n_de_restricciones}
share|improve this answer
1  
Why would you escape the percentage symbols? The result would print with the backslashes, which doesn't yield the correct web address anymore. –  Werner Apr 22 at 19:29
1  
@Werner: It's a feature of hyperref. Otherwise it would be a little difficult to specify the percent character (comment character in TeX) in URLs, if \url or \href are used inside \footnote{...} or other commands. –  Heiko Oberdiek Apr 22 at 19:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.