Search code examples
urllatexbibtexbibliography

How to solve URL in bibliography overflowing the margin of the document in Latex?


I tried to include a website URL into the Latex bibliography. URL reference is too big and so that it overflows the document.

Following is the bibliography entry.

@misc{httpsloc53:online,
author = {},
title = {https://localwiki.org/oakland/A\%27s\_20\_Game\_Streak - Google Search},
howpublished = {\url{https://www.google.com/search?ei=BAuZX5yHA8DXz7sP_pq9wA4&q=https%3A%2F%2Flocalwiki.org%2Foakland%2FA%2527s_20_Game_Streak&oq=https%3A%2F%2Flocalwiki.org%2Foakland%2FA%2527s_20_Game_Streak&gs_lcp=CgZwc3ktYWIQA1CVnwpYlZ8KYPqjCmgAcAB4AIABwgGIAcIBkgEDMC4xmAEAoAECoAEBqgEHZ3dzLXdpesABAQ&sclient=psy-ab&ved=0ahUKEwicmdqC0NbsAhXA63MBHX5ND-gQ4dUDCA0&uact=5}},
month = {},
year = {},
note = {(Accessed on 08/04/2020)}
}

This is how it appears in the document. image

Is there any way to solve this?


Solution

  • An answer was given here by using the package \usepackage{breakurl} and define a possible breakline for the / or - symbols thanks to \def\UrlBreaks{\do\/\do-}

    The second point is that your url is quite long (you have 3 times https:://) and can be shortened