Hi All,
I have having troubles with putting urls in a bibliography.
Some of the URLs contain tildes. Google has taught me that the way to deal with these is using package "url" and the command "\url{<the url>}" in the bibliography entries. However when I do this, the entries in the generated bibliography are surrounded in "\url{ ... } (but those in text are not). For example, the tex:
%--------------------start main.tex file--------------------
\documentclass{thesis}
\usepackage{url}
\usepackage{natbib}
\bibliographystyle{plainnat}
\pagestyle{headings}
\title{\textsf{Some Topic}}
\begin{document}
\maketitle
\citet{wastfelt} did stuff and you can find out about it at
\url{http://www.informaworld.com/smpp/conten ... a912337953}.
\bibliography{short}
\end{document}
%--------------------end tex input--------------------
with short.bib:
%--------------------start short.bib--------------------
@article{wastfelt,
title = {{Land use qualities identified in remotely-sensed images}},
author = {Wastfelt, A.},
journal = {International Journal of Remote Sensing},
year = {2009},
volume = {30},
number = {9},
pages = {2411--2427},
url = {\url{http://www.informaworld.com/smpp/conten ... a912337953}}
}
%--------------------end short.bib--------------------
Gives me a document with body (as expected):
Wastfelt [2009] did stuff and you can find out about it at http://www.
informaworld.com/smpp/content~db=all~content=a912337953.
and a bibliography entry (not as expected - "\url{ ...}" still present)
A. Wastfelt. Land use qualities identied in remotely-sensed images. Interna-
tional Journal of Remote Sensing, 30(9):2411-2427, 2009. URL \url{http:
//www.informaworld.com/smpp/content~db=al ... a912337953}.
Can anyone tell me what I am doing wrong?
Regards,
Simon
platform: windows/vista,
commands:
latex main
bibtex main
latex main
pdflatex main
using:
MiKTeX version 2.7
BibTeX version 0.99c
pdfTeX version 3.1415926-1.40.9 (... why is pi in there?)
P.S. This is my first post so any comments on style/standard info/... welcome and appreciated.
BibTeX, biblatex and biber ⇒ Problem with package url
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Problem with package url
Packages such as natbib automatically add the \url{...} part to the BibTeX URL field. You just want:
Code: Select all
@article{wastfelt,
title = {{Land use qualities identified in remotely-sensed images}},
author = {Wastfelt, A.},
journal = {International Journal of Remote Sensing},
year = {2009},
volume = {30},
number = {9},
pages = {2411--2427},
url = {http://www.informaworld.com/smpp/content~db=all~content=a912337953}
}
Joseph Wright
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Problem with package url
For code it is best to use the code environment. It keeps a post clear and legible. For other guidelines see the Board Rules. You made a very good start by providing a complete example.newlatexuser wrote:[...] This is my first post so any comments on style/standard info/... welcome and appreciated.
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 2
- Joined: Wed Jan 20, 2010 3:54 am
Problem with package url
josephwright - Thanks for that... I had not tried simply adding and not surrounding the urls with (for the sake of the others - without the above \usepackage statement, the tildes were simply replaced with spaces).
localghost - Thanks for the tips.
Code: Select all
\usepackage{url}
Code: Select all
\url{...}
localghost - Thanks for the tips.