summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luapackageloader/luapackageloader.sty
blob: 620937bc8743114fee2a6ebff1c80451dcbbb935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Author: Deepak Jois
% License: LPPL Version 1.3c or higher <http://www.latex-project.org/lppl.txt>
% Date: 2019/12/21
% Version: 0.2
\def\luapackageloaderpkgdate{2019/12/21}
\def\luapackageloaderversion{0.2}

\expandafter\ifx\csname ProvidesPackage\endcsname\relax
  \input ifluatex.sty\relax
\else
  \NeedsTeXFormat{LaTeX2e}
  \ProvidesPackage{luapackageloader}[\luapackageloaderpkgdate\space v\luapackageloaderversion\space Lua package searchers for LuaTeX]
  \RequirePackage{ifluatex}
\fi

\def\luapackageloader@dothings{%
  \directlua{
    luapackageloader = require("luapackageloader")
    luapackageloader.add_lua_searchers()
  }%
}

\expandafter\ifx\csname ProvidesPackage\endcsname\relax
  \ifluatex
   \luapackageloader@dothings
  \else
    \message{Warning: luapackageloader only works with LuaTeX (plain and LaTeX format)}
  \fi
\else
  \ifluatex
    \luapackageloader@dothings
  \else
    \PackageWarning{luapackageloader}{You are using this package without LuaTeX. This is not supported.}
  \fi
\fi