diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/selnolig/selnolig.sty')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/selnolig/selnolig.sty | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/lualatex/selnolig/selnolig.sty b/Master/texmf-dist/tex/lualatex/selnolig/selnolig.sty index 8a81edc28bc..a2a6045443c 100644 --- a/Master/texmf-dist/tex/lualatex/selnolig/selnolig.sty +++ b/Master/texmf-dist/tex/lualatex/selnolig/selnolig.sty @@ -13,8 +13,8 @@ % --------------------- \def\selnoligpackagename{selnolig} -\def\selnoligpackageversion{0.218} -\def\selnoligpackagedate{2013/05/28} +\def\selnoligpackageversion{0.221a} +\def\selnoligpackagedate{2013/06/12} % Announce who we are. Issue warning message if we're % not running under LuaLaTeX. @@ -40,7 +40,6 @@ \typeout{=========================================} \fi - % If the 'fontspec' package isn't loaded by the time % the '\begin{document}' directive is encoutered, issue % an error message and exit. @@ -127,15 +126,23 @@ \DeclareOption{noadditionalhyphenationpatterns}{\@addlhyphfalse} -% The 'basic' option automatically sets the preceding Booleans -% to 'false', even if historic and/or rare ligatures are enabled +% The 'basic' option automatically sets the preceding +% Booleans to 'false', even if historic and/or rare +% ligatures are enabled \DeclareOption{basic}{\@broadfsetfalse\@hdligsetfalse} -% Last but not least, an option to set all Boolean -% variables (other than '@addlhyph') to 'true' -% simultaneously. +% The option 'noftligs' serves to suppress ft and fft +% ligatures *globally*; default value: 'false'. + +\newif\if@noftligs\@noftligsfalse +\DeclareOption{noftligs}{\@noftligstrue} + + +% Finally, an option to set most language-related +% Boolean variables (other than '@addlhyph') to +% 'true' simultaneously. \DeclareOption{all}{% \@englishtrue \@broadfsettrue \@hdligsettrue @@ -144,6 +151,9 @@ % Finally, process all options \ProcessOptions\relax +\if@noftligs{% % suppress ft and fft ligatures globally + \AtBeginDocument{ \nolig{ft}{f|t} } +\fi % Part 2: Load the lua code and set up the user macros @@ -154,16 +164,18 @@ \directlua{ require("selnolig.lua") } % Commands to switch selnolig's routines on and off - \newcommand\selnoligon{ - \directlua{ enableselnolig() } + \newcommand\selnoligon{% + \directlua{ enableselnolig() }% } - \newcommand\selnoligoff{ - \directlua{ disableselnolig() } + + \newcommand\selnoligoff{% + \directlua{ disableselnolig() }% } % By default, selnolig's macros are switched on \selnoligon + % Record operations of selnolig package to the log % file: Enabled via '\debugon' command \newcommand\debugon{% @@ -190,11 +202,21 @@ } } + % A third user macro turns ligature suppression + % off temporarily: + \newcommand\uselig[1]{% + \directlua{ enable_suppression(false) }% + \mbox{#1}% + \directlua{ enable_suppression(true) }% + } + + \else % If *not* running under LuaLaTeX, provide dummy % definitions for package's user macros. \newcommand{\nolig}[2]{} \newcommand{\keeplig}[1]{} + \newcommand{\uselig}[1]{\mbox{#1}} \let\selnoligon\relax \let\selnoligoff\relax \let\debugon\relax @@ -202,7 +224,7 @@ \fi -% A third user macro: '\breaklig'. This is hopefully +% A fourth user macro: '\breaklig'. This is hopefully % easier to remember than having to type "\-\hspace{0pt}". % (It's defined outside the \ifluatex conditional since % it doesn't use any lua code.) @@ -210,7 +232,6 @@ \newcommand\breaklig{\-{\hspace{0pt}}} - % Part 3: What to do if the 'english' option is set % ------------------------------------------------- |