LyXURLs in BibTeX do not break

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
bettinathenomad
Posts: 13
Joined: Tue May 24, 2011 3:41 pm

URLs in BibTeX do not break

Post by bettinathenomad »

Hi everyone, I have a problem with a BibTeX-entry when compiling my LyX document. Even though I've tried both \usepackage{url} and \usepackage{breakurl}, the URL refuses to break.

This is the BibTeX entry:

Code: Select all

@book{RefWorks:351,
	author={Jean Grugel},
	year={2002},
	title={Working Paper 9/2002: Spain, the European Union and Latin America: Governance and Identity in the Making of 'New' Inter-Regionalism},
	publisher={Real Instituto Elcano},
	address={Madrid},
url={http://www.realinstitutoelcano.org/wps/portal/rielcano\_eng/Content?WCM\_GLOBAL\_CONTEXT=/elcano/elcano\_in/zonas\_in/dt9-2002}
}
and this is the entire LaTeX preamble:

Code: Select all

\documentclass[oneside,british]{book}
\usepackage{mathpazo}
\usepackage{helvet}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{array}
\usepackage{graphicx}
\usepackage[authoryear]{natbib}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{url}
\usepackage{breakurl}

\makeatother

\usepackage{babel}
\begin{document}
What in the world is going on?
Thank you for your help - if you need anything else please do let me know :)
Last edited by bettinathenomad on Tue Aug 16, 2011 8:02 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

bettinathenomad
Posts: 13
Joined: Tue May 24, 2011 3:41 pm

URLs in BibTeX do not break

Post by bettinathenomad »

Never mind. Here's the solution: The URL in the bibtex-entry should look like this:

Code: Select all

url={\url{http://www.blabla.com/}}
Then it breaks just fine.
Jean
Posts: 3
Joined: Wed Sep 07, 2011 2:30 am

URLs in BibTeX do not break

Post by Jean »

bettinathenomad wrote:Never mind. Here's the solution: The URL in the bibtex-entry should look like this:

Code: Select all

url={\url{http://www.blabla.com/}}
Then it breaks just fine.
I have the same problem but this does not work for me... Any other suggestions?
bettinathenomad
Posts: 13
Joined: Tue May 24, 2011 3:41 pm

URLs in BibTeX do not break

Post by bettinathenomad »

Hi Jean, sorry for replying so late! Have you tried changing the bibliography style? that sometimes helps.
Also, I've discovered that it is helpful to use the [hyphens] option of the URL package. Then it separates URLs also at hyphens, which it does not do naturally. So in the LaTeX preamble you have to put

Code: Select all

\usepackage[hyphens]{url}
It did the trick for me. Good luck!
Post Reply