Latex: Url on two lines
I'm using the following environment on overleaf:
\documentclass[%
reprint,
superscriptaddress,
nofootinbib,
nobibnotes,
amsmath,amssymb,
aps,
]{revtex4-2}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage[caption=false]{subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{commath}
\usepackage{graphicx,bm}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{xr-hyper}
\usepackage{url}
\usepackage{xurl}
\usepackage{soul}
What I would like to do is to insert a URL to a page in a footnote:
\footnote{\url{https://github.com/author/long_long_long_long_long_long_url}
Unfortunately, the URL is too long to fit on a single line (two columns) and it gets automatically split over two lines: the first line gets a part of the URL while the second contains no ref. As a consequence, the URL does not point to the correct page.
Solution 1:
With the hyperref
package the link will direct to the correct site
\documentclass[%
reprint,
superscriptaddress,
nofootinbib,
nobibnotes,
amsmath,amssymb,
aps,
]{revtex4-2}
\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage[caption=false]{subfig}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{commath}
\usepackage{graphicx,bm}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{xr-hyper}
\usepackage{url}
\usepackage{xurl}
\usepackage{hyperref}
\usepackage{soul}
\begin{document}
test\footnote{\url{https://github.com/author/long_long_long_long_long_long_url}}
\end{document}