0

I am using a 2 columns IEEEtran template. I have some long URLs in the references section. One of the URLs exceeds the column's width and does not break properly. How can I force URLs to break into multiple lines if the URL exceeds the column width?

Here is my main script:

\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage[noadjust]{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{hyperref}


\begin{document}
    \title{Title Here}  
    \maketitle
    \begin{abstract}
        Abstract here.
    \end{abstract}

    \section{Introduction}\label{sec:intro}
    Some text here \cite{test}.

\bibliographystyle{IEEEtran}
\bibliography{ref}

\end{document}

Here is the ref.bib script:

@misc{test,
    author = {Xing, Wang},
    title = {My Ref title},
    date = {2018},
    note = {Accessed Dec. 1, 208},
    url = { https://www.zzzzz.com/article/gggggg-aa-zzzzz-aaa-qqq-rrr-tttt-yyyy-8888-vvvvvv-qqqqqq-lllll-xxxxxx-oooooo-pppppp/},
    }
  • Load the url package, immediately before loading hyperref, with the options hyphens and spaces. – Mico Dec 30 '18 at 06:40
  • Have you tried it? I did exactly what you suggest. It gives me this error: Option clash for package url. \usepackage – user9371654 Dec 30 '18 at 06:50
  • @user9371654: Try \PassOptionsToPackage{hyphens,spaces}{url} and say \usepackage{url} only (without the options mentioned by Mico –  Dec 30 '18 at 08:38
  • 1
    @user9371654 - Did you notice the part of the instruction about loading url before hyperref? For sure, the only way I can manage to generate an "Option clash for package url" error message is if I load url after instead of before hyperref. – Mico Dec 30 '18 at 10:12
  • 1
    @ChristianHupfer - Your suggestion works too -- as long as url is loaded before hyperref. :-) If url is loaded after hyperref, there's no error message, but also no line-breaks of URL strings at hyphens... – Mico Dec 30 '18 at 10:13
  • 1
    @Mico: I was unsure whether other packages are involved also and try to load url as well with different options, leading to a clash eventually. I am not using links very often nor biber etc. as such I don't encounter such troublesome url problems –  Dec 30 '18 at 10:18
  • 1
    @ChristianHupfer - The hyperref package loads the url package automatically, but unfortunately without specifying the options spaces and hyphens, if it (the url package) hasn't been loaded already. That's why url must be loaded before hyperref if the options spaces and hyphens are meant to have an effect. – Mico Dec 30 '18 at 10:22
  • 1
    @Mico: I meant packages other than hyperref. But yes, I have too limited knowledge about url typesetting features, so \PassOptionsToPackage was a try... –  Dec 30 '18 at 10:26
  • @ChristianHupfer - It turns out that the query is a duplicate. – Mico Dec 30 '18 at 11:16
  • 1
    @Mico: After almost 10 years of TeX.SE? Which query is not a duplicate of something? ;-) –  Dec 30 '18 at 11:17

0 Answers0