blob: 0b178245b58c56b5fa65507b39ab832386fbec97 (
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
36
37
38
39
40
41
42
43
44
45
|
--- 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")}
|