diff options
Diffstat (limited to 'macros/luatex/generic/lua-widow-control/lua-widow-control.sty')
-rw-r--r-- | macros/luatex/generic/lua-widow-control/lua-widow-control.sty | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/macros/luatex/generic/lua-widow-control/lua-widow-control.sty b/macros/luatex/generic/lua-widow-control/lua-widow-control.sty index 81dd969d8d..1be00709bc 100644 --- a/macros/luatex/generic/lua-widow-control/lua-widow-control.sty +++ b/macros/luatex/generic/lua-widow-control/lua-widow-control.sty @@ -5,7 +5,14 @@ \NeedsTeXFormat{LaTeX2e}[2015/01/01] % Formats built after 2015 include \LuaTeX{}Base \ProvidesPackage{lua-widow-control}% - [2022/02/04 v1.1.4] %%version %%date + [2022/02/15 v1.1.5] %%version %%date + +\ifdefined\directlua\else + \PackageError{lua-widow-control}{% + LuaTeX is required for this package.\MessageBreak + Make sure to compile with `lualatex'% + }{} +\fi \clubpenalty=1 \widowpenalty=1 @@ -22,7 +29,15 @@ % Here, we enable font expansion/contraction. It isn't strictly necessary for % \lwc/'s functionality; however, it is required for the % lengthened paragraphs to not have terrible spacing. -\RequirePackage[final]{microtype} +\RequirePackage{etoolbox} +\AtEndPreamble{ + \@ifpackageloaded{microtype}{}{ % Only load if not already loaded + \RequirePackage[ + final, + activate={true,nocompatibility} + ]{microtype} + } +} % Define \TeX{} wrappers for Lua functions \newcommand{\lwcenable}{\directlua{lwc.enable_callbacks()}} @@ -34,8 +49,6 @@ % Expansion of some parts of the document, such as section headings, is quite % undesirable, so we'll disable \lwc/ for certain commands. -\RequirePackage{etoolbox} - \newcommand{\lwc@patch@warning}[1]{\PackageWarning{lua-widow-control}{% Patching the \protect#1 command failed% }} |