2

This question already has an answer here:

As can be seen below, I am trying to figure out how to remove big spaces in the BibTeX based bibliography when URLs are used. I have already checked similar questions on tex.stackexchange but to no avail.

The below example also shows that this issue is evidently caused by the associated URL.

Can anyone provide me with an easy fix for this problem?

Minimal working example:

Document:

\documentclass[11pt,a4paper]{article}
\usepackage{a4wide}
\usepackage[breaklinks]{hyperref}

\begin{document}
\pagenumbering{arabic}
\setcounter{page}{1}

\cite{McL10a}
\cite{McL10b}

\bibliography{references}
\bibliographystyle{alphadin}
\end{document}

.BibTeX-File:

% Encoding: UTF-8

@Electronic{McL10a,
  author    = {G. Harry McLaughlin},
  year      = {2010},
  title     = {SMOG - Simple Measure of Gobbledygook},
  url       = {https://web.archive.org/web/20100415194430/http://webpages.charter.net/ghal/SMOG.htm},
  timestamp = {2010-04-15},
}

@Electronic{McL10b,
  author    = {G. Harry McLaughlin},
  year      = {2010},
  title     = {SMOG - Simple Measure of Gobbledygook},
  timestamp = {2010-04-15},
}

@Comment{jabref-meta: databaseType:bibtex;}

Output:

Edit1: @davidpurton - Using \Urlmuskip=0mu plus 4mu fixed the spaces in the title, but created new spaces in the url itself.

enter image description here

marked as duplicate by Johannes_B, Andrew Swann, CarLaTeX, Stefan Pinnow, Schweinebacke Apr 23 '17 at 11:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome! Have you looked at the manual for the url package? If not, I'd recommend starting there. Also, is this really engine-specific i.e. only occurs when you compile with pdfTeX? – cfr Mar 24 '17 at 0:05
  • I am currently using TeXworks on Windows, which allows me to use pdfLatex, LuaLatex and XeLatex. Tested all three but the issue still remains. – Korred Mar 24 '17 at 0:10
  • 1
    Sorry about the wrong tag! – Korred Mar 24 '17 at 0:19
  • No problem. I just wanted to clarify things so that the tag didn't confuse people looking at your question. – cfr Mar 24 '17 at 0:26
  • 1
    Perhaps this post will help: tex.stackexchange.com/questions/115690/… – David Purton Mar 24 '17 at 1:19
1

I found a working solution here: Forcing linebreaks in \url

Adding the following line prior adding the hyperref package fixed the issue for me:

\PassOptionsToPackage{hyphens}{url}

Not the answer you're looking for? Browse other questions tagged or ask your own question.