--- cmscontrib/gerpythonformat/templates/lg/graphdrawing.tex 2019-02-01 20:37:11.175618929 +0100 +++ /tmp/graphdrawing.tex 2019-02-01 20:45:34.593613925 +0100 @@ -2,6 +2,42 @@ \usetikzlibrary{graphs} \usetikzlibrary{graphdrawing} +\usepackage{luacode} +\begin{luacode} + function pgf_lookup_and_require(name) + local sep = '/' + if string.find(os.getenv('PATH'),';') then + sep = '\string\\' + end + local function lookup(name) + local sub = name:gsub('%.',sep) + local find_func = function (name, suffix) + if resolvers then + local n = resolvers.findfile (name.."."..suffix, suffix) -- changed + return (not (n == '')) and n or nil + else + return kpse.find_file(name,suffix) + end + end + if find_func(sub, 'lua') then + require(name) + elseif find_func(sub, 'clua') then + collectgarbage('stop') + require(name) + collectgarbage('restart') + else + return false + end + return true + end + return + lookup('pgf.gd.' .. name .. '.library') or + lookup('pgf.gd.' .. name) or + lookup(name .. '.library') or + lookup(name) + end +\end{luacode} + \usegdlibrary{force, layered} \directlua{require("graphdrawing.lua")}