I'm using ulem package to perform clean underlining as advised here https://alexwlchan.net/2017/10/latex-underlines/
It works like a charm, but the line stays at the same thickness whatever the font size.
As a first try, I want the parameters to change accordingly when the font is settled to HUGE (max size with the moresize package).
However when trying to use it, I get an error message "Undefined Control Sequence".
% !TEX TS-program = lualatex
\documentclass[fontsize=12pt,DIV=calc,oneside]{scrarticle}
\usepackage{contour}
\usepackage[normalem]{ulem}
\usepackage{moresize}
% Underline
\makeatletter
\newcommand{\cleverul}[1]
{%
\ifthenelse{\equal{\f@size}{\pointsize{\normalsize}}}%
{%
\setlength{\ULdepth}{1.8pt}%
\renewcommand{\ULthickness}{0.8pt}%
\uline{\phantom{#1}}%
\llap{\contour{white}{#1}}%
}%
\ifthenelse{\equal{\f@size}{\pointsize{\HUGE}}}%
{%
\setlength{\ULdepth}{3pt}%
\renewcommand{\ULthickness}{1.5pt}%
\uline{\phantom{#1}}%
\llap{\contour{white}{#1}}
}%
}%
\makeatother
\begin{document}
\cleverul{try}
\end{document}
\pointsize
is undefined, maybe you forgot to copy its definition from somewhere else; 2) the syntax of\ifthenelse
is\ifthenelse{condition}{TRUE CODE}{FALSE CODE}
, you've forgotten theFALSE
part.