1

I cannot get the URL address in a reference in my document to break. I looked at this question's chosen answer URLs in bibliography: LaTeX not breaking line as expected and it did not work for me.

The citation at "14" hangs over the right edge of left column boundary

MWE:

tex file

\documentclass[10pt,conference,letterpaper]{IEEEtran}
\usepackage[hyphens]{url}
\usepackage[hidelinks]{hyperref}
\hypersetup{breaklinks=true}
\urlstyle{same}
\usepackage{cite}
%\usepackage{parskip}
% commented for existing packages in cls
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{mathtools}
%\usepackage{amsthm}
\usepackage{graphicx}
% \usepackage[lined, boxed, commentsnumbered]{algorithm2e}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage[normalem]{ulem}
%\usepackage{enumitem}
%\usepackage{wrapfig}
%\usepackage{setspace}
\usepackage{subfigure}
\usepackage{makecell}
\usepackage{multirow}
\usepackage{comment}
\usepackage{url}
\usepackage{caption}

\Urlmuskip=0mu plus 21mu
\bibliographystyle{IEEEtran}

\bibliography{IEEEabrv,reference}

bib file entry not breaking

@Manual{nmonchart,
title={nmonchart},
author = "Griffiths, Nigel",
address={http://nmon.sourceforge.net/pmwiki.php?n=Site.Nmonchart},
}

I have to edit the link because of protocol

Screenshot of the paper currently

enter image description here

3
  • This? tex.stackexchange.com/questions/102673/…
    – Erwann
    Jul 28 '20 at 0:49
  • Off-topic: the subfigure is deprecated and conflicts with the caption package. Don't use subfigure; instead, employ either subfig or subcaption.
    – Mico
    Jul 28 '20 at 1:15
  • @Erwann - The OP's fundamental error is related to an improper field name for the URL string.
    – Mico
    Jul 28 '20 at 1:23
2

There's a mistake in your bib entry: The name of the field that contains the entry's URL address should be url, not address:

@Manual{nmonchart,
  title  = {nmonchart},
  author = "Griffiths, Nigel",
  url    = {http://nmon.sourceforge.net/pmwiki.php?n=Site.Nmonchart},
}

Second, load the xurl package rather than the url package to allow linebreaking in long URL strings anywhere.

enter image description here

\documentclass[10pt,conference,letterpaper]{IEEEtran}
%% (I simplified the preamble to make it truly minimal)

\begin{filecontents}[overwrite]{mybib.bib}
@Manual{nmonchart,
  title  = {nmonchart},
  author = "Griffiths, Nigel",
  url    = {http://nmon.sourceforge.net/pmwiki.php?n=Site.Nmonchart},
}
\end{filecontents}

\usepackage{cite}
\bibliographystyle{IEEEtran}

\usepackage{xurl} % not \usepackage{url}
\urlstyle{same}
\usepackage[hidelinks]{hyperref}
%\Urlmuskip=0mu plus 21mu % not needed when using 'xurl' package

\begin{document}
\nocite{*}
\bibliography{mybib}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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