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 want to refer an url which contains % symbols, using BibTex.

If I just write %, the rest of the line becomes a comment. If I write \%, then the slash also appears.

    @MISC{ref,
      title="title",
      note="\url{http://www.abc.com/a%20b\%20c}"
    }

Help? Is there any macro for "%"?

share|improve this question

migrated from stackoverflow.com May 4 '11 at 14:15

This question came from our site for professional and enthusiast programmers.

    
@Sergio --- the percent symbol (without the backslash) works fine for me. Please add a minimal example of your LaTeX code that reproduces the problem. –  Ian Thompson May 4 '11 at 15:50
    
I think it is only an editor error (to show %20b%20c to be a comment - it is not). Your editor can not recognize that the comment sign is inside the macro url. Macro url works fine and you get the url http://www.abc.com/a%20b\%20c displayed in your bibliography. –  Kurt Sep 2 '12 at 22:56

3 Answers 3

Why don't you create any minimal example? The following works fine

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@MISC{ref,
      title="title",
      note="\url{http://www.abc.com/a%20b\%20c}"
    }
\end{filecontents}
\documentclass{article}
\usepackage{url}

\begin{document}
\cite{ref}
\bibliography{\jobname}
\bibliographystyle{plain}
\end{document}
share|improve this answer

"%20" is a space character. You can just use \url{http://www.abc.com/a b c and when the user clicks the URL they will be taken to a%20b%20c.

share|improve this answer
1  
Yeah, that's right, but the problem is that when inside a url, the spaces are not shown. I solved it by doing \url{abc.com/a} \url{b} \url{c} –  Sérgio May 4 '11 at 15:13

Have you tried http://www.abc.com/a\% 20b\% 20c?

share|improve this answer
    
still the same, it ignores the spaces and adds the slashes. Result: abc.com/a\%20b\%20c? –  Sérgio May 4 '11 at 12:05

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.