summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty61
1 files changed, 41 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty b/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
index 531d03eb448..f432fb068cb 100644
--- a/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
+++ b/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
@@ -6,7 +6,7 @@
%%
%% lua-ul.dtx (with options: `package')
%%
-%% Copyright (C) 2020 by Marcel Krueger
+%% Copyright (C) 2020-2021 by Marcel Krueger
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -20,7 +20,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
{lua-ul}
- [2020/07/13 v0.1.0 Underlining and related functionality for LuaTeX]
+ [2021/02/02 v0.1.1 Underlining and related functionality for LuaTeX]
\ifx\directlua\undefined
\PackageError{lua-ul}{LuaLaTeX required}%
@@ -62,36 +62,52 @@
\def\luaul@@setcolor\xcolor@#1#2{}
\newcommand\luaul@setcolor[1]{%
\ifx\XC@getcolor\undefined
- \def\luaul@highlight@currentcolor{#1}%
+ \def\luaul@currentcolor{#1}%
\else
\begingroup
\XC@getcolor{#1}\luaul@tmpcolor
\expanded{\endgroup
- \def\noexpand\luaul@highlight@currentcolor{%
+ \def\noexpand\luaul@currentcolor{%
\expandafter\luaul@@setcolor\luaul@tmpcolor}}%
\fi
}
+ \newcommand\luaul@applycolor{%
+ \ifx\XC@getcolor\undefined
+ \color{\luaul@currentcolor}%
+ \else
+ \expandafter\XC@undeclaredcolor\luaul@currentcolor
+ \fi
+ }
\NewDocumentCommand\LuaULSetHighLightColor{om}{%
\edef\luaul@highlight@color{\IfValueTF{#1}{[#1]{#2}}{#2}}%
}
- \newunderlinetype\@underLine%
- {\leaders\vrule height -.65ex depth .75ex}
- \newcommand\underLine[1]{{\@underLine#1}}
- \newunderlinetype\@strikeThrough%
- {\leaders\vrule height .55ex depth -.45ex}
- \newcommand\strikeThrough[1]{{\@strikeThrough#1}}
+ \newunderlinetype\@underLine{%
+ \leaders\vrule height -.65ex depth .75ex
+ }
+ \NewDocumentCommand\underLine{m}{{\@underLine#1}}
+
+ \newunderlinetype\@strikeThrough{%
+ \leaders\vrule height .55ex depth -.45ex
+ }
+ \newunderlinetype\colored@strikeThrough[\number\dimexpr1ex@%
+ \luaul@currentcolor]{%
+ \luaul@applycolor
+ \leaders\vrule height .55ex depth -.45ex
+ }
+ \NewDocumentCommand\strikeThrough{om}{{%
+ \IfValueTF{#1}{%
+ \luaul@setcolor{#1}%
+ \colored@strikeThrough
+ }\@strikeThrough%
+ #2%
+ }}
\newunderlinetype\@highLight[\number\dimexpr1ex@%
- \luaul@highlight@currentcolor]%
- {%
- \ifx\XC@getcolor\undefined
- \color{\luaul@highlight@currentcolor}%
- \else
- \expandafter\XC@undeclaredcolor\luaul@highlight@currentcolor
- \fi
- \leaders\vrule height 1.75ex depth .75ex
- }
- \newcommand\highLight[2][\luaul@highlight@color]{{%
+ \luaul@currentcolor]{%
+ \luaul@applycolor
+ \leaders\vrule height 1.75ex depth .75ex
+ }
+ \NewDocumentCommand\highLight{O{\luaul@highlight@color}m}{{%
\luaul@setcolor{#1}%
\@highLight#2%
}}
@@ -121,6 +137,11 @@
\LuaULResetUnderline*%
}
\fi
+\output\expandafter\expandafter\expandafter{%
+ \expandafter\expandafter\expandafter\LuaULResetUnderline
+ \expandafter\expandafter\expandafter*%
+ \expandafter\@firstofone\the\output%
+}
%%
%%
%% End of file `lua-ul.sty'.