So I had a seemingly typical problem: I wanted to put URLs in my references, which were quite long. Let me provide you an MWE:
% citations.bib
@incollection{levi1973where,
author={Levi, J. N.},
year={1973},
title={{Where do all those other adjectives come from?}},
booktitle={{Papers from the 9th regional meeting of the Chicago Linguistic Society}},
editor={Claudia Corum and T. Cedric Smith-Stark and Ann Weiser},
number={1},
pages={332--345},
url = {https://www.ingentaconnect.com/contentone/cls/pcls/1973/00000009/00000001/art00030}
}
@inproceedings{levy2006speakers,
author = {Levy, Roger and Jaeger, T. Florian},
title = {{Speakers optimize information density through syntactic reduction}},
year = {2006},
editor = {B. Schölkopf and J. C. Platt and T. Hoffman},
publisher = {MIT Press},
address = {Cambridge, MA},
booktitle = {{Proceedings of the 19th International Conference on Neural Information Processing Systems}},
pages = {849--856},
numpages = {8},
location = {Canada},
series = {NIPS'06},
url = {https://proceedings.neurips.cc/paper/2006/hash/c6a01432c8138d46ba39957a8250e027-Abstract.html}
}
% mwe.tex
\documentclass[a4paper, man]{apa6}
\usepackage{apacite}
% \usepackage{url} % to be added for image 2
\title{Example}
\shorttitle{Example}
\begin{document}
\section{Introduction}
I will cite \cite{levi1973where,levy2006speakers}.
% \urlstyle{rm} % to be added for image 3
\bibliographystyle{apacite}
\bibliography{citations}
\end{document}
This gave me ugly references with too-long links (which are not the problem I'm trying to address), and a strange lineskip between the end of the first reference and the beginning of the second one. I want to emphasize it here: this version has two problems. Not only is the link presented weirdly, but there is also an empty line between the first reference and the second one.
Then I found this question suggesting that I add url or hyperref. Somehow, with hyperref I got lots of new errors, but url helped solve both problems:
Now, I wanted to change the font into a "normal" font, so I found this question suggesting me to add \urlstyle{rm} right before the line with \bibliographystyle. The problem is... this brings back that strange line between the two references:
My intention is to find a way to eliminate that empty line (that "gap" between the first reference and the second reference).
People here suggested me to add black-magic-like lines such as \def\UrlBreaks{\do\/\do-} or \Urlmuskip=0mu plus 1mu\relax, but the output I get is exactly the same.
Now I just want to remove that empty line between the references. To make it clear, I am adding one final image indicating more or less what I am trying to achieve:




xurlpackage instead of theurlpackage? – Mico Feb 20 '23 at 20:44/in URL but not within path components, so the output you show looks quite expectedwww.ingentaconnect.comwould not fit on the line so it breaks at//– David Carlisle Feb 20 '23 at 20:45//. My problem is the space between the link and the second reference. There is that extra empty line there that is being inserted for no reason. In my real document, there are lots of references, and this is the only case in which I get that "gap" between two references. – vaulttech Feb 20 '23 at 23:41