summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-16 22:45:21 +0000
committerKarl Berry <karl@freefriends.org>2022-02-16 22:45:21 +0000
commit9a2e259625722487a887ac1c24e4aaec11e718fe (patch)
treea16e76927917d86381655c60cc32b217267a151f /Master/texmf-dist/tex/lualatex
parent28da595db46ec1bef5fdb9a83d37bc5d9b98db76 (diff)
lua-widow-control (15feb22)
git-svn-id: svn://tug.org/texlive/trunk@62050 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
-rw-r--r--Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty21
1 files changed, 17 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty b/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty
index 81dd969d8da..1be00709bc8 100644
--- a/Master/texmf-dist/tex/lualatex/lua-widow-control/lua-widow-control.sty
+++ b/Master/texmf-dist/tex/lualatex/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%
}}