<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%! Author = lorenzo
%! Date = 08/09/22

\ExplSyntaxOn
\cs_new_eq:NN \strcompare \str_if_eq:eeTF
\ExplSyntaxOff

\newcommand{\lrefrange}[3][label]{\strcompare{label}{#1}{{\csname cref@line@name@plural\endcsname}~}{\strcompare{nolabel}{#1}{}{\GenericError{}{Error: Invalid option!}{}{}}}\hyperlink{#2}{\ref*{#2}}--\hyperlink{#3}{\ref*{#3}}}

%% Use ONLY \lref NOT \lreflst
\ExplSyntaxOn
\NewDocumentCommand{\lref}{m}
 {
  \clist_set:Nn \l_jour_command_input_clist { #1 }
  \exp_args:Nf \lreflst { \clist_use:Nn \l_jour_command_input_clist {,} }
 }
\clist_new:N \l_jour_command_input_clist
\ExplSyntaxOff
\newcommand{\lreflst}[1]{%
  \count255=0%
  \def\do##1{\advance\count255 1 \chardef\finalitem=\count255 }%
  \docsvlist{#1}%
  \ifnum\count255=1
  {\csname cref@line@name\endcsname}~%
  \else
  {\csname cref@line@name@plural\endcsname}~%
  \fi%
  \count255=0%
  \def\do##1{\advance\count255 1
    \ifnum\finalitem=1
    \else
    \ifnum\count255=\finalitem
      \space e\space%
    \else
      \ifnum\count255=1
      \else
    ,\space%
      \fi%
    \fi\fi\hyperlink{##1}{\ref*{##1}}}%
  \docsvlist{#1}}%
</pre></body></html>