Re: [NTG-context] XML
Hi Joha´nnes, I attached a modified version of t-openoffice.tex (I hope you have a color blindness :-), it's not very good but I hope it helps you. Wolfgang On Mon, Oct 27, 2008 at 9:16 PM, Johannes Graumann [EMAIL PROTECTED] wrote: ! Undefined control sequence. l.1 \colored [r=1,g=0.2,b=0.27] \WhatAMess ...ocument.commands.somehexcolor(#1)} l.16 {test \WhatAMess{\letterhash FF3344} test} ? That's why I went color ... Joh Wolfgang Schuster wrote: On Sun, Oct 26, 2008 at 3:05 PM, Johannes Graumann [EMAIL PROTECTED] wrote: This is sending me down the right paths (at least showing me the sign post ;0) - I know I'm a pain in the neck, but the attached minimal (mirroring your proposal with the colored snippet fixed) compiles to to black tests ... What's wrong? Hans used \colored and you use \color. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ t-openoffice.tex Description: TeX document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Colored labels with MetaPost in MkII
On Tue, Oct 28, 2008 at 3:47 PM, Aditya Mahajan [EMAIL PROTECTED] wrote: On Mon, 27 Oct 2008, Wolfgang Schuster wrote: On Fri, Oct 24, 2008 at 2:15 PM, Aditya Mahajan [EMAIL PROTECTED] wrote: On Fri, 24 Oct 2008, Wolfgang Schuster wrote: Hi all, what is the best method to format MetaPost labels in MkII with \doattributes. \startMPenvironment[global] \setupcolors[state=start] \def\labelstyle{bold} \def\labelcolor{red} \stopMPenvironment This gives you only bold label. \starttext \startMPcode label(textext(\doattributes{label}{style}{color}{Label}),origin) ; \stopMPcode \stoptext Tex colors do not work inside textext. Try label(textext(\startcolor[red] red \stopcolor), origin) ; One way to get around this is to use \sometxt. label(\sometxt{\doattributes{label}{style}{color}{Label}},(5cm,0)) ; But then you have to be careful about the differences between \sometxt in MKII and MKIV (which I need to summarize on the wiki). Here is a new example where I can't even use \sometxt. Sometxt does not work appear to work with \startMPdrawing (there is no output at all). I think that the reason is that MPdrawing simply writes stuff to the MPfile without doing the extra work needed for sometxt. I will call this is a bug, but I do not know if Hans wants to work on TeX-MP interaction in MKII now. \setupcolors[state=start] \def\labelstyle{bold} \def\labelcolor{red} \starttext \resetMPdrawing \startMPdrawing label(textext(\doattributes{label}{style}{color}{Label}),origin) ; label(\sometxt{\doattributes{label}{style}{color}{Label}},origin) ; \stopMPdrawing \MPdrawingdonetrue \getMPdrawing \stoptext It may be possible to write your macros without \start-stop-MPdrawing. Everything inside \start-stop MP(code|graphic) is first parsed by TeX, so you can do things like \newif\ifcircle \circletrue \startMPcode draw \ifcircle fullcircle \else fullsquare \fi xyscaled (5cm,5cm) ; \stopMPcode So, instead of writing stuff to MP using start-stop MPdrawing, you can simply set some flags in conditionals and chardefs, and then write one MP(graphic|code) to write one MP file. This strategy will not work for all cases, but can be useful for some. I droped now the MKII part of my module and rewrite parts of the code with Lua, sometimes and easier and I could use start/stopMPcode with calls to TeX for a few functions. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Context using LuaTeX - distribution packaging question
Hello, for openSUSE there are now beta TeX Live 2008 packages available (http://download.opensuse.org/repositories/Publishing/). [By Werner Fink, who does also the normal openSUSE packages.] The question is how the ConTeXt with LuaTeX should be best handled. By default, there is no luatex-cache and no (luatex) format. Of cause a user can do: export TEXMFCNF=/usr/share/texmf/web2c # export TEXMFCACHE=somewhere luatools --generate --verbose luatools --ini --compile cont-en but in principle I would expect that the distribution does this already, which saves the TEXMFCACHE per user and makes texexec --lua working without requiring to run first all the other commands. Questions: a) Is the TEXMFCNF environment variable necessary or can this also be read by a config file, which is overwritten by the environment variable? Which scripts/executables make use of that environemt variable? b) Is is possible -- as with kpsewhich -- to have a global cache for the format + global directories - and local directories which have then a higher precedence? I mean like: A global directory cache incl. the format files plus if the user creates a $HOME/texmf tree a user $TEXMFCACHE which contains the hashes of the user directory but such that luatex still finds the formats in the global directory? Tobias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] ctx files
Hi, How do you call ctx files from within a main ctx file ? Thanks, Alan -- * texexec --lua foo * ConTeXt minimals ver: 2008.10.08 23:34 MKIV fmt: 2008.10.13 int: english/english * Ubuntu 8.04 Hardy Heron ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ctx files
Alan STONE wrote: Hi, How do you call ctx files from within a main ctx file ? ctx:include name='whatever.ctx/ should work - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: a) Is the TEXMFCNF environment variable necessary or can this also be read by a config file, which is overwritten by the environment variable? Which scripts/executables make use of that environemt variable? I just saw that this might be possible in theory, but it fails due to the missing symbolic link resolving: if input.env(instance,'TEXMFCNF') == then local ownpath = environment.ownpath() or . ownpath is here /usr/bin and obvious finding texmf by moving up in that path does not work. In function environment.ownpath() one need to add in if lfs.isfile(b...exe) or lfs.isfile(b) then ownpath = p break some check whether b is a symbolic link and if it is, one follows the symbolic link until one finds the real binary; then one can use that path for ownpath. I tried to find some Lua routine which does so, but I couldn't find one ad hoc. (I have also the vague feeling that the algorithm fails for /some/directory/which/is/not/in/PATH/luatools.) I tried lfs.symlinkattributes() (whose mode should be link) plus posix.readlink, but I failed to get this work. (lfs.symlinkattributes and posix are not found.) Tobias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: Hello, for openSUSE there are now beta TeX Live 2008 packages available (http://download.opensuse.org/repositories/Publishing/). [By Werner Fink, who does also the normal openSUSE packages.] The question is how the ConTeXt with LuaTeX should be best handled. By default, there is no luatex-cache and no (luatex) format. Of cause a user can do: export TEXMFCNF=/usr/share/texmf/web2c # export TEXMFCACHE=somewhere luatools --generate --verbose luatools --ini --compile cont-en but in principle I would expect that the distribution does this already, which saves the TEXMFCACHE per user and makes texexec --lua working without requiring to run first all the other commands. Questions: a) Is the TEXMFCNF environment variable necessary or can this also be read by a config file, which is overwritten by the environment variable? Which scripts/executables make use of that environemt variable? there is this automess stuff implemented which assumes that the distribution kind of follows the de-facto standards of having teh bin relative to the tree; in al other cases one needs to set env vars btw, there is a file texmfcnf.lua alongside the cnf file whioch can be tweaked; so you can leave the original cnf untouched b) Is is possible -- as with kpsewhich -- to have a global cache for the format + global directories - and local directories which have then a higher precedence? I mean like: A global directory cache incl. the format files plus if the user creates a $HOME/texmf tree a user $TEXMFCACHE which contains the hashes of the user directory but such that luatex still finds the formats in the global directory? not yet .. i'm still pondering over a robust system (one side effect is for instance that when there are multiple cached copies we need to get not only the one first in the chain, but also a valid one; i.e. what to do if the latest one has an older version number than demanded and such; no big deal, but it means that the cache loader needs to be made more clever which is something that i will not do in a current or beta but first on my own system when we have reached some stability) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: some check whether b is a symbolic link and if it is, one follows the symbolic link until one finds the real binary; then one can use that path for ownpath. I tried to find some Lua routine which does so, but I couldn't find one ad hoc. (I have also the vague feeling that the algorithm fails for /some/directory/which/is/not/in/PATH/luatools.) I tried lfs.symlinkattributes() (whose mode should be link) plus posix.readlink, but I failed to get this work. (lfs.symlinkattributes and posix are not found.) i remember that there has been some discussion about this following link issue but i forgot what was the outcome do you test the latest binaries or the already outdated texlive ones? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Hans Hagen wrote: i remember that there has been some discussion about this following link issue but i forgot what was the outcome do you test the latest binaries or the already outdated texlive ones? That was TeX Live, though I don't know whether it is the SVN version or something else. However, I compared TeX Live's luatools.lua with the one of the latest cont-tmf.zip and they are identical. Tobias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] minimals and greek font
Hello, What needs to be done to include greek fonts on top of the minimal installation? Thank you. example: \usemodule[greek] \starttext \greek{kalamos} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] minimals and greek font
I forgot to add the error message: ... fonts : using map file: cbgreek luaTeX warning (file cbgreek.map): cannot open font map file ... Alan On Wednesday 29 October 2008 15:05:41 Alan BRASLAU wrote: Hello, What needs to be done to include greek fonts on top of the minimal installation? Thank you. example: \usemodule[greek] \starttext \greek{kalamos} \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Hi Hans, Hans Hagen wrote: i remember that there has been some discussion about this following link issue but i forgot what was the outcome Can you incorporate the following patch in your cont-tmf.zip? It should work with most Linux systems and it should not harm on other systems. Tobias --- /dev/shm/luatools.lua 2008-10-29 12:46:21.261006248 +0100 +++ luatools.lua2008-10-29 15:56:04.0 +0100 @@ -3053,9 +3053,16 @@ if not lfs.isdir(file.join(ownroot,texmf)) then ownroot = input.normalize_name(file.join(ownpath,..)) if not lfs.isdir(file.join(ownroot,texmf)) then -input.verbose = true -input.report(error, unable to identify cnf file) -return +-- On Linux installations, the file might be under $PREFIX/bin +-- while the texmf tree is under $PREFIX/share/texmf +if string.gmatch(ownpath, /bin$) then +ownroot = input.normalize_name(file.join(ownpath,../share)) +end +if not lfs.isdir(file.join(ownroot,texmf)) then + input.verbose = true + input.report(error, unable to identify cnf file) + return +end end end local texmfcnf = file.join(ownroot,texmf-local/web2c,filename) -- for minimals and myself ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: Hi Hans, Hans Hagen wrote: i remember that there has been some discussion about this following link issue but i forgot what was the outcome Can you incorporate the following patch in your cont-tmf.zip? It should work with most Linux systems and it should not harm on other systems. you use an old luatools / luat-inp.lua; if a patch is needed, then it should go into function input.identify_own() local instance = input.instance local ownpath = input.getownpath() or lfs.currentdir() local ie = instance.environment if ownpath then if input.env('SELFAUTOLOC')== then os.env['SELFAUTOLOC'] = file.collapse_path(ownpath) end if input.env('SELFAUTODIR')== then os.env['SELFAUTODIR'] = file.collapse_path(ownpath .. /..) end if input.env('SELFAUTOPARENT') == then os.env['SELFAUTOPARENT'] = file.collapse_path(ownpath .. /../..) end else input.verbose = true input.report(error: unable to locate ownpath) os.exit() end if input.env('TEXMFCNF') == then os.env['TEXMFCNF'] = input.cnfdefault end if input.env('TEXOS')== then os.env['TEXOS']= input.env('SELFAUTODIR') end if input.env('TEXROOT') == then os.env['TEXROOT'] = input.env('SELFAUTOPARENT') end if input.verbose then for _,v in ipairs({SELFAUTOLOC,SELFAUTODIR,SELFAUTOPARENT,TEXMFCNF}) do input.report(variable %s set to %s,v,input.env(v) or unknown) end end function input.identify_own() end end function input.identify_cnf() local instance = input.instance if #instance.cnffiles == 0 then -- fallback input.identify_own() -- the real search input.expand_variables() local t = input.split_path(input.env('TEXMFCNF')) t = input.aux.expanded_path(t) input.aux.expand_vars(t) -- redundant local function locate(filename,list) for _,v in ipairs(t) do local texmfcnf = input.normalize_name(file.join(v,filename)) if lfs.isfile(texmfcnf) then table.insert(list,texmfcnf) end end end locate(input.luaname,instance.luafiles) locate(input.cnfname,instance.cnffiles) end end Tobias --- /dev/shm/luatools.lua 2008-10-29 12:46:21.261006248 +0100 +++ luatools.lua2008-10-29 15:56:04.0 +0100 @@ -3053,9 +3053,16 @@ if not lfs.isdir(file.join(ownroot,texmf)) then ownroot = input.normalize_name(file.join(ownpath,..)) if not lfs.isdir(file.join(ownroot,texmf)) then -input.verbose = true -input.report(error, unable to identify cnf file) -return +-- On Linux installations, the file might be under $PREFIX/bin +-- while the texmf tree is under $PREFIX/share/texmf +if string.gmatch(ownpath, /bin$) then +ownroot = input.normalize_name(file.join(ownpath,../share)) +end +if not lfs.isdir(file.join(ownroot,texmf)) then + input.verbose = true + input.report(error, unable to identify cnf file) + return +end end end local texmfcnf = file.join(ownroot,texmf-local/web2c,filename) -- for minimals and myself ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive :
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Hi Hans, Hans Hagen wrote: you use an old luatools / luat-inp.lua; I updated now luat-inp.lua from the latest experimental cont-tmf.zip, however, that does not help. a) luatools.lua does not use luat-inp.lua (and luatools.lua is up to date in TeX Live) Thus updating does not help. (Besides, without the texmfcnf file, luatools.lua cannot use any other file as one cannot search for it.) b) Following UNIX symbolic links does not seem to work under Linux. I played around with luat-inp.lua and it does not work. c) Werner asks: Why is the KPSE library not used? I have to agree - KPSE uses the compile-time defaults for the path and thus should provide the correct default TEXMFCNF directory. Afterwards, I'm fine using a non-KPSE method. How about using KPSE as backup method if it doesn't find a config file otherwise? For luatex itself (contrary to luatools) there is no problem as luatex uses the compile-time path and finds the texmfcnf file. Back to (b): The symbolic links support in luat-inp.lua seems only to work if your directory is a symbolic link but not if the file is a symbolic link, e.g. foo/bin - /usr/local/bar-bin then for foo/bin/file doing chdir(foo/bin) makes sense as then currentdir() prints /usr/local/bar-bin but this does not work for /usr/bin/luatools - ../share/texmf//luatools.lua as the chdir(/usr/bin) makes no difference. One really needs posix.readlink support, which is not in my texlua. Or, alternative 2, if path ends in bin, try ../share/texmf as my old patch does. Or one indeed uses KPSE: kpse.set_program_name('luatex') local kpse_result1 = kpse.find_file(input.luaname,'cnf',true) local kpse_result2 = kpse.find_file(input.cnfname,'cnf') I'm also open for other suggestions. Tobias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: c) Werner asks: Why is the KPSE library not used? I have a scenario which fails with the current mechanism - even if following the sym links worked. Assume that a user only puts a texmf.cnf under $HOME/texmf/web2c/texmf.cnf. That file will be used by luatex, pdftex etc. but luatools will still resolve /usr/share/texmf/.../luatools.lua if it follows $SELF. Thus I'm in growingly in favour of using KPSE (just) for finding texmf.cnf and texmfcnf.lua; for all other purposes including seaching files whatever other method can be used. Tobias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: Hi Hans, Hans Hagen wrote: you use an old luatools / luat-inp.lua; I updated now luat-inp.lua from the latest experimental cont-tmf.zip, however, that does not help. a) luatools.lua does not use luat-inp.lua (and luatools.lua is up to date in TeX Live) Thus updating does not help. (Besides, without the texmfcnf file, luatools.lua cannot use any other file as one cannot search for it.) luat-inp.lua is merged into luatools in order to make in 'stand-alone' luatools --selfupdate could do that depending on the fact if your system works i really cannot find the code in my luatools (i'll send it to you) b) Following UNIX symbolic links does not seem to work under Linux. I played around with luat-inp.lua and it does not work. hm, maybe taco knows .. c) Werner asks: Why is the KPSE library not used? I have to agree - KPSE uses the compile-time defaults for the path and thus should provide the correct default TEXMFCNF directory. Afterwards, I'm fine using a non-KPSE method. How about using KPSE as backup method if it doesn't find a config file otherwise? several reasons: (1) in spite of promises, kpse was never extended to support other input methods (2) the lua library can handle things like zip files, url's, soon sockets, etc. i don't want to be limited in context (3) the lua library is (once the database is there) faster than kpse (4) when used in scripts we only load the databsse once so in the case of context luatools (or mtxrun) can run scripts that themselves need the database without a reload (ok, to some extend that can also be done with the kpse lib) (5) i have control over the lua based library -) For luatex itself (contrary to luatools) there is no problem as luatex uses the compile-time path and finds the texmfcnf file. hm, but since luatools is ran using texlus (which is luatex) the same should apply - make sure that luatools is run by texlua and not by lua itself - don't use a stub, just rename luatools.lua to luatools and mtxrun.lua to mtxrun (so, no texmfstart like extra stubs which would slow down things considerably) Back to (b): The symbolic links support in luat-inp.lua seems only to work if your directory is a symbolic link but not if the file is a symbolic link, e.g. foo/bin - /usr/local/bar-bin then for foo/bin/file doing chdir(foo/bin) makes sense as then currentdir() prints /usr/local/bar-bin but this does not work for /usr/bin/luatools - ../share/texmf//luatools.lua as the chdir(/usr/bin) makes no difference. One really needs posix.readlink support, which is not in my texlua. Or, alternative 2, if path ends in bin, try ../share/texmf as my old patch does. Or one indeed uses KPSE: kpse.set_program_name('luatex') local kpse_result1 = kpse.find_file(input.luaname,'cnf',true) local kpse_result2 = kpse.find_file(input.cnfname,'cnf') I'm also open for other suggestions. once we have the same luatools we can look into the share thing Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: Hi Hans, Hans Hagen wrote: you use an old luatools / luat-inp.lua; I updated now luat-inp.lua from the latest experimental cont-tmf.zip, however, that does not help. did you copy that file to 'luatools' in the bin path? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Hi Hans, Hans Hagen wrote: luat-inp.lua is merged into luatools in order to make in 'stand-alone' OK, I missed that. By the way, unless I screwed up completely, the new luatools you have sent me work: LuaTools | variable SELFAUTOLOC set to /usr/bin LuaTools | variable SELFAUTODIR set to /usr LuaTools | variable SELFAUTOPARENT set to / LuaTools | variable TEXMFCNF set to {$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,.local,}/web2c} LuaTools | skipping configuration for /usr/share/texmf/web2c from /home/tob/luatex-cache/context/c67bf06401a0e1a39f3ee04c60209dc5/trees/e027248d6557d124c703335e8a95ecd5 The symbolic links are not resolved, but $SELFAUTODIR/share/texmf/web2c/ is the correct directory. b) Following UNIX symbolic links does not seem to work under Linux. I played around with luat-inp.lua and it does not work. hm, maybe taco knows .. I think there is no way round but posix.readlink. However, it might be not needed as the new, just sent luatools works. c) Werner asks: Why is the KPSE library not used? several reasons: I agree about the KPSE shortcomings, however, just for finding texmf.cnf KPSE should be good enough. (OK, finding texmfcnf.lua does not seem to work well as the lua extension means that web2c is not searched.) For luatex itself (contrary to luatools) there is no problem as luatex uses the compile-time path and finds the texmfcnf file. hm, but since luatools is ran using texlus (which is luatex) the same should apply I think the algorithm used to find the texmf.cnf file is different and thus a different file is found. Your algorithm never checks $HOME/texmf/web2c where a user could have put his file. For pdftex $HOME/texmf/web2c has a higher precedence than /usr/share/texmf/web2c. I assume that the same thing is true for luatex. In any case the luatex binary contains the following string: /etc/texmf:/etc/texmf/web2c:/var/lib/texmf/web2c:{~/texmf,!!/etc/texmf,!!/var/lib/texmf,!!/usr/lib/texmf,!!/usr/local/share/texmf,!!/usr/share/texmf}/web2c Using KPSE the same string seems to be used to check for the config file. But luatools uses a completely different method. As long as the user does not have its own texmf.cnf there is no problem. (Should be the case most of the time.) However, as soon as (s)he has, luatex and luatools access different files! - make sure that luatools is run by texlua and not by lua itself That seems to be the case - my lua does not know about lfs and that works with texlua. - don't use a stub, just rename luatools.lua to luatools and mtxrun.lua to mtxrun (so, no texmfstart like extra stubs which would slow down things considerably) That is done differently: luatools.lua remains like that, but /usr/bin/luatools is a symbolic link to luatools.lua. Tobias ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: I agree about the KPSE shortcomings, however, just for finding texmf.cnf KPSE should be good enough. (OK, finding texmfcnf.lua does not seem to work well as the lua extension means that web2c is not searched.) but using kpse would mean initializing it and that means loading the file database which can be pretty large for a non minimal tex tree so that's a no-go I think the algorithm used to find the texmf.cnf file is different and thus a different file is found. Your algorithm never checks $HOME/texmf/web2c where a user could have put his file. For pdftex $HOME/texmf/web2c has a higher precedence than /usr/share/texmf/web2c. I assume that the same thing is true for luatex. In any case the luatex binary contains the following string: what files are looked for depends also on env settings; but anyhow, at some point mkiv/luatex might drop the cnf file /etc/texmf:/etc/texmf/web2c:/var/lib/texmf/web2c:{~/texmf,!!/etc/texmf,!!/var/lib/texmf,!!/usr/lib/texmf,!!/usr/local/share/texmf,!!/usr/share/texmf}/web2c hm, where is that set? hard coded in the binary? but concerning the cnf file, luatex/mkiv does not use that many paths (less fonts for instance) Using KPSE the same string seems to be used to check for the config file. But luatools uses a completely different method. As long as the user does not have its own texmf.cnf there is no problem. (Should be the case most of the time.) However, as soon as (s)he has, luatex and luatools access different files! well, if something is hard coded in the binary then i'm not going to bother about it too much; if something is determined by env vars, we can see what makes sense to support; also, an installer that does things differently from the standard tex live setup can also take care of setting a few variables That is done differently: luatools.lua remains like that, but /usr/bin/luatools is a symbolic link to luatools.lua. ok Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Context using LuaTeX - distribution packaging question
Tobias Burnus wrote: Tobias Burnus wrote: c) Werner asks: Why is the KPSE library not used? I have a scenario which fails with the current mechanism - even if following the sym links worked. Assume that a user only puts a texmf.cnf under $HOME/texmf/web2c/texmf.cnf. That file will be used by luatex, pdftex etc. but luatools will still resolve /usr/share/texmf/.../luatools.lua if it follows $SELF. well, users can always force a file if there is logic we can try to follow it, if there is hard coded behaviour, well, we can forget about it; also, keep in mind that luatools collapses all cnf files that it uses (it does use more if specified) into one file in the cache, so any change to a cnf must be followed by luatools --generate Thus I'm in growingly in favour of using KPSE (just) for finding texmf.cnf and texmfcnf.lua; for all other purposes including seaching files whatever other method can be used. no option Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___