summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-14 22:10:45 +0000
committerKarl Berry <karl@freefriends.org>2020-03-14 22:10:45 +0000
commitca238fa81c51ff5ba715598b5082b5637f917456 (patch)
tree23986f4555dd33bee98e789cc3475f46a68b5104 /Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
parentae2a5f357df974b9a9140e188de98de09c83cf36 (diff)
lua-ul (13mar20)
git-svn-id: svn://tug.org/texlive/trunk@54304 c570f23f-e606-0410-a88d-b1316a301751
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.sty78
1 files changed, 78 insertions, 0 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
new file mode 100644
index 00000000000..08069171817
--- /dev/null
+++ b/Master/texmf-dist/tex/lualatex/lua-ul/lua-ul.sty
@@ -0,0 +1,78 @@
+%%
+%% This is file `lua-ul.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% lua-ul.dtx (with options: `package')
+%%
+%% Copyright (C) 2020 by Marcel Krueger
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage
+ {lua-ul}
+ [2020/03/12 v0.0.1 Underlining and related functionality for LuaTeX]
+
+\ifx\directlua\undefined
+ \PackageError{lua-ul}{LuaLaTeX required}%
+ {Lua-UL requires LuaLaTeX.
+ Maybe you forgot to switch the engine in your editor?}
+\fi
+\directlua{require'lua-ul'}
+\RequirePackage{xparse}
+\newif\ifluaul@predefined
+\newif\ifluaul@soulnames
+\luaul@predefinedtrue
+\DeclareOption{minimal}{\luaul@predefinedfalse}
+\DeclareOption{soul}{\luaul@soulnamestrue}
+\ProcessOptions\relax
+\protected\def\luaul@maybedefineuse#1#2{%
+ \unless\ifcsname#1\endcsname
+ \expandafter\xdef\csname#1\endcsname{#2}%
+ \fi
+ \csname#1\endcsname
+}
+
+\NewDocumentCommand\newunderlinetype{mO{\luaul@defaultcontext}m}{%
+ \newcommand#1{}% "Reserve" the name
+ \protected\def#1{%
+ \expandafter\luaul@maybedefineuse
+ \expanded{{\csstring#1@@#2}}%
+ {\LuaULSetUnderline
+ \LuaULNewUnderlineType\hbox{#3\hskip0pt}%
+ }}%
+}
+\ifluaul@predefined
+ \newcommand\luaul@defaultcontext{%
+ \number\dimexpr1ex
+ @\unless\ifx\undefined\LuaCol@Attribute
+ \the\LuaCol@Attribute
+ \fi
+ }
+ \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\@highLight[\number\dimexpr1ex]%
+ {\color{yellow}\leaders\vrule height 1.75ex depth .75ex}
+ \newcommand\highLight[1]{{\@highLight#1}}
+ \ifluaul@soulnames
+ \let\textul\underLine \let\ul\textul
+ \let\textst\strikeThrough \let\st\textst
+ \let\texthl\highLight \let\hl\texthl
+ \fi
+\fi
+%%
+%%
+%% End of file `lua-ul.sty'.