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

Mico
  • 506,678
Jinzu
  • 113
  • This? https://tex.stackexchange.com/questions/102673/manually-url-linebreak-with-biblatex/102697#102697 – Erwann Jul 28 '20 at 00: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 01:15
  • @Erwann - The OP's fundamental error is related to an improper field name for the URL string. – Mico Jul 28 '20 at 01:23

1 Answers1

3

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}

Mico
  • 506,678