# PDFLaTeX: Straight quotes in URLs (no smartquotes in urls)

Is it somehow possible to have straight quotes in URL's? Especially the single quote sign would be important to me, as this is the most confusing character within URL's, as the reader might not know which character on his keyboard that is.

It would be great if someone could point me out how to use straight quotes in URL's only (in my text I want to have the curly quotation marks).

My only idea would be the following: Use upquote package and set the url in a verbatim environment, but then biber throws out lots of error messages.

It is important that the solution works for \url commands in the .bib file!

Note: I don't want to set that stuff manually as part of the \url command, as the \url command automatically translates URL's to URI's for me, and therefore I don't have control over single characters being set!

EDIT:

Okay I am going to add an example:

@online{wiki3,
author = {Wikipedia},
title = {Prélude à l’après-midi d’un faune},
url = {http://en.wikipedia.org/wiki/Prélude_à_l'après-midi_d'un_faune},
note = "[Last accessed: May,12 2013]"
}


This is an example in my .bib file. It is printed like this:

Note the ’ character instead of the correct one (') in the URL.

Now I want the single quotes to be straight, in the output pdf file they aren't.

• It might be a lot more useful if you added some examples as to what you are refering to. Do you have quotes in the URLs, around it .... – daleif Aug 5 '13 at 10:24
• Is it biber that makes the %xx conversion? In which case it ought to also reencode the single quotes, simply because thye can be wrong when copied from PDF. – daleif Aug 5 '13 at 11:26
• What \url command in the .bib file? Are you not rather referring to the url field? – jubobs Aug 5 '13 at 11:33
• Please 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}. – jubobs Aug 5 '13 at 11:37
• @GEO I took the liberty of modifying the question by adding an explanatory image. Hope you don't mind. – karlkoeller Aug 5 '13 at 14:23

The correct URL is:

http://en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l%27apr%C3%A8s-midi_d%27un_faune

biber tries to correct the bad URLs. But it can't encode the single quote because it's a reserved character (see RFC. 3986).

Extract: URIs that differ in the replacement of a reserved character with its corresponding percent-encoded octet are not equivalent.

First Edit: To find a correct URL, use your favorite web browser and copy the URL from its address bar. There is no automatic way to find a correct URL.

Second Edit: With the following document, the first URLs is displayed with smart quotes but the actual link uses original straight quotes (open the PDF with your editor to verify the actual link). With some PDF viewers, this first link does not work.

\documentclass{article}
\pdfcompresslevel=0
\pdfobjcompresslevel=0
\usepackage{url}
\usepackage{hyperref}
\begin{document}
\scriptsize

\url{http://en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l'apr%C3%A8s-midi_d'un_faune}

\url{http://en.wikipedia.org/wiki/Pr%C3%A9lude_%C3%A0_l%27apr%C3%A8s-midi_d%27un_faune}
\end{document}

• Okay two questions: 1.) How two find out the correct URL in an automated way? 2.) Is there no LaTeX way of solving this problem? Is it not possible to write a function that replaces that character in URLs? Apart from that: Even if the generated URL is not entirely correct, it works. The issue would not be getting rid of the single quote, but forcing the use of a straight quote instead. – GEO Aug 6 '13 at 8:52
• @GEO: 1.) Pages of Wikipedia have a left sidebar with Cite this page below Toolbox. This shows a "permanent link" with a correctly quoted URL. 2.) It could be done in (La)TeX, if the encoding would be known. There is a recommendation for UTF-8, but it is only a recommendation. Also domain names are encoded differently (Punycode). Thus a parser for URIs is needed as well. – Heiko Oberdiek Aug 7 '13 at 7:29