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 have tried several top answers with no luck. Here is what I have in my preamble(compiling with xelatex and bibtex).

\documentclass[a4paper,12pt]{article}
\usepackage{fontspec}
\usepackage{natbib}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{setspace}
\usepackage{url}

Here is a sample reference in Bibtex

@misc{DemandAccounting,
author={Henry Blodget},
title={Demand Media's Q3 revenue and pageview growth looks fine. But the company continues to capitalize its content costs,...},
month={November},
year={2011},
url={http://www.businessinsider.com/demand-medias-q3-revenue-and-pageview-growth-looks-fine-but-the-company-continues-to-capitalize-its-content-costs-2011-11},
publisher={Business Insider},
note={[10/11/2011]}
}

Here is the output

Even pointing out which solution is right for me and closing this questions down would hugely helpful. Thank you

share|improve this question

1 Answer 1

up vote 9 down vote accepted

The package url is set up so that, by default, URLs are not broken at hyphens. With the option hyphens they will:

\usepackage[hyphens]{url}

If you want this only in selected parts of your document, you can define

\makeatletter
\newcommand\URLhyphenOn{\def\do@url@hyp{\do\-}}
\newcommand\URLhyphenOff{\def\do@url@hyp{}}
\makeatother

in your preamble. Then loading \usepackage{url} will have break at hyphens inhibited, but from a \URLhyphenOn declaration onwards, the URL will be possibly broken at hyphens, until the group or environment in which the declaration is issued ends or a \URLhyphenOff declaration appears.

share|improve this answer

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.