Dear all, I'm currently updating luatexbase, and I have a few questions: The first two are related to the behaviour when searching for "module.submodule" as "module/submodule.lua": - Am I right if I say that package.searchers[2] looks weel for it but kpse.find_file("module.submodule", 'lua') doesn't? - If it's true, is there a way to make it work with kpse.find_file? The goal of not just letting packages.searchers[2] do his job quietly (which it does well), is just to print the name of the loaded file, between brackets... So the third question is: - is it possible to make the kpse version of packages.searchers[2] return a string containing the file name? - as a bonus question, the same would be good for packages.searchers[3]! Thank you, -- Elie
On 04/13/2013 10:03 AM, Élie Roux wrote:
Dear all,
I'm currently updating luatexbase, and I have a few questions:
The first two are related to the behaviour when searching for "module.submodule" as "module/submodule.lua":
- Am I right if I say that package.searchers[2] looks weel for it but kpse.find_file("module.submodule", 'lua') doesn't?
Yes. But package.searchers[2] is quite trivial. In lua code, it would look like this: function search (name) altname = string.gsub(file,'.','/') filename = kpse.find_file(altname, 'lua') if not filename then filename = kpse.find_file(name, 'lua') end if not filename then return string.format("[kpse lua searcher] file not found: %s", name) else return loadfile(filename) end end
- If it's true, is there a way to make it work with kpse.find_file?
Just write a thin wrapper to replace '.' with '/', as above.
The goal of not just letting packages.searchers[2] do his job quietly (which it does well), is just to print the name of the loaded file, between brackets... So the third question is: - is it possible to make the kpse version of packages.searchers[2] return a string containing the file name?
That is not possible. It has to return either an error string, or a loader function (the result of loadfile()). Best wishes, Taco
Yes. But package.searchers[2] is quite trivial. In lua code, it would look like this:
function search (name) altname = string.gsub(file,'.','/') filename = kpse.find_file(altname, 'lua') if not filename then filename = kpse.find_file(name, 'lua') end if not filename then return string.format("[kpse lua searcher] file not found: %s", name) else return loadfile(filename) end end
Ok, I see. Just out of curiosity, what would the package.searchers[3] look like? Well, a pointer to the source file would be enough (I have to say I'm a bit lost in LuaTeX sources)...
Just write a thin wrapper to replace '.' with '/', as above.
Ok.
That is not possible. It has to return either an error string, or a loader function (the result of loadfile()).
Ok. Thank you! -- Elie
On 04/13/2013 12:56 PM, Élie Roux wrote:
Yes. But package.searchers[2] is quite trivial. In lua code, it would look like this:
function search (name) altname = string.gsub(file,'.','/') filename = kpse.find_file(altname, 'lua') if not filename then filename = kpse.find_file(name, 'lua') end if not filename then return string.format("[kpse lua searcher] file not found: %s", name) else return loadfile(filename) end end
Ok, I see. Just out of curiosity, what would the package.searchers[3] look like? Well, a pointer to the source file would be enough (I have to say I'm a bit lost in LuaTeX sources)...
lua/luainit.w Best wishes, Taco
lua/luainit.w
Thank you very much! Also, I just came across what seems to be a bug with ofm fonts with the attached file: $ kpsewhich -progname luatex -format ofm omarab.ofm /usr/share/texmf-texlive/fonts/ofm/public/omega/omarab.ofm $ aleph simpletfmofm.tex This is Aleph, Version 3.1415926-1.15-2.1-0.0-rc4 (TeX Live 2009/Debian) entering extended mode (simpletfmofm.tex [1] ) Output written on simpletfmofm.dvi (1 page, 352 bytes). Transcript written on simpletfmofm.log. $ dvipdf simpletfmofm.dvi $ luatex simpletfmofm.tex This is LuaTeX, Version beta-0.77.0-2013040709 (rev 4629) (./simpletfmofm.tex [1{/home/eroux/.texmf-var/fonts/map/pdftex/updmap/pdftex.map }] kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 omarab.ofm mktexpk: don't know how to create bitmap font for omarab.ofm. kpathsea: Appending font creation commands to missfont.log. ) !LuaTeX error (file omarab.ofm): Font omarab.ofm at 600 not found ==> Fatal error occurred, no output PDF file produced! $ dviluatex simpletfmofm.tex This is LuaTeX, Version beta-0.77.0-2013040709 (rev 4629) (./simpletfmofm.tex [1] ) Output written on simpletfmofm.dvi (1 page, 368 bytes). Transcript written on simpletfmofm.log. $ dvipdf simpletfmofm.dvi dvips: Font omarab.ofm not found, using cmr10 instead. dvips: Checksum mismatch in font omarab.ofm Is it really a bug? As I know only a few people are using these fonts, I would understand if you had not time for this, but it would really be extremely useful to me for some projects and I would be ready to try to provide a patch (if you give me a few pointers)... Thank you, -- Elie
On 04/13/2013 03:47 PM, Élie Roux wrote:
$ luatex simpletfmofm.tex
!LuaTeX error (file omarab.ofm): Font omarab.ofm at 600 not found ==> Fatal error occurred, no output PDF file produced!
Looks like a search path issue. It works for me, though I still use what is essentially texlive 2011 for my texmf tree. It may help to do the luatex runs with an extra --kpathsea-debug= argument. Best wishes, Taco
participants (2)
-
Taco Hoekwater
-
Élie Roux