Based on a code by Alex Chan and help from Jinwen
here, I made a custom underlining command with nice results: as you can see on the pictures (here and in Jinwen's post edited by me), the underline never overlaps the characters. This is because the letters have a contour around them, acting as a shell.
The problem is that the command just disallows line breaks, which is quite an issue.
Any idea how we could add support for line breaks?
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\usepackage{hyperref}
\usepackage{contour}
\usepackage{fp}
\usepackage[normalem]{ulem}
\begin{filecontents}[overwrite]{\jobname.bib}
@misc{lakoff,
author = {Lakoff, George},
title = {Counterparts or the Problem of Reference in Transformational Grammar},
year = {1968},
url = {https://georgelakoff.files.wordpress.com/2011/01/counterparts-or-the-problem-of-reference-in-transformational-grammar-lakoff-1968.pdf}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\makeatletter
\NewDocumentCommand{\clevulaux}{mmmmm}
{%
\FPmul\cleverul@temp{\f@size}{0.#1}% This is \f@size * 0.15
\setlength{\ULdepth}{\cleverul@temp pt}%
\FPdiv\cleverul@temp{\f@size}{#2}% This is \f@size / 15
\renewcommand{\ULthickness}{\cleverul@temp pt}%
\contourlength{#3pt}%
\uline{\phantom{#5}}%
\llap{\contour{#4}{#5}}%
}%
\makeatother
\ExplSyntaxOn
\cs_set_eq:NN \coolclevul:nnnnn \clevulaux
\cs_generate_variant:Nn \coolclevul:nnnnn { VVVV }
\NewDocumentCommand{\coolclevul}{O{}m}{
\group_begin:
\keys_set:nn{coolclev}{#1}
\coolclevul:VVVVn
\coolclevul_space
\coolclevul_thinness
\coolclevul_boldness
\coolclevul_color
{#2}
\group_end:
}
\keys_define:nn {coolclev}
{
space.tl_set:N = \coolclevul_space,
thinness.tl_set:N = \coolclevul_thinness,
boldness.tl_set:N = \coolclevul_boldness,
color.tl_set:N = \coolclevul_color,
space.initial:n = 15,
thinness.initial:n = 12,
boldness.initial:n = 0.8,
color.initial:n = white,
}
\ExplSyntaxOff
\urlstyle{same}
\DeclareFieldFormat{url}{\coolclevul[space=18,thinness=14]{\url{#1}}} % The command \coolclevul prevents hyphenation.
\begin{document}
\nocite{*}
\printbibliography
\end{document}