From b99de5ca40706dc95a89e893532df2fafd73860a Mon Sep 17 00:00:00 2001
From: Simmo Saan <simmo.saan@gmail.com>
Date: Sat, 25 Jan 2025 13:14:40 +0200
Subject: [PATCH] Make \url underline compatible with older lua-ul

---
 unitartucs/thesis.cls | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/unitartucs/thesis.cls b/unitartucs/thesis.cls
index 265383d..e350fd1 100644
--- a/unitartucs/thesis.cls
+++ b/unitartucs/thesis.cls
@@ -254,10 +254,17 @@
     }
     \urlstyle{same} % Lingid sama fondiga nagu tekst
 
-    \usepackage{lua-ul}[2022-05-31] % lua-ul 0.2.0: Add keyval for \underLine
+    \usepackage[minimal]{lua-ul}
+    \usepackage{calc}
+    \newlength{\underLineDepth}
+    \setlength{\underLineDepth}{1pt+0.25ex}
+    \newunderlinetype\@underLine{%
+        \leaders\vrule height -0.25ex depth \underLineDepth % Close underline like in Word
+    }
+    \NewDocumentCommand\underLine{+m}{{\@underLine#1}}
     \DeclareUrlCommand{\url}{%
         \def\UrlFont{\color{colorURL}\normalfont}% Color with our URL color
-        \def\UrlLeft##1\UrlRight{\underLine[height=1pt, top=-0.25ex]{##1}}% Close underline like in Word
+        \def\UrlLeft##1\UrlRight{\underLine{##1}}
     }
 
     % hyperref-i adapteerimine lisatud subsubsubsection-i jaoks
-- 
GitLab