LaTeX forum ⇒ GeneralLong URL not wrapping

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

Long URL not wrapping

Postby lloowen » Tue Feb 05, 2013 3:29 am


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:
  1. \usepackage[hyphens]{url}

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

This does not work:
  1. \expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks\do\a%
  2. \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%
  3. \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:

  1. \usepackage{hyperref}
  2. \hypersetup{breaklinks=true}
  3. \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.
Thanks in advance.
Last edited by localghost on Tue Feb 12, 2013 6:03 pm, edited 2 times in total.
Reason: code marked


Posts: 660
Joined: Tue Mar 25, 2008 5:02 pm

Postby kaiserkarl13 » Tue Feb 12, 2013 4:08 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{}, i.e. that they're surrounded by a \url command. You probably already did that, but just to be sure.

Return to “General”

Who is online

Users browsing this forum: No registered users and 8 guests