Am 09.09.2025 um 15:50 schrieb Gavin via ntg-context:
Hi List,
I wrote a module that draws globes, but I’ve run into a problem as I get it
ready to share. The module works fine for documents that are in the same folder
as the module’s various files, but it doesn’t work for documents that are
anywhere else. ConTeXt finds and loads the module, but it can’t find the data
files containing the map data.
The module’s files and directory structure can all be found at:
https://github.com/Sophias-Compass/luageo
It is organized according to the TDS instructions for modules on the wiki.
Here’s what is going wrong, in more detail.
I put my pre-release luageo module into texmf-local so that I could use it in
other documents. This works if the other document is in the luageo directory
with the module, but it doesn’t work if the other document is anywhere else.
The module still loads. (From a failed log file…)
modules > 'luageo' is loaded
open source > level 2, order 3, name
'/Users/Gavin/context-osx-arm64/tex/texmf-local/luageo/tex/context/third/luageo/t-luageo.mkxl’
But the module can’t find the map data files.
lua error > lua error on line 41 in file
/Users/Gavin/context-osx-arm64/tex/texmf-local/luageo/tex/context/third/luageo/t-luageo.mkxl:
token call, execute: cannot open data/iles.lua: No such file or
directory
The main module file, t-luageo.mkxl, contains a line to load t-luageo.lmt,
which has the necessary Lua code.
\registerctxluafile{t-luageo}{}
The Lua code states that the map data should be found in the data directory.
moduledata = moduledata or { }
local geo = { }
moduledata.geo = geo
geo.datafolder = "data/“
I’m not actually sure what all those lines do. (I think they were written by
Hans when he was helping me earlier.) Later, the Lua code loads the data.
dofile("data/iles.lua")
dofile("data/ameriquenord.lua”)
dofile(resolvers.findfile("..."))
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________