summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/pgfplots/tex/pgfplots.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/pgf/contrib/pgfplots/tex/pgfplots.lua
Initial commit
Diffstat (limited to 'graphics/pgf/contrib/pgfplots/tex/pgfplots.lua')
-rw-r--r--graphics/pgf/contrib/pgfplots/tex/pgfplots.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/pgfplots/tex/pgfplots.lua b/graphics/pgf/contrib/pgfplots/tex/pgfplots.lua
new file mode 100644
index 0000000000..23aeaab2a8
--- /dev/null
+++ b/graphics/pgf/contrib/pgfplots/tex/pgfplots.lua
@@ -0,0 +1,45 @@
+
+require("pgfplots.binary")
+
+-- all classes/globals will be added to this table:
+pgfplots = {}
+
+-- will be set by TeX:
+pgfplots.pgfplotsversion = nil
+
+if _VERSION == "Lua 5.1" or _VERSION == "Lua 5.0" then
+ texio.write("pgfplots: setting 'lua support=false': the lua version on this system is " .. _VERSION .. "; expected at least 'Lua 5.2'. Use a more recent TeX distribution to benefit from LUA in pgfplots.\n")
+
+ -- the entire lua backend will be switched off if this is false:
+ tex.sprint("\\pgfplotsset{lua support=false}")
+ return
+else
+ -- well, 5.2 is what this stuff has been written for.
+ -- Is there a good reason why it shouldn't work on 5.1 !? No, I guess not. Except that it took me a long time
+ -- to figure out that 5.2 broke compatibility in lots of ways - and it was difficult enough to get it up and running.
+ -- If someone wants (and needs) to run it in 5.1 - I would accept patches.
+end
+
+require("pgfplots.pgfplotsutil")
+
+-- see pgfrcs.code.tex -- all versions after 3.0.0 (excluding 3.0.0) will set this version:
+if not pgf or not pgf.pgfversion then
+ pgfplots.log("log", "pgfplots.lua: loading complementary lua code for your pgf version...\n")
+ pgfplots.pgfluamathfunctions = require("pgfplotsoldpgfsupp.luamath.functions")
+ pgfplots.pgfluamathparser = require("pgfplotsoldpgfsupp.luamath.parser")
+else
+ pgfplots.pgfluamathparser = require("pgf.luamath.parser")
+ pgfplots.pgfluamathfunctions = require("pgf.luamath.functions")
+end
+pgfplots.pgftonumber = pgfplots.pgfluamathfunctions.tonumber
+pgfplots.tostringfixed = pgfplots.pgfluamathfunctions.tostringfixed
+pgfplots.toTeXstring = pgfplots.pgfluamathfunctions.toTeXstring
+
+
+require("pgfplots.plothandler")
+require("pgfplots.meshplothandler")
+require("pgfplots.colormap")
+require("pgfplots.streamer")
+
+-- hm. perhaps this here should become a separate module:
+require("pgfplots.pgfplotstexio")