Debian Codegraph @

texmf-dist/tex/lualatex/ligtype/ligtype.sty

raw
1 % Copyright (c) 2022-2023 Thomas Kelkel [email protected]
2
3 % This file may be distributed and/or modified under the
4 % conditions of the LaTeX Project Public License, either
5 % version 1.3c of this license or (at your option) any later
6 % version. The latest version of this license is in
7
8 % http://www.latex-project.org/lppl.txt
9
10 % and version 1.3c or later is part of all distributions of
11 % LaTeX version 2009/09/24 or later.
12
13 % The ligtype package makes use of the German language
14 % ligature suppression rules of the selnolig package by
15 % Mico Loretan. The selnolig package can be downloaded at
16
17 % https://www.ctan.org/pkg/selnolig
18
19 % and may be distributed and/or modified under the
20 % conditions of the LaTeX Project Public License.
21
22 \ProvidesPackage{ligtype}[2023/07/08 v0.3 Comprehensive ligature suppression functionalities]
23 \RequirePackage{ifluatex,luatexbase}
24
25 \ifluatex
26 \directlua{require ( "ligtype.lua" )}
27
28 \DeclareOption{noshortf}{\directlua{ligtype_no_short_f()}}
29 \DeclareOption{allshortf}{\directlua{ligtype_all_short_f()}}
30 \DeclareOption{makemarks}{\directlua{ligtype_make_marks()}}
31 \DeclareOption{kerntest}{\AtEndDocument{\directlua{ligtype_write_ligs()}}}
32 \DeclareOption{nodefault}{\directlua{ligtype_no_default()}}
33 \DeclareOption{liglist}{\directlua{ligtype_lig_list()}}
34 \DeclareOption{connotes}{\directlua{ligtype_con_notes()}}
35 \ProcessOptions
36
37 \def\ligtypeon{\directlua{ligtype_on()}}
38 \def\ligtypeoff{\directlua{ligtype_off()}}
39
40 \def\noligs{\directlua{ligtype_no_ligs()}}
41 \def\ligs{\directlua{ligtype_ligs()}}
42
43 \ligtypeon
44
45 \newcommand\nolig[2]{%
46 \directlua{%
47 ligtype_parse_macro ( "\luatexluaescapestring{#1}", "\luatexluaescapestring{#2}", true )%
48 }%
49 }
50 \newcommand\keeplig[2]{%
51 \directlua{%
52 ligtype_parse_macro ( "\luatexluaescapestring{#1}", "\luatexluaescapestring{#2}", false )%
53 }%
54 }
55 \else
56 \errhelp{Compile with LuaLaTeX to be able to use the "ligtype" package.}
57 \errmessage{Package "ligtype" error: This package requires LuaLaTeX!}
58 \fi