Latex Bibliography Misc Url Address

Hello fellows,

today I would like to share some insights on URLs in a bibtex file and how to do a line brake for long URLs so they fit on the page.

Ok, a quick word why that is interesting:

I am currently writing my Master’s Thesis and had some troubles with my bibliography, here a screenshot so you can see what I mean:

long URLs do not properly wrap at line end

Here is what I did to get this:

\usepackage{url} \usepackage{breakurl} \usepackage[breaklinks]{hyperref}

and this is the bibtex entry:

@misc{GartnerNFC, author = "Clark, Sarah", howpublished = "nfcworld.com", month = aug, note = "Cited July 3rd 2012", title = "{Gartner’s Hype Cycle places NFC at ‘Peak of Inflated Expectations’}", url = "http://www.nfcworld.com/2011/08/11/39008/gartner-hype-cycle-places-nfc-at-peak-of-inflated-expectations", year = "2011" }

So, as you can see in the screenshot above, the URL does not get broken. So how to fix that?

After reading this entries (https://groups.google.com/group/comp.text.tex/browse_thread/thread/b2ff42fe61a0ee3a), I checked the following file and found the characters where URLs are allowed to be wrapped to a new line (search for “\UrlBreaks”): http://www.tex.ac.uk/tex-archive/support/ltx2x/url.sty

Since in my case there are a lot of “-” in the URL, I want latex to use them too to break lines. That can be done with this command, right below of “\usepackage{url}” (so actually I add “/” and “-“):

\def\UrlBreaks{\do\/\do-}

Here is how the result looks like:

URLs now get wrapped at line end

I hope this helps you.

Cheers
norbert

Like this:

LikeLoading...

Related

This entry was posted in Latex, Master Thesis and tagged bibliograhy, Bibtex, break url, howto, LaTeX, long url, url in bibliography, url.sty. Bookmark the permalink.

BibTeX: How to cite a website

With the increasing importance of the internet for scientific research, need increases for properly citing online resources. Unfortunately, when the main LaTeX citation machinery BibTeX was created, this was not to be foreseen; this is why there is to date no canonical way to cite, say, a website. Different workarounds have emerged, using for example some trickery with the type (see below), but the right way™ hasn't been found yet.

This could change with the advent of biblatex. Its new entry type is supposed to contain references to web resources and doesn't give room for confusion anymore.

With the BibTeX entry


and the LaTeX file

one gets a nicely typeset list of references.


Note that there are plenty of more options and entry types in the biblatex package, such as (the currently unused) and .

Because of its supposedly large impact on the (La)TeX community, the author of biblatex still declares the package as 'beta' which is why it is not included in TeXlive, for example. Should you for this or some other reason be unable to install biblatex, there are (inferior) alternatives to use for URL citations in a reference list.

Alternatives

Using the natbib package

The natbib package extends the functionality of regular bibtex to a certain degree, and allows for website citations as well. There is no specific entry type for online resources, but , , and work quite well.


Note that standard bibstyles (such as ) will not typeset the key contents of the individual entries; it is required to use one of natbib's own entries, e.g. .


Using the url package

The most elemental way to include web references is via the key of the entry. Use



and



Comments

Leave a Reply

Your email address will not be published. Required fields are marked *