## LaTeX forum ⇒ General ⇒ Long URL not wrapping

LaTeX specific issues not fitting into one of the other forums of this category.
lloowen
Posts: 1
Joined: Tue Feb 05, 2013 2:54 am

### Long URL not wrapping

Hello

My long URLs are not wrapping in the reference section of my LyX document. I'm not using a .bib file to store my references. I'm using the inline method, well I think that is what it is called.

I've seen several posts regarding this issue, unfortunately the solutions offered did not work for me

This is driving me mad! Have spent ALL day trying to figure this out.

For some reason this does not work for me:
`\usepackage[hyphens]{url}`

I get the following error:
`The package url has already been loaded with options:   []There has now been an attempt to load it with options   [hyphens]Adding the global options:   ,hyphensto your \documentclass declaration may fix this.Try typing  <return>  to proceed.`

This does not work:
`\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks\do\a%\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m\do\n%\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z\do\&}`

These did not work:

`\usepackage{hyperref}\hypersetup{breaklinks=true}\usepackage[hyphenbreaks]{breakurl}`

I've tried several combinations of the settings shown above to no avail.

Is there any way I can edit the latex code from LyX? Maybe using \\ to break the long urls, might do the trick. I now it's not the way to go but I don't know what else to do.

Or better still, can anyone recommend a template using the article document class that I could use in LyX that has the urls wrapping issue fixed!?

I'd be grateful for any help.
Last edited by localghost on Tue Feb 12, 2013 6:03 pm, edited 2 times in total.
Reason: code marked

Tags:

kaiserkarl13
Posts: 660
Joined: Tue Mar 25, 2008 5:02 pm
The problem exists because you're trying to load the url package with a specific option, but it's being loaded by one of your packages before that with a different set of options. Try loading the url package earlier than the package that requires it. If it's loaded by the document class, try using `\RequirePackage[hyphens]{url}` before the document class.

Also, make sure that your URL's are actually included as `\url{http://my.site.ext}`, i.e. that they're surrounded by a `\url` command. You probably already did that, but just to be sure.