Re: [NTG-context] need help comparing strings
On 10/13/20 7:14 PM, Wolfgang Schuster wrote: > Pablo Rodriguez schrieb am 13.10.2020 um 19:06: >> [...] >> In any case, I cannot compare to a number: >> >>\startluacode >> userdata = userdata or {} >> function userdata.numbersfname(name) >> return string.match(name, "%d+") >> end >>\stopluacode >> >>\define[1]\numbersfname >>{\cldcontext{userdata.numbersfname([==[#1]==])}} > > Untested: > > \defineexpandable[1]\numbersfname > {\cldcontext{userdata.numbersfname([==[#1]==])}} I’m afraid it doesn’t work. \startluacode userdata = userdata or {} function userdata.numbersfname(name) return string.match(name, "%d+") end \stopluacode \defineexpandable[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} \starttext \numbersfname{abc123} \numbersfname{\env{fname}} \doifelse{\numbersfname{\env{fname}}}{123}{yes}{no} \stoptext Just curious about what the difference might be. Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help comparing strings
On 10/13/20 5:33 PM, Pablo Rodriguez wrote: > [...] > \starttext > \ctxlua{ d = [[\env{fname}]] } > > d: \cldcontext{d}\\ > \doifelse{\cldcontext{d:match("\letterpercent d+")}} > {123}{yes}{no} > \stoptext > [...] > 3. I’m trying this on a Linux box, but on Windows I would say that Lua > variable "d" is empty. Just for the record, this sample also works in Windows. The Lua variable isn’t empty and the conditional outputs "yes". Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help comparing strings
Pablo Rodriguez schrieb am 13.10.2020 um 19:06: On 10/13/20 5:54 PM, Aditya Mahajan wrote: On Tue, 13 Oct 2020, Pablo Rodriguez wrote: [...] Could anyone explain me what I’m missing here? Many thanks for your reply, Aditya. I find it simpler to write macros where there is clean communicating between tex and lua. For example: [...] \define[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} This is the first time I see that way of wrapping an argument. In any case, I cannot compare to a number: \startluacode userdata = userdata or {} function userdata.numbersfname(name) return string.match(name, "%d+") end \stopluacode \define[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} Untested: \defineexpandable[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help comparing strings
On 10/13/20 6:14 PM, Wolfgang Schuster wrote: > Pablo Rodriguez schrieb am 13.10.2020 um 17:33: >> [...] >> 2. Is there no Lua version of \getvariable{...}{...}? > > There is no need because everything is stored in a Lua table. > [...] > local argumentlist = document.arguments.arguments > local argumenttable = utilities.parsers.settings_to_hash(argumentlist) > > context(argumenttable["fname"]) Many thanks for your reply, Wolfgang. This is exactly what I need. Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help comparing strings
On 10/13/20 5:54 PM, Aditya Mahajan wrote: > On Tue, 13 Oct 2020, Pablo Rodriguez wrote: >> [...] >> Could anyone explain me what I’m missing here? Many thanks for your reply, Aditya. > I find it simpler to write macros where there is clean communicating > between tex and lua. For example: > [...] > \define[1]\numbersfname > {\cldcontext{userdata.numbersfname([==[#1]==])}} This is the first time I see that way of wrapping an argument. In any case, I cannot compare to a number: \startluacode userdata = userdata or {} function userdata.numbersfname(name) return string.match(name, "%d+") end \stopluacode \define[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} \starttext \numbersfname{abc123} \numbersfname{\env{fname}} \doifelse{\numbersfname{\env{fname}}}{123}{yes}{no} \stoptext I don’t know why both strings don’t match. Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help comparing strings
Pablo Rodriguez schrieb am 13.10.2020 um 17:33: Dear list, I have the following sample: \starttext \def\numbersfname {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}} \ctxlua{ c = context.getvariable("environment", "fname") or "a" } \ctxlua{ d = [[\env{fname}]] } tex: \numbersfname\\ \doifelse{} {123}{yes}{no}\\ c: \cldcontext{c}\\ \doifelse{\cldcontext{c:match("\letterpercent d+")}} {123}{yes}{no}\\ d: \cldcontext{d}\\ \doifelse{\cldcontext{d:match("\letterpercent d+")}} {123}{yes}{no} \stoptext For compilation, I run the command: context --purgeall --arguments=fname={abc123} test-file.tex These things are failing: 1. I don’t know how to get \numbersfname equal to "123". I don’t know what I’m doing wrong. 2. Is there no Lua version of \getvariable{...}{...}? There is no need because everything is stored in a Lua table. begin example \starttext \startluacode local argumentlist = document.arguments.arguments local argumenttable = utilities.parsers.settings_to_hash(argumentlist) context(argumenttable["fname"]) \stopluacode \stoptext end example I tested the example with: context --arguments="fname=abc123" 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help comparing strings
On Tue, 13 Oct 2020, Pablo Rodriguez wrote: > Dear list, > > I have the following sample: > > \starttext > \def\numbersfname > {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}} > \ctxlua{ c = context.getvariable("environment", "fname") or "a" } > \ctxlua{ d = [[\env{fname}]] } > > tex: \numbersfname\\ > \doifelse{} > {123}{yes}{no}\\ > c: \cldcontext{c}\\ > \doifelse{\cldcontext{c:match("\letterpercent d+")}} > {123}{yes}{no}\\ > d: \cldcontext{d}\\ > \doifelse{\cldcontext{d:match("\letterpercent d+")}} > {123}{yes}{no} > \stoptext > > For compilation, I run the command: > > context --purgeall --arguments=fname={abc123} test-file.tex > > These things are failing: > > 1. I don’t know how to get \numbersfname equal to "123". I don’t know > what I’m doing wrong. > > 2. Is there no Lua version of \getvariable{...}{...}? > > 3. I’m trying this on a Linux box, but on Windows I would say that Lua > variable "d" is empty. > > I need to get the number from \env{fname} and I don’t know what I’m > missing. \doif is the way to test whether it’s right. > > Could anyone explain me what I’m missing here? I find it simpler to write macros where there is clean communicating between tex and lua. For example: \startluacode userdata = userdata or {} function userdata.numbersfname(name) return string.match(name, "%d+") end \stopluacode \define[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} \starttext \numbersfname{abc123} \numbersfname{\env{fname}} \stoptext Aditya___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] need help comparing strings
Dear list, I have the following sample: \starttext \def\numbersfname {\cldcontext{string.match([[\env{fname}]], "\letterpercent d+")}} \ctxlua{ c = context.getvariable("environment", "fname") or "a" } \ctxlua{ d = [[\env{fname}]] } tex: \numbersfname\\ \doifelse{} {123}{yes}{no}\\ c: \cldcontext{c}\\ \doifelse{\cldcontext{c:match("\letterpercent d+")}} {123}{yes}{no}\\ d: \cldcontext{d}\\ \doifelse{\cldcontext{d:match("\letterpercent d+")}} {123}{yes}{no} \stoptext For compilation, I run the command: context --purgeall --arguments=fname={abc123} test-file.tex These things are failing: 1. I don’t know how to get \numbersfname equal to "123". I don’t know what I’m doing wrong. 2. Is there no Lua version of \getvariable{...}{...}? 3. I’m trying this on a Linux box, but on Windows I would say that Lua variable "d" is empty. I need to get the number from \env{fname} and I don’t know what I’m missing. \doif is the way to test whether it’s right. Could anyone explain me what I’m missing here? Many thanks, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help processing XML in luacode
Hello Massi, thanks for you help. > Am 10.03.2020 um 20:53 schrieb mf : > > In your tex file, try this: > > \startluacode > settings = {} > docstruktur = {} > doclistfile = "doclist.xml" > > local striplines = utilities.strings.striplines > > cropstring = function(s) > -- return striplines(s, "prune and collapse") > return striplines(s) > end Well, with this definition I can actually inline that. > local xmltext= xml.text > > doc = xml.load(doclistfile, settings) > > for v in xml.collected(doc,"/doclist/psdoc/") do > -- print (v) > -- print (xml.text(v,"/docnr")) > local docnr = cropstring(xml.text(v,"/docnr")) > print (docnr) > local docname = cropstring(xmltext(v,"/docname")) > -- es kann mehrere DOCAN geben! > local docan = (cropstring(xmltext(v,"/docan"))) > local docverantwortlich = (cropstring(xmltext(v,"/docverantwortlich"))) > docstruktur[docnr]={ >docname = docname, >docan = docan, >docverantwortlich = docverantwortlich > } Great, that is even shorter. > end > \stopluacode I’m cleaning up my backend code to make it more Lua like. Greetings Axel ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help processing XML in luacode
In your tex file, try this: \startluacode settings = {} docstruktur = {} doclistfile = "doclist.xml" local striplines = utilities.strings.striplines local xmltext= xml.text cropstring = function(s) -- return striplines(s, "prune and collapse") return striplines(s) end doc = xml.load(doclistfile, settings) for v in xml.collected(doc,"/doclist/psdoc/") do -- print (v) -- print (xml.text(v,"/docnr")) local docnr = cropstring(xml.text(v,"/docnr")) print (docnr) local docname = cropstring(xmltext(v,"/docname")) -- es kann mehrere DOCAN geben! local docan = (cropstring(xmltext(v,"/docan"))) local docverantwortlich = (cropstring(xmltext(v,"/docverantwortlich"))) docstruktur[docnr]={ docname = docname, docan = docan, docverantwortlich = docverantwortlich } -- docstruktur[docnr]["docname"] = docname -- docstruktur[docnr]["docan"] = docan -- docstruktur[docnr]["docverantwortlich"] = docverantwortlich end \stopluacode hoping it helps, Massi ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Need help processing XML in luacode
Hi, after one year I’m back at a project processing XML with ConTeXt. Here is what I want to do: I have an XML file that I want to format with ConTeXt. I got this working last year. Now I want to take some information from a second file. My idea is to read the second file, store the data into a table and write auxiliary functions to access the data and insert them into the TeX output. When I process the included files with context --environment=prozess-style-ecm.tex prozess.xml I get [ctxlua]:19: table index is nil 12 13 doc = xml.load(doclistfile, settings) 14 15 for v in xml.collected(doc,"/doclist/psdoc/") do 16 -- print ((xml.filter(v,"//docnr/stripped()"))) 17 docnr = (cropstring(xml.filter(v,"/docnr/text()"))) 18 docname = (cropstring(xml.filter(v,"/docname/text()"))) 19 -- es kann mehrere DOCAN geben! 20 docan = (cropstring(xml.filter(v,"/docan/text()"))) 21 docverantwortlich = (cropstring(xml.filter(v,"/docverantwortlich/text()"))) 22 >> docstruktur[docnr]={} The xml.collected works, but the xml.filter returns nil. What did I miss? mtx-context | ConTeXt Process Management 1.03 mtx-context | mtx-context | main context file: /Volumes/Macintosh HD/usr/local/texlive/context-109/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2020.01.30 14:13 mtx-context | main context file: /Volumes/Macintosh HD/usr/local/texlive/context-109/tex/texmf-context/tex/context/base/mkiv/context.mkxl mtx-context | current version: 2020.01.30 14:13 The same code works when I use it in a Lua file that I call with mtxrun --script panalyse.lua Greetings Axel doclist.xml Description: XML document prozess.xml Description: XML document prozess-style-ecm.tex Description: Binary data ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
Axel Kielhorn schrieb am 05.10.18 um 18:44: Am 05.10.2018 um 17:33 schrieb Wolfgang Schuster : I took a look at your example files and there a few things which can be improved. Product file: 1. You don’t need the actual name of the current file and use * instead 2. You can use brackets as delimiters for the file name instead of a space after the name Does this mean I can use a space in the filename? It’s possible but the safer method is to use a underscore or hyphen in file names. 3. In products you can put all content in a document environment which has hooks to insert text etc. at the begin and end of the document (which can be used to insert a titlepage or endpage). You can even use \startdocument (or \setupdocument) to set the document name in the pdf viewer (yes it can also be done with \setupinteraction but \startdocument is nicer). A minimal file would be \startproduct [*] \project [project_skel] \startdocument \component [c_01] \component [c_02] \stopdocument \stopproduct or [..] Environment file: 1. Don’t load the project from your environment file 2. Don’t use \usepath to set the folders for the product files, use it instead to set the folders for your component files which are loaded from the products Does this mean that I should use a product level environment file for the \usepath? (Accessing things like ../img_global?) With \usepath (and \usesubpath) you can set folders which are searched when you use the \component command to load chapters etc. in your product (or component) files. To load images from other folder you use \setupexternalfigure[directory=...] where you can also use "../images" to load them from a global folder for all documents in your project. 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
> Am 05.10.2018 um 17:33 schrieb Wolfgang Schuster > : > > I took a look at your example files and there a few things which can be > improved. > > > Product file: > > 1. You don’t need the actual name of the current file and use * instead > > 2. You can use brackets as delimiters for the file name instead of a space > after the name Does this mean I can use a space in the filename? > > 3. In products you can put all content in a document environment which has > hooks to insert text etc. at the begin and end of the document (which can be > used to insert a titlepage or endpage). You can even use \startdocument (or > \setupdocument) to set the document name in the pdf viewer (yes it can also > be done with \setupinteraction but \startdocument is nicer). > > A minimal file would be > > \startproduct [*] > > \project [project_skel] > > \startdocument > > \component [c_01] > \component [c_02] > > \stopdocument > > \stopproduct > > or [..] > Environment file: > > 1. Don’t load the project from your environment file > > 2. Don’t use \usepath to set the folders for the product files, use it > instead to set the folders for your component files which are loaded from the > products Does this mean that I should use a product level environment file for the \usepath? (Accessing things like ../img_global?) > 3. You can remove the braces around the subfolder which aren’t necessary. Thanks for the clarification. I have updated my project. Greetings Axel ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
Taco Hoekwater schrieb am 04.10.18 um 09:27: Hi, On 4 Oct 2018, at 08:47, Axel Kielhorn wrote: Hello, this is my second try to start with context and I can’t even do the first step. I’m planing to convert a large but simple document to context. The document consists of 3 Parts. Each part has several chapters. Thus I started to build a project with three products, see enclosed archive. According to my understanding I should be able to context c_01 to get one chapter context prd_A to get one product context project_ecm to get the whole book. Any whole book should be a product, and the Parts should just be components. The project level is only there to connect meta-info across a book series. You are not supposed to run ‘context’ on the project file. That said, it is definitely not your installation or understanding of the wiki page that creates the circular inclusion. The same happens here. I discovered it works OK if I move the \product to within the \startcomponent, and I assume that is how it supposed to work: \startcomponent \product prd_1 … \stopcomponent At a guess, I think the wiki page is wrong. But before editing that, I would like to have confirmation of the above assumption. The \product command is more or less useless because it provides only the information of the main file of the document. The real question is where you should put the \project or \environment commands. When you put them before \startproduct you’re loading your fonts before the start of the document and the Latin Modern fallback isn’t used but when you put them after \startproduct you load your font after the Latin Modern fallback. One advantage when you load the project/environment after \startproduct (or \startcomponent) is that you can use the product or component modes in your environment file to set different image or subpath folder dependant on which file type you typeset. In the end it doesn’t matter whether you load your project/environment before or after \startproduct because there is no difference. 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
I took a look at your example files and there a few things which can be improved. Product file: 1. You don’t need the actual name of the current file and use * instead 2. You can use brackets as delimiters for the file name instead of a space after the name 3. In products you can put all content in a document environment which has hooks to insert text etc. at the begin and end of the document (which can be used to insert a titlepage or endpage). You can even use \startdocument (or \setupdocument) to set the document name in the pdf viewer (yes it can also be done with \setupinteraction but \startdocument is nicer). A minimal file would be \startproduct [*] \project [project_skel] \startdocument \component [c_01] \component [c_02] \stopdocument \stopproduct or \startproduct [*] \project [project_skel] \startdocument \startbodymatter \component [c_01] \component [c_02] \stopbodymatter \stopdocument \stopproduct Environment file: 1. Don’t load the project from your environment file 2. Don’t use \usepath to set the folders for the product files, use it instead to set the folders for your component files which are loaded from the products 3. You can remove the braces around the subfolder which aren’t necessary. Wolfgang Axel Kielhorn schrieb am 05.10.18 um 08:31: Am 04.10.2018 um 20:59 schrieb Henning Hraban Ramm : Am 2018-10-04 um 10:08 schrieb Axel Kielhorn : Thus having the whole file inside \start{project|product|component} \stop… would be a good idea and consistent. That’s what I do. Since I wrote that wiki page (some years ago) I’ll change it. I appreciate that. How about offering a skeleton project for download? Here is my corrected ECM with the following README: This is a skeleton project. You can copy it and change the files to contain your content. The top level project collects metatdata to make all products have the same layout. It is not meant to be processed by context. The products are used to generate the whole book, but you can process each component seperately to reduce the processing time. Greetings Axel ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
Am 2018-10-05 um 08:31 schrieb Axel Kielhorn : > How about offering a skeleton project for download? I’m offering a Python script that creates projects: https://github.com/fiee/tools/blob/master/contextproject.py This avoids renaming everything. In my bigger projects I use additional shell scripts to create directories and generic content (e.g. ISBN barcode). Since these are very specific it wouldn’t make sense to share them. Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
> Am 04.10.2018 um 20:59 schrieb Henning Hraban Ramm : > > Am 2018-10-04 um 10:08 schrieb Axel Kielhorn : > >> Thus having the whole file inside \start{project|product|component} \stop… >> would be a good idea and consistent. > > That’s what I do. > Since I wrote that wiki page (some years ago) I’ll change it. I appreciate that. How about offering a skeleton project for download? Here is my corrected ECM with the following README: This is a skeleton project. You can copy it and change the files to contain your content. The top level project collects metatdata to make all products have the same layout. It is not meant to be processed by context. The products are used to generate the whole book, but you can process each component seperately to reduce the processing time. <> Greetings Axel___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
Am 2018-10-04 um 10:08 schrieb Axel Kielhorn : > Thus having the whole file inside \start{project|product|component} \stop… > would be a good idea and consistent. That’s what I do. Since I wrote that wiki page (some years ago) I’ll change it. Greetlings, Hraban --- https://www.fiee.net http://wiki.contextgarden.net https://www.dreiviertelhaus.de GPG Key ID 1C9B22FD ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
> Am 04.10.2018 um 09:27 schrieb Taco Hoekwater : > >> According to my understanding I should be able to >> context c_01 to get one chapter >> context prd_A to get one product >> context project_ecm to get the whole book. > > Any whole book should be a product, and the Parts should just be components. > The project level is only there to connect meta-info across a book series. > You are not supposed to run ‘context’ on the project file. I see. I’ll probably keep it as three books. It’s easy to change later as long as the components have different names. Right now that’s just a limitation of the word processor. > That said, it is definitely not your installation or understanding of the > wiki page that creates the circular inclusion. The same happens here. I > discovered it works OK if I move the \product to within the \startcomponent, > and I assume that is how it supposed to work: > > \startcomponent > \product prd_1 > … > \stopcomponent Works here as well, thank you. What about the project? Right now it is outside the \start{product|component} and it works. Now it is inside the \start{product|component} and it works as well. Next question: Should the environment be inside \startproject \stopproject? It seems to make no difference. Thus having the whole file inside \start{project|product|component} \stop… would be a good idea and consistent. > At a guess, I think the wiki page is wrong. But before editing that, > I would like to have confirmation of the above assumption. Thanks for the quick response, now I can tell pandoc to convert the book to context:-) Greetings Axel ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with project: TeX capacity exceeded
Hi, > On 4 Oct 2018, at 08:47, Axel Kielhorn wrote: > > Hello, > > this is my second try to start with context and I can’t even do the first > step. > > I’m planing to convert a large but simple document to context. > The document consists of 3 Parts. > Each part has several chapters. > > Thus I started to build a project with three products, see enclosed archive. > > According to my understanding I should be able to > context c_01 to get one chapter > context prd_A to get one product > context project_ecm to get the whole book. Any whole book should be a product, and the Parts should just be components. The project level is only there to connect meta-info across a book series. You are not supposed to run ‘context’ on the project file. That said, it is definitely not your installation or understanding of the wiki page that creates the circular inclusion. The same happens here. I discovered it works OK if I move the \product to within the \startcomponent, and I assume that is how it supposed to work: \startcomponent \product prd_1 … \stopcomponent At a guess, I think the wiki page is wrong. But before editing that, I would like to have confirmation of the above assumption. Best wishes, Taco ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Need help with project: TeX capacity exceeded
Hello, this is my second try to start with context and I can’t even do the first step. I’m planing to convert a large but simple document to context. The document consists of 3 Parts. Each part has several chapters. Thus I started to build a project with three products, see enclosed archive. According to my understanding I should be able to context c_01 to get one chapter context prd_A to get one product context project_ecm to get the whole book. The first two steps lead to circular inclusion and the TeX capacity error. The last step doesn’t load the products and creates no files. I got my information from https://wiki.contextgarden.net/Project_structure and think I adapted them correctly, but obviously I didn’t. I included the log files in case there is something broken with my setup. Greetings Axel <> ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Need help defining command.
HI All, I remember seeing some seeing what I want to do but I can not find it. I would like to define a command that takes an optional key-valued list and 1 or 2 manditory ones. Something like \unexanded\def\MyCommand[#1]#2% {% \NassiGroupFrame[#1]{#2}% }% or \unexanded\def\MyCommand[#1]#2% {% % extract keyvalue \NassiGroupFrame[\width=\extractedvalueone]{hbox to \extractvaletwo{#2}}% }% where \NassiGroupFrame is a Frame. To give you an idea why I need this see the MWE below. This is a relatively simple example, there will be more complicated frames and they will be nested. Maybe I am chasing windmills and there is a better way and I should use cld or lua for outputing the Frames so that I can have spacing between the command and avoid having to use % after the first opening {. Or does someone know how it can be done. Is there a way to use ConTeXt to write the command Pointers, help welcome. MWE: % %% NassiSimpleFrameBox %% %% Draw a box around a frame using exact height %% and width. to use it use overlay NassiSimpleFrameBox %% \startuniqueMPgraphic{NassiSimpleFrameBox} pickup pencircle scaled \overlaylinewidth ; draw (0,0) -- (0, OverlayHeight) -- (OverlayWidth, OverlayHeight) -- (OverlayWidth, 0) -- cycle withcolor OverlayLineColor; \stopuniqueMPgraphic %% Define Overlay for NassiSimpleFrameBox %% \defineoverlay[NassiSimpleFrameBox][\uniqueMPgraphic{NassiSimpleFrameBox}] %% % % %% NassiGroupFrameBox %% %% Draw a box around a frame which contains several %% structures. Since the frame size containing the structures %% has a \rulethickness frame around then we have to adjust %% so that we can draw on top of its bounding box %% \startuniqueMPgraphic{NassiGroupFrameBox} numeric DoubleLineWidth, TrueWidth, TrueHeight; DoubleLineWidth := 2 * OverlayLineWidth; TrueHeight := OverlayHeight - DoubleLineWidth; TrueWidth := OverlayWidth - DoubleLineWidth; pickup pencircle scaled OverlayLineWidth; draw (0,0) -- (0, TrueHeight) -- (TrueWidth, TrueHeight) -- (TrueWidth, 0) -- cycle withcolor OverlayLineColor; \stopuniqueMPgraphic \defineoverlay[NassiGroupFrameBox][\uniqueMPgraphic{NassiGroupFrameBox}] %% % % %% NassiSimpleFrame %% %% Frame for putting a frame around it. %% Location is set so that they can be stack %% on top of each other. \defineframed[NassiSimpleFrame] \setupframed[NassiSimpleFrame] [width=5cm, frame=off, background=NassiSimpleFrameBox, rulethickness=1pt, framecolor=blue, offset=0pt, frameoffset=0pt, location=lohi] %% % % %% NassiGroupFrame %% %% Frame for putting a frame around a block of %% structures. Since it surrounds a group we use %% fit for Height and Width. %% So that the The frame gets draw on top that the %% the background has to be setup accordingly. \defineframed[NassiGroupFrame] \setupframed[NassiGroupFrame] [width=fit, height=fit, frame=off, rulethickness=3pt, framecolor=green, offset=0pt, background={foreground, NassiGroupFrameBox}, frameoffset=0pt, align=middle, strut=no] %% % %% Frame a Statement %% The text inside the frame is adjust to %% leave room for the frame \unexpanded\def\Statement#1% {% \NassiSimpleFrame[width=5cm,framecolor=red]{\vbox{\hsize \dimexpr\framedparameter{width} * 9/10\relax \strut #1}}% }% \unexpanded\def\MyGroup#1% {% \NassiGroupFrame{\hbox to 10cm% {#1}} }% \unexpanded\def\MyBlock#1% {% \vtop{{\hsize 5cm#1}}% }% \starttext \NassiGroupFrame{% \vbox{\hsize 5cm% \Statement{This is a test This is a test This is a test This is a test This is a test This is a test} \Statement{This $is^a$ test } \Statement{This $is^a$ test This is a test This is a test This is a test This is a test This is a test} }} \MyGroup{% How do I avoid comment here \MyBlock{ \Statement{This is a test This is a test This is a test This is a test This is a test This is a test} \Statement{This $is^a$ test } }% How do I avoid comment here \MyBlock{\Statement{This is a test This is a test This is a test This is a test This is a test This is a test} } } \stoptext regards Keith. ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help defining command.
Am 22.10.2013 um 10:34 schrieb Keith J. Schultz schul...@uni-trier.de: HI All, I remember seeing some seeing what I want to do but I can not find it. I would like to define a command that takes an optional key-valued list and 1 or 2 manditory ones. Something like \unexanded\def\MyCommand[#1]#2% {% \NassiGroupFrame[#1]{#2}% }% \unexanded\def\MyCommand {\dosingleempty\doMyCommand} \def\doMyCommand[#1]#2% {\NassiGroupFrame[#1]{#2}} or \unexanded\def\MyCommand[#1]#2% {% % extract keyvalue \NassiGroupFrame[\width=\extractedvalueone]{hbox to \extractvaletwo{#2}}% }% \unexanded\def\MyCommand {\dosingleempty\doMyCommand} \def\doMyCommand[#1]#2% {\begingroup \getdummyparameters[valueone=6cm,valuetwo=5cm,#1] \NassiGroupFrame[width=\dummyparameter{valueone}]{\hbox to \dummyparameter{valuetwo}{#2}}% \endgroup} \MyCommand[valuetwo=4cm]{...} where \NassiGroupFrame is a Frame. To give you an idea why I need this see the MWE below. This is a relatively simple example, there will be more complicated frames and they will be nested. Maybe I am chasing windmills and there is a better way and I should use cld or lua for outputing the Frames so that I can have spacing between the command and avoid having to use % after the first opening {. Or does someone know how it can be done. Is there a way to use ConTeXt to write the command There are ways to ignore the spaces at the begin (\ignorespaces) and end (\removeunwantedspaces) of a group but you should rethink first your interface for your commands (why no start/stop commands). It can be also useful to draw the whole diagram with Metapost and use the TeX commands only to pass the content to Metapost. 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help defining command.
Hi Wolfgang, to be honest one of my design considerations was to this work using MetaPost. But, my knowledge of MetaPost is minimal and it would be involved calculating the positions of the Frames/boxes and I need to know the sizes of the formatted text, etc Another approach would be to use layer, but I can not find much documentation about how/if they can be used inside of a frame. regards Keith Am 22.10.2013 um 11:31 schrieb Wolfgang Schuster schuster.wolfg...@gmail.com: [snip, snip] There are ways to ignore the spaces at the begin (\ignorespaces) and end (\removeunwantedspaces) of a group but you should rethink first your interface for your commands (why no start/stop commands). It can be also useful to draw the whole diagram with Metapost and use the TeX commands only to pass the content to Metapost. ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help defining command.
Hi Wolfgang, Am 22.10.2013 um 11:31 schrieb Wolfgang Schuster schuster.wolfg...@gmail.com: Am 22.10.2013 um 10:34 schrieb Keith J. Schultz schul...@uni-trier.de: HI All, I remember seeing some seeing what I want to do but I can not find it. I would like to define a command that takes an optional key-valued list and 1 or 2 manditory ones. Something like \unexanded\def\MyCommand[#1]#2% {% \NassiGroupFrame[#1]{#2}% }% \unexanded\def\MyCommand {\dosingleempty\doMyCommand} \def\doMyCommand[#1]#2% {\NassiGroupFrame[#1]{#2}} or \unexanded\def\MyCommand[#1]#2% {% % extract keyvalue \NassiGroupFrame[\width=\extractedvalueone]{hbox to \extractvaletwo{#2}}% }% \unexanded\def\MyCommand {\dosingleempty\doMyCommand} \def\doMyCommand[#1]#2% {\begingroup \getdummyparameters[valueone=6cm,valuetwo=5cm,#1] \NassiGroupFrame[width=\dummyparameter{valueone}]{\hbox to \dummyparameter{valuetwo}{#2}}% \endgroup} \MyCommand[valuetwo=4cm]{...} where \NassiGroupFrame is a Frame. To give you an idea why I need this see the MWE below. This is a relatively simple example, there will be more complicated frames and they will be nested. Maybe I am chasing windmills and there is a better way and I should use cld or lua for outputing the Frames so that I can have spacing between the command and avoid having to use % after the first opening {. Or does someone know how it can be done. Is there a way to use ConTeXt to write the command There are ways to ignore the spaces at the begin (\ignorespaces) and end (\removeunwantedspaces) of a group but you should rethink first your interface for your commands (why no start/stop commands). I thought about that, but I do not know I could use start/-commands in this context! regards Keith ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with \definetabulate
Thank you. Yes, that helps. Regards, Malte. On 16/10/2012, at 20:21, Malte Stien wrote: Any pointers anyone? I need to get this working and am running out of ideas. Thank you, Malte. Begin forwarded message: From: Malte Stien ma...@stien.de Date: 15 October 2012 17:03:42 To: ntg-context@ntg.nl Subject: Re: [NTG-context] Need help with \definetabulate Marco, \definetabulate [alpha] [|l|l|l|] \setuptabulate [alpha] [bodyfont=small] This does not work for me quite the way I need it to. I am really just after defining the font-size, but I would like to leave the column setup to the user (I am building an environment and that I would like everyone in my team to use to ensure a consistent look-and-feel or all documents). So, ideally, I would like to do this: \definetabulate [alpha] \setuptabulate [alpha] [bodyfont=small] \starttext[|l|l|l|] \startalpha \NC first \NC second \NC third \NC\NR \stopalpha \stoptext ...but that does not seem to work. Any way I can achieve this? Feel free to add an example. It's a wiki! Sure. Will do, once I have this working. Thank you, Malte. Hi Malte I am trying to define two tabulate styles as follows: - \setuptabulate[split=yes, bodyfont=small] - \setuptabulate[split=yes] \definetabulate [alpha] [|l|l|l|] \setuptabulate [alpha] [bodyfont=small] \definetabulate [beta] [|l|l|] \setuptabulate [beta] [bodyfont=small, split=yes] \starttext \startalpha \NC first \NC second \NC third \NC\NR \stopalpha \startbeta \NC lorem \NC ipsum \NC\NR \stopbeta \stoptext ...such that I can just refer to them when I \starttabulate...\stoptabulate somewhere. To refer to a table, you place it as a float and use the `reference=tab:alphatable` key. Then in the text you refer to the table, see \in{table}[tab:alphatable]. I thought, the command \definetabulate would come in handy here, but I can't work it out and it appears the documentation on that command is pretty scarce. http://wiki.contextgarden.net/Command/definetabulate Feel free to add an example. It's a wiki! Marco ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with \definetabulate
Am 16.10.2012 um 11:21 schrieb Malte Stien ma...@stien.de: Any pointers anyone? I need to get this working and am running out of ideas. \def\startalpha {\dosingleempty\dostartalpha} \def\dostartalpha[#1]#2\stopalpha {\iffirstargument \starttabulate [#1]#2\stoptabulate \else \starttabulate[|l|p|]#2\stoptabulate \fi} \def\startbeta {\dosingleempty\dostartbeta} \def\dostartbeta[#1]#2\stopbeta {\iffirstargument \starttabulate [#1][bodyfont=small]#2\stoptabulate \else \starttabulate[|l|p|][bodyfont=small]#2\stoptabulate \fi} \starttext \startalpha \NC 1 \NC 2 \NC\NR \stopalpha \startalpha[|l|l|l|] \NC 1 \NC 2 \NC 3 \NC\NR \stopalpha \startbeta \NC 1 \NC 2 \NC\NR \stopbeta \startbeta[|l|l|l|] \NC 1 \NC 2 \NC 3 \NC\NR \stopbeta \stoptext 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with \definetabulate
Marco, \definetabulate [alpha] [|l|l|l|] \setuptabulate [alpha] [bodyfont=small] This does not work for me quite the way I need it to. I am really just after defining the font-size, but I would like to leave the column setup to the user (I am building an environment and that I would like everyone in my team to use to ensure a consistent look-and-feel or all documents). So, ideally, I would like to do this: \definetabulate [alpha] \setuptabulate [alpha] [bodyfont=small] \starttext[|l|l|l|] \startalpha \NC first \NC second \NC third \NC\NR \stopalpha \stoptext ...but that does not seem to work. Any way I can achieve this? Feel free to add an example. It's a wiki! Sure. Will do, once I have this working. Thank you, Malte. Hi Malte I am trying to define two tabulate styles as follows: - \setuptabulate[split=yes, bodyfont=small] - \setuptabulate[split=yes] \definetabulate [alpha] [|l|l|l|] \setuptabulate [alpha] [bodyfont=small] \definetabulate [beta] [|l|l|] \setuptabulate [beta] [bodyfont=small, split=yes] \starttext \startalpha \NC first \NC second \NC third \NC\NR \stopalpha \startbeta \NC lorem \NC ipsum \NC\NR \stopbeta \stoptext ...such that I can just refer to them when I \starttabulate...\stoptabulate somewhere. To refer to a table, you place it as a float and use the `reference=tab:alphatable` key. Then in the text you refer to the table, see \in{table}[tab:alphatable]. I thought, the command \definetabulate would come in handy here, but I can't work it out and it appears the documentation on that command is pretty scarce. http://wiki.contextgarden.net/Command/definetabulate Feel free to add an example. It's a wiki! Marco ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with \definetabulate
2012-10-08 Malte Stien: Hi Malte I am trying to define two tabulate styles as follows: - \setuptabulate[split=yes, bodyfont=small] - \setuptabulate[split=yes] \definetabulate [alpha] [|l|l|l|] \setuptabulate [alpha] [bodyfont=small] \definetabulate [beta] [|l|l|] \setuptabulate [beta] [bodyfont=small, split=yes] \starttext \startalpha \NC first \NC second \NC third \NC\NR \stopalpha \startbeta \NC lorem \NC ipsum \NC\NR \stopbeta \stoptext ...such that I can just refer to them when I \starttabulate...\stoptabulate somewhere. To refer to a table, you place it as a float and use the `reference=tab:alphatable` key. Then in the text you refer to the table, see \in{table}[tab:alphatable]. I thought, the command \definetabulate would come in handy here, but I can't work it out and it appears the documentation on that command is pretty scarce. http://wiki.contextgarden.net/Command/definetabulate Feel free to add an example. It's a wiki! Marco ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] need help with macro
Hi all, I have a macro “mogrify” that eats three tokens of a string and treats them differently from the rest of the string. I can’t however use it inside more complex macros. Is there a way out or an alternative using macros? (No Lua.) Other formatting macros work fine in the same place. Any help will be greatly appreciated Philipp · Example Code % macros=mkvi \unprotect \def\mogrify#content{% \begingroup \let\stopper\relax \def\get_first_three##1##2##3##4\stopper{% \def\first_three{##1##2##3}% \def\rest{##4}% }% \get_first_three#content\stopper% \colored[red]{\first_three}% \colored[green]{\rest}% \endgraf \endgroup% } \installnamespace {ww} \installcommandhandler \ww {ww} \ww \appendtoks \setuevalue{\currentww}{\wont_work[\currentww]} \to \everydefineww \unexpanded\def\wont_work[#id]{% \edef\current_wont_work{#id}% \dosingleempty\wont_work_indeed% } \def\wont_work_indeed[#setups]#content{% \iffirstargument\setupcurrentww[#setups]\fi %% here is the problem: \doifsomething{\wwparameter{param}}{\mogrify{\wwparameter{param}}}% \endgraf \framed{#content}% } \defineww[wontwork] \protect \starttext \mogrify{foobar}\par%% the macro does work in isolation \wontwork[param=whatever]{will it work?} \wontwork[param=]{this, however, does work} \stoptext ··· -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpzESMbggoT5.pgp Description: PGP signature ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help with macro
Am 23.09.2012 um 15:33 schrieb Philipp Gesang ges...@stud.uni-heidelberg.de: Hi all, I have a macro “mogrify” that eats three tokens of a string and treats them differently from the rest of the string. I can’t however use it inside more complex macros. Is there a way out or an alternative using macros? (No Lua.) Other formatting macros work fine in the same place. Any help will be greatly appreciated Philipp · Example Code % macros=mkvi \unprotect \def\mogrify#content{% \begingroup \let\stopper\relax \def\get_first_three##1##2##3##4\stopper{% \def\first_three{##1##2##3}% \def\rest{##4}% }% \get_first_three#content\stopper% \colored[red]{\first_three}% \colored[green]{\rest}% \endgraf \endgroup% } \installnamespace {ww} \installcommandhandler \ww {ww} \ww \appendtoks \setuevalue{\currentww}{\wont_work[\currentww]} \to \everydefineww \unexpanded\def\wont_work[#id]{% \edef\current_wont_work{#id}% \dosingleempty\wont_work_indeed% } \def\wont_work_indeed[#setups]#content{% \iffirstargument\setupcurrentww[#setups]\fi %% here is the problem: \doifsomething{\wwparameter{param}}{\mogrify{\wwparameter{param}}}% \endgraf \framed{#content}% } \defineww[wontwork] \protect \starttext \mogrify{foobar}\par%% the macro does work in isolation \wontwork[param=whatever]{will it work?} \wontwork[param=]{this, however, does work} \stoptext It’s a expansion problem, you can either expand the content in the definition of \mogrify (as seen below) or you make the \mogrify command unexpanded and you expand the content of the \wwparameter (i.e. \doifsomething{…}{\normalexpanded{\mogrify{…}}}) \unprotect \def\mogrify_scan#first#second#third#rest\relax {\def\m_mogrify_three{#first#second#third}% \def\m_mogrify_rest {#rest}} \def\mogrify#content% {\begingroup \edef\m_mogrify_content{#content}% \expandafter\mogrify_scan\m_mogrify_content\relax \colored [red]{\m_mogrify_three}% \colored[green]{\m_mogrify_rest }% \endgraf \endgroup} \installnamespace {ww} \installcommandhandler \ww {ww} \ww \appendtoks \setuevalue{\currentww}{\wont_work[\currentww]} \to \everydefineww \unexpanded\def\wont_work[#id]% {\edef\currentww{#id}% \dosingleempty\wont_work_indeed} \def\wont_work_indeed[#setups]#content% {\iffirstargument\setupcurrentww[#setups]\fi \doifsomething{\wwparameter{param}}{\mogrify{\wwparameter{param}}}% \endgraf \framed{#content}} \defineww[wontwork] \protect \starttext \mogrify{foobar}\par%% the macro does work in isolation \wontwork[param=whatever]{will it work?} \wontwork[param=]{this, however, does work} \stoptext 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] need help with macro
···date: 2012-09-23, Sunday···from: Wolfgang Schuster··· It’s a expansion problem, you can either expand the content in the definition of \mogrify (as seen below) or you make the \mogrify command unexpanded and you expand the content of the \wwparameter (i.e. \doifsomething{…}{\normalexpanded{\mogrify{…}}}) Thanks a lot, I rewrote my macros according to your the first suggestion and it works like a breeze. Best regards Philipp \unprotect \def\mogrify_scan#first#second#third#rest\relax {\def\m_mogrify_three{#first#second#third}% \def\m_mogrify_rest {#rest}} \def\mogrify#content% {\begingroup \edef\m_mogrify_content{#content}% \expandafter\mogrify_scan\m_mogrify_content\relax \colored [red]{\m_mogrify_three}% \colored[green]{\m_mogrify_rest }% \endgraf \endgroup} \installnamespace {ww} \installcommandhandler \ww {ww} \ww \appendtoks \setuevalue{\currentww}{\wont_work[\currentww]} \to \everydefineww \unexpanded\def\wont_work[#id]% {\edef\currentww{#id}% \dosingleempty\wont_work_indeed} \def\wont_work_indeed[#setups]#content% {\iffirstargument\setupcurrentww[#setups]\fi \doifsomething{\wwparameter{param}}{\mogrify{\wwparameter{param}}}% \endgraf \framed{#content}} \defineww[wontwork] \protect \starttext \mogrify{foobar}\par%% the macro does work in isolation \wontwork[param=whatever]{will it work?} \wontwork[param=]{this, however, does work} \stoptext 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpVn3fl4w27P.pgp Description: PGP signature ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Need help
Hi, Mu current chapter setup is as below: \def\HeadTitle#1#2% {\hbox to \hsize \bgroup \hfill \setupframed[offset=.5em,frame=off] \tbox{\framed[width=3cm,align=left]{#1}}% \tbox{\framed[width=4cm,align=right,leftframe=on]{#2}}% \egroup} \setuphead [chapter] [color=green1, textstyle=, align=normal, continue=no, page=right, style=\tfc, before={\blank[2*big]}, after={\blank[2*big]}, command=\HeadTitle] I want a local TOC after each chapter title. If I manually put \placelist[section][criterium=chapter] immediately after \chapter command then it does not work. Please help. -- Best regards, Shiv Shankar Dayal ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] need help getting context to work on windows
I would like some help setting context to work on my windows xp machine, I don't know if here I am supposed to ask so you'll forgive me. So, I tried edit the sample tex hello world in Scite editor and when I process it I get this: mtxrun --autogenerate --script context --autopdf --pdf simple_doc.tex mtxrun | forcing cache reload resolvers | resolving | unknown configuration file 'C:///texmf-local/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmf-local/web2c/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmf/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmf/web2c/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmfcnf.lua' resolvers | resolving | resolvers | resolving | warning: no lua configuration files found resolvers | resolving | no texmf paths are defined (using TEXMF) resolvers | resolving | mtxrun | the resolver databases are not present or outdated resolvers | resolving | using suffix based filetype 'lua' resolvers | resolving | using suffix based filetype 'lua' resolvers | resolving | remembered file 'mtx-context.lua' resolvers | resolving | using suffix based filetype 'lua' resolvers | resolving | unknown configuration file 'C:///texmf-local/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmf-local/web2c/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmf/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmf/web2c/texmfcnf.lua' resolvers | resolving | unknown configuration file 'C:///texmfcnf.lua' resolvers | resolving | resolvers | resolving | warning: no lua configuration files found resolvers | resolving | no texmf paths are defined (using TEXMF) resolvers | resolving | resolvers | resolving | remembered file 'mtx-context.lua' resolvers | resolving | remembered file 'mtx-contexts.lua' resolvers | resolving | remembered file 'mtx-context.lua' resolvers | resolving | remembered file 'context.lua' mtxrun | unknown script 'context.lua' or 'mtx-context.lua'Exit code: 1 I mention that because the Gui installer dind't work for me , I had to install context minimals from the command -line as instructed in the wiki so I have it in C:\context\ and for Scite I've used the installer so it went in C:\Program Files\Scite. I've also executed the setuptex.bat file. Also have the 3 configuration files mentioned in the wiki in their place. I am using last version, I have neither ruby nor perl installed, I am using windows xp sp3, both administrator and limited user accounts, same problem. Is there a way to get this work? ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with \setuphead and spacing
On 2011-04-02 Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 02.04.2011 um 13:59 schrieb Marco: \setuphead [chapter,section] [command=\myseccmd] \def\myseccmd#1#2{\hbox to .75cm{#1}#2} \setuphead[chapter,section][numberwidth=0.75cm] You read the source, cheater! ;) Marco ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Need help with the table of contents
Hello everybody, I have a little issue with the table of contents. The document I am writing consists of several parts and now my question is the following: In the table of contents, the line corresponding to the start of a new part always starts like Part 1 Name of first part. How do I get rid of the Part, so that the corresponding line starts directly with the number of the part like 1 Name of the first Part? Thanks alot, Julian -- Julian Becker Institut für Angewandte Physik, R.123 Westfälische Wilhelms-Universität Münster Corrensstr. 2/4 48149 Münster / Westfalen Tel. 0251 83-3 61 53 Mob. 0151 599 848 29 e-mail: j_bec...@uni-muenster.de Keep thy heart with all diligence; for it is the wellspring of life. ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the table of contents
Am 21.03.2011 um 18:14 schrieb Julian Becker: Hello everybody, I have a little issue with the table of contents. The document I am writing consists of several parts and now my question is the following: In the table of contents, the line corresponding to the start of a new part always starts like Part 1 Name of first part. How do I get rid of the Part, so that the corresponding line starts directly with the number of the part like 1 Name of the first Part? \setuplist[part][label=no] 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the table of contents
Thank you Wolfgang for your quick response. Looks great now! 2011/3/21 Wolfgang Schuster schuster.wolfg...@googlemail.com Am 21.03.2011 um 18:14 schrieb Julian Becker: Hello everybody, I have a little issue with the table of contents. The document I am writing consists of several parts and now my question is the following: In the table of contents, the line corresponding to the start of a new part always starts like Part 1 Name of first part. How do I get rid of the Part, so that the corresponding line starts directly with the number of the part like 1 Name of the first Part? \setuplist[part][label=no] 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Julian Becker Institut für Angewandte Physik, R.123 Westfälische Wilhelms-Universität Münster Corrensstr. 2/4 48149 Münster / Westfalen Tel. 0251 83-3 61 53 Mob. 0151 599 848 29 e-mail: j_bec...@uni-muenster.de Keep thy heart with all diligence; for it is the wellspring of life. ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the letter module
Hi Andreas, thank you answering the question. Here is a new feature from the last version (4. April) which works only in mkiv: \usemodule[letter] \starttext \startletter \input knuth\par \ps{postscript} \cc{carbon copy} \encl{enclosure} \stopletter \startletter[postscript={postscript},copy={carbon copy},enclosure={enclosure}] \input knuth\par \stopletter \stoptext 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Need help with the letter module
Hullo, I'm trying to write a letter, but it gets all screwy. The first batch of letter settings works OK (opening, closing, signature); but then the from* and to* blocks fail resulting in a PDF that just quotes that code on a separate page. Clearly I'm doing something wrong although I'm looking at the manuals: http://dl.contextgarden.net/modules/t- letter/doc/context/third/letter/correspondence.pdf MkII from TexLive 2008. Any help welcome :] --[snip]-- \mainlanguage[en] \enableregime[utf8] \setuppapersize[a4][a4] \usemodule[letter] \setupletter [opening={Dear FSFE,}, closing={Best regards,}, signature={Matija Šuklje\\Coordinator FSFE Fellowship group Slovenia}] [fromname={Matija Šuklje}, fromaddress={Dvořakova 10\\SI-1000 Ljubljana\\Slovenia}] [toname={Free Software Foundation Europe e.V.}, toaddress={Talstraße 110\\D-40217 Düsseldorf\\Germany}] \starttext \startletter \input knuth \stopletter \stoptext --[snap]-- -- gsm: +386 41 849 552 www: http://matija.suklje.name xmpp: matija.suk...@gabbler.org ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the letter module
Matija Šuklje wrote: Hullo, I'm trying to write a letter, but it gets all screwy. The first batch of letter settings works OK (opening, closing, signature); but then the from* and to* blocks fail resulting in a PDF that just quotes that code on a separate page. Clearly I'm doing something wrong although I'm looking at the manuals: http://dl.contextgarden.net/modules/t- letter/doc/context/third/letter/correspondence.pdf MkII from TexLive 2008. Any help welcome :] --[snip]-- \mainlanguage[en] \enableregime[utf8] \setuppapersize[a4][a4] \usemodule[letter] \setupletter [opening={Dear FSFE,}, closing={Best regards,}, signature={Matija Šuklje\\Coordinator FSFE Fellowship group Slovenia}] The following should not be a separate parameter. If you put another \setupletter in front of it, it should work. Or just leave out the additional [] pairs. -- \setupletter[opening=..., closing=..., signature=..., fromname=..., fromaddress=...,toname=...,toaddress=...] I usually prefer to split it up: \setupletter[opening.] \setupletter[fromname..] \setupletter[toname.] [fromname={Matija Šuklje}, fromaddress={Dvořakova 10\\SI-1000 Ljubljana\\Slovenia}] [toname={Free Software Foundation Europe e.V.}, toaddress={Talstraße 110\\D-40217 Düsseldorf\\Germany}] \starttext \startletter \input knuth \stopletter \stoptext --[snap]-- ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the letter module
Dne nedelja 4. aprila 2010 ob 16:01:44 je Andreas Schneider napisal(a): The following should not be a separate parameter. If you put another \setupletter in front of it, it should work. Or just leave out the additional [] pairs. -- \setupletter[opening=..., closing=..., signature=..., fromname=..., fromaddress=...,toname=...,toaddress=...] I usually prefer to split it up: \setupletter[opening.] \setupletter[fromname..] \setupletter[toname.] Oh, OK. Makes sense in a way. Thanks :] Cheers, Matija -- gsm: +386 41 849 552 www: http://matija.suklje.name xmpp: matija.suk...@gabbler.org ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the letter module
New problem: Using the \ps{} command results in failure to generate the PDF, claiming \ps is not defined. Is it perhaps not included in MkII (or Tex Live 2008)? Cheers, Matija -- gsm: +386 41 849 552 www: http://matija.suklje.name xmpp: matija.suk...@gabbler.org ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the letter module
Is it normal that an empty line in the letter module does *not* trigger a paragraph? Cheers, Matija -- gsm: +386 41 849 552 www: http://matija.suklje.name xmpp: matija.suk...@gabbler.org ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with the letter module
Am 04.04.10 16:56, schrieb Matija Šuklje: New problem: Using the \ps{} command results in failure to generate the PDF, claiming \ps is not defined. Is it perhaps not included in MkII (or Tex Live 2008)? The \ps, \cc etc. commands where added after the TeXLive 2008 release. Using the latest version from thr garden/CTAN/minimals won't help because it's not compatible with ConTeXt versions before 2009 due to changes in ConTeXt itself. What you can do is upgrade to TeXLive 2009 or install the ConTeXt minimals. 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Need help with bibliography
Thomas A. Schmitz wrote: On Sep 21, 2009, at 12:41 AM, Mika Ritola wrote: I'll try to give a clearer explanation. First of all, when I cite a source using e.g. \cite[Smith2000], this should appear in the text as Smith 2000. I've already managed to do this. Now, each entry in the bibliography should begin with the same string that was used to identify it within the text. So, the above example should look something like this: Smith 2000tabJohn Smith. Generic Book Title. Whatever Publishing Company, New York 2000. I know I can get the John Smith by using \insertauthors in \setuppublicationlayout. But how do I get just the last name? The answer is probably so simple that I should be ashamed that I can't figure it out by myself but I haven't quite gotten the hang of ConTeXt and TeX yet... Ah, so it turns out you're looking for something else altogether. In your case, you want a special kind of label for your bibliographic list. See if Aditya's hack gives the result you want. But generally speaking, I think your setup is pretty common in the humanities, so it should be added as a key to the processactionlist in l. 308-316 of bibl-tra.mkiv. Hans, Taco, is there a proper syntax for getting the lastname and year of the current bib item? The best approach may be to put the lastname+space+year in the 's' key, and use \setuppublications[refcommand=short, numbering=short] Best wishes, Taco ___ 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] Need help with bibliography
On Sep 21, 2009, at 9:54 AM, Taco Hoekwater wrote: The best approach may be to put the lastname+space+year in the 's' key, and use \setuppublications[refcommand=short, numbering=short] You been by massaging the bbl file with the help of a clever lua script? Thomas ___ 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] Need help with bibliography
Thomas A. Schmitz wrote: On Sep 21, 2009, at 9:54 AM, Taco Hoekwater wrote: The best approach may be to put the lastname+space+year in the 's' key, and use \setuppublications[refcommand=short, numbering=short] You been by massaging the bbl file with the help of a clever lua script? Yes (and/or altering the bst file) Best wishes, Taco ___ 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] Need help with bibliography
Hello, I'm planning to write my Master's thesis in history using ConTeXt, and I've done some experimenting on it to see if it's actually suitable for my purposes. Everything seems to be quite simple except for one thing: the bibliography. The bibliography guidelines for our history department are rather complex in comparison to the formats that come packaged with ConTeXt, and I have no idea how to implement them. So far, I've run into two problems: 1. This one's probably very simple: there's the /insertauthors macro for inserting the whole name of the author. But how do you insert just the last name of the author? 2. This one, on the other hand, is likely to be rather non-trivial: the bibliography needs to be broken up into several categories of sources. For example, audiovisual sources, newspaper sources and books should be listed under separate headings, somewhat like this: BIBLIOGRAPHY I. AUDIOVISUAL SOURCES [some sources] II. NEWSPAPER SOURCES [...] III. BOOKS [...] I've tried to decipher the source code of the Bib module but as I'm not particularly fluent in TeX, I haven't been able to make much headway so far. I'd appreciate some hints on where to start with this. I don't suppose there's any existing code for something like this? Maybe I'd be better off writing the bibliography by hand? Thanks for reading, Mika ___ 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] Need help with bibliography
Mika Ritola wrote: Hello, I'm planning to write my Master's thesis in history using ConTeXt, and I've done some experimenting on it to see if it's actually suitable for my purposes. Everything seems to be quite simple except for one thing: the bibliography. The bibliography guidelines for our history department are rather complex in comparison to the formats that come packaged with ConTeXt, and I have no idea how to implement them. So far, I've run into two problems: 1. This one's probably very simple: there's the /insertauthors macro for inserting the whole name of the author. But how do you insert just the last name of the author? 2. This one, on the other hand, is likely to be rather non-trivial: the bibliography needs to be broken up into several categories of sources. For example, audiovisual sources, newspaper sources and books should be listed under separate headings, somewhat like this: BIBLIOGRAPHY I. AUDIOVISUAL SOURCES [some sources] II. NEWSPAPER SOURCES [...] III. BOOKS [...] I've tried to decipher the source code of the Bib module but as I'm not particularly fluent in TeX, I haven't been able to make much headway so far. I'd appreciate some hints on where to start with this. I don't suppose there's any existing code for something like this? Maybe I'd be better off writing the bibliography by hand? currently the bibtex support is being integrated in the core so if some extension is needed, we can try to deal with it, but only in mkiv (btw, next year it so we will provide a new (extra) interface to bibliographies) - concerning 1: i'm sure users on this list can help you with that - concerning 2: it is not that complex to add an extra level of filtering (using the type key), but we need an example first; best coordinate this with Thomas Schmitz who does testing of the latest code 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] Need help with bibliography
Hi, I'm not sure I can be of much help (hopefully Taco will have a look), but just a few thoughts: On Sep 20, 2009, at 1:30 PM, Mika Ritola wrote: 1. This one's probably very simple: there's the /insertauthors macro for inserting the whole name of the author. But how do you insert just the last name of the author? If you just want the last name, you can use \cite[author][citekey], but I'm not sure if this what you're after, maybe you'll need to tell us more. 2. This one, on the other hand, is likely to be rather non-trivial: the bibliography needs to be broken up into several categories of sources. For example, audiovisual sources, newspaper sources and books should be listed under separate headings, somewhat like this: BIBLIOGRAPHY I. AUDIOVISUAL SOURCES [some sources] II. NEWSPAPER SOURCES [...] III. BOOKS [...] I've tried to decipher the source code of the Bib module but as I'm not particularly fluent in TeX, I haven't been able to make much headway so far. I'd appreciate some hints on where to start with this. I don't suppose there's any existing code for something like this? Maybe I'd be better off writing the bibliography by hand? That sounds harder. You basically need three separate bibliographies, each of them sorted in some way. I'm not certain the current implementation of the bib module can do that (i.e. I'm almost certain it can't). How do you want to refer to these items in your text? Again, we'll probably need some more information about what you want to achieve. Best Thomas ___ 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] Need help with bibliography
Thomas A. Schmitz wrote: That sounds harder. You basically need three separate bibliographies, each of them sorted in some way. I'm not certain the current implementation of the bib module can do that (i.e. I'm almost certain it can't). How do you want to refer to these items in your text? Again, we'll probably need some more information about what you want to achieve. if we need an additional filtering on book|article etc, i.e. field 't' then this can probably be done without too much effort (in mkiv we can load the original bbl file for that purpose) 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] Need help with bibliography
2009/9/20 Thomas A. Schmitz thomas.schm...@uni-bonn.de On Sep 20, 2009, at 1:30 PM, Mika Ritola wrote: 1. This one's probably very simple: there's the /insertauthors macro for inserting the whole name of the author. But how do you insert just the last name of the author? If you just want the last name, you can use \cite[author][citekey], but I'm not sure if this what you're after, maybe you'll need to tell us more. I'll try to give a clearer explanation. First of all, when I cite a source using e.g. \cite[Smith2000], this should appear in the text as Smith 2000. I've already managed to do this. Now, each entry in the bibliography should begin with the same string that was used to identify it within the text. So, the above example should look something like this: Smith 2000tabJohn Smith. Generic Book Title. Whatever Publishing Company, New York 2000. I know I can get the John Smith by using \insertauthors in \setuppublicationlayout. But how do I get just the last name? The answer is probably so simple that I should be ashamed that I can't figure it out by myself but I haven't quite gotten the hang of ConTeXt and TeX yet... 2. This one, on the other hand, is likely to be rather non-trivial: the bibliography needs to be broken up into several categories of sources. For example, audiovisual sources, newspaper sources and books should be listed under separate headings, somewhat like this: BIBLIOGRAPHY I. AUDIOVISUAL SOURCES [some sources] II. NEWSPAPER SOURCES [...] III. BOOKS [...] I've tried to decipher the source code of the Bib module but as I'm not particularly fluent in TeX, I haven't been able to make much headway so far. I'd appreciate some hints on where to start with this. I don't suppose there's any existing code for something like this? Maybe I'd be better off writing the bibliography by hand? That sounds harder. You basically need three separate bibliographies, each of them sorted in some way. I'm not certain the current implementation of the bib module can do that (i.e. I'm almost certain it can't). How do you want to refer to these items in your text? Again, we'll probably need some more information about what you want to achieve. I think it would be easiest if I could refer to them in the usual way, using \cite[Smith2000]. Of course, each item in the .bib file should have some kind of a tag, so that ConTeXt could automagically insert it under the correct heading. Thanks, Mika ___ 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] Need help with bibliography
On Mon, 21 Sep 2009, Mika Ritola wrote: 2009/9/20 Thomas A. Schmitz thomas.schm...@uni-bonn.de On Sep 20, 2009, at 1:30 PM, Mika Ritola wrote: 1. This one's probably very simple: there's the /insertauthors macro for inserting the whole name of the author. But how do you insert just the last name of the author? If you just want the last name, you can use \cite[author][citekey], but I'm not sure if this what you're after, maybe you'll need to tell us more. I'll try to give a clearer explanation. First of all, when I cite a source using e.g. \cite[Smith2000], this should appear in the text as Smith 2000. I've already managed to do this. Now, each entry in the bibliography should begin with the same string that was used to identify it within the text. So, the above example should look something like this: Smith 2000tabJohn Smith. Generic Book Title. Whatever Publishing Company, New York 2000. I know I can get the John Smith by using \insertauthors in \setuppublicationlayout. But how do I get just the last name? I do not know an inbuilt way of doing this. You can probably use an ugly hacks like this: \usemodule[bib] \unprotect \def\authorlastname#1#2#3#4#5% {%\bibdoif{#1}{#1\bibalternative\c!firstnamesep}% \bibdoif{#2}{#2\bibalternative\c!vonsep}% #3% \bibdoif{#5}{\bibalternative\c!surnamesep#5\unskip}% % Set a macro for full name \def\fullauthorname{\invertedauthor{#1}{#2}{#3}{#4}{#5}}} \protect \setuppublicationlayout[article]% {\insertartauthors {} {\space\insertpubyear{}{}{}\quad\fullauthorname,} {}% % The above statement uses the full name set in authorlastname \insertarttitle {\space\quotation\bgroup} {,\egroup} {}% \insertjournal{\space\bgroup \it} {\unskip\/\egroup} {}% \insertvolume {,\space vol.~} {\insertissue {,\space no.~} {} {}} {}% \insertpages {,\space pp.\space} {} {}% \insertpubyear{,\space\insertmonth{}{\space}{}} {} {}% \insertnote {.\space}{.} {.}} \setuppublicationlist [artauthor=\authorlastname] \startpublication[k=smith:2000,t=article, a={{Smith}},y=2000, n=1,s=Smt00] \artauthor[]{John}[J.]{}{Smith} \pubyear{2000} \arttitle{The theory of everything} \journal{A fancy journal} \volume{22} \pages{379-423} \month{7} \stoppublication \starttext See~\cite[smith:2000] \placepublications \stoptext The answer is probably so simple that I should be ashamed that I can't figure it out by myself but I haven't quite gotten the hang of ConTeXt and TeX yet... With TeX, simple things are not always simple. Aditya ___ 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] Need help with bibliography
On Sun, 20 Sep 2009, Aditya Mahajan wrote: On Mon, 21 Sep 2009, Mika Ritola wrote: 2009/9/20 Thomas A. Schmitz thomas.schm...@uni-bonn.de On Sep 20, 2009, at 1:30 PM, Mika Ritola wrote: 1. This one's probably very simple: there's the /insertauthors macro for inserting the whole name of the author. But how do you insert just the last name of the author? If you just want the last name, you can use \cite[author][citekey], but I'm not sure if this what you're after, maybe you'll need to tell us more. I'll try to give a clearer explanation. First of all, when I cite a source using e.g. \cite[Smith2000], this should appear in the text as Smith 2000. I've already managed to do this. Now, each entry in the bibliography should begin with the same string that was used to identify it within the text. So, the above example should look something like this: Smith 2000tabJohn Smith. Generic Book Title. Whatever Publishing Company, New York 2000. I know I can get the John Smith by using \insertauthors in \setuppublicationlayout. But how do I get just the last name? I do not know an inbuilt way of doing this. You can probably use an ugly hacks like this: Slightly more clean solution. The current value of the citation is stored as \@@pbk, so you can use \cite to extract whatever data you want. So, \setuppublicationlayout[article]% {\insertartauthors {\cite[alternative=authoryear, left=,right={\quad}][\@@pbk]} {,} {}% \insertarttitle {\space\quotation\bgroup} {,\egroup} {}% \insertjournal{\space\bgroup \it} {\unskip\/\egroup} {}% \insertvolume {,\space vol.~} {\insertissue {,\space no.~} {} {}} {}% \insertpages {,\space pp.\space} {} {}% \insertpubyear{,\space\insertmonth{}{\space}{}} {} {}% \insertnote {.\space}{.} {.}} Aditya ___ 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] Need help with bibliography
On Sep 21, 2009, at 12:41 AM, Mika Ritola wrote: I'll try to give a clearer explanation. First of all, when I cite a source using e.g. \cite[Smith2000], this should appear in the text as Smith 2000. I've already managed to do this. Now, each entry in the bibliography should begin with the same string that was used to identify it within the text. So, the above example should look something like this: Smith 2000tabJohn Smith. Generic Book Title. Whatever Publishing Company, New York 2000. I know I can get the John Smith by using \insertauthors in \setuppublicationlayout. But how do I get just the last name? The answer is probably so simple that I should be ashamed that I can't figure it out by myself but I haven't quite gotten the hang of ConTeXt and TeX yet... Ah, so it turns out you're looking for something else altogether. In your case, you want a special kind of label for your bibliographic list. See if Aditya's hack gives the result you want. But generally speaking, I think your setup is pretty common in the humanities, so it should be added as a key to the processactionlist in l. 308-316 of bibl-tra.mkiv. Hans, Taco, is there a proper syntax for getting the lastname and year of the current bib item? 2. This one, on the other hand, is likely to be rather non-trivial: the bibliography needs to be broken up into several categories of sources. For example, audiovisual sources, newspaper sources and books should be listed under separate headings, somewhat like this: BIBLIOGRAPHY I. AUDIOVISUAL SOURCES [some sources] II. NEWSPAPER SOURCES [...] III. BOOKS [...] I've tried to decipher the source code of the Bib module but as I'm not particularly fluent in TeX, I haven't been able to make much headway so far. I'd appreciate some hints on where to start with this. I don't suppose there's any existing code for something like this? Maybe I'd be better off writing the bibliography by hand? That sounds harder. You basically need three separate bibliographies, each of them sorted in some way. I'm not certain the current implementation of the bib module can do that (i.e. I'm almost certain it can't). How do you want to refer to these items in your text? Again, we'll probably need some more information about what you want to achieve. I think it would be easiest if I could refer to them in the usual way, using \cite[Smith2000]. Of course, each item in the .bib file should have some kind of a tag, so that ConTeXt could automagically insert it under the correct heading. Well, Hans said it was possible. You'll need to define an additional field to filter your items and then have three lists typeset. Thomas ___ 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] need help with creating a grid with context
2007/10/10, Mojca Miklavec [EMAIL PROTECTED]: On 10/10/07, Wolfgang Schuster wrote: 2007/10/10, Mojca Miklavec: On 10/10/07, MASON Peter J wrote: Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately over the whole page. Why not using MetaPost? \starttext \startMPcode % or \startMPpage for i=0 upto 10: for j=0 upto 20: fill fullcircle scaled 1mm shifted ((i,j) scaled 1cm); endfor; endfor; \stopMPcode \stoptext Mojca Because TeX is faster in this situation and it takes more time to write the Metapost code in external file, process this file, convert it into a PDF file and include it into the document etc. I know what I say because this was one of the reasons why the sgf module place the field within TeX and not with Metapost, a matter of speed and you can reuse the objects. OK, that's a good point, and I fully agree with it. It's only that I would probably use something like that for really simple, short, one-page documents, where I would be concerned about the speed I need to come to a solution, not with the speed of document processing - half a second more or less. This was in my case also a one page document but I created over hundret full page graphics (needed for fieldstacks) and it is a real problem in this case, the other problem for this solution was, I had to pass dozen graphic position to Metapost and it was easier to do the whole work within TeX and use Metapost only to create the needed graphics one and reuse them. With the route tex - .plt file - gnuplot - tex (metafun) - metapost (- mpto or \sometxt) - pdf, which I frequently use, the situation is much much worse, but it's still acceptable. ConTeXt became at least 10 times faster during the last three or four years. (Or at least that's my impression.) I don't use gnuplot and I think a lua driven Tikz should solve this in the future, calculate the graphs with lua definition and draw the graphics with TeX macros. You should also replace the fullcircle with drawdot in your example, drawdot renders better on screen and looks better. Thanks. I always use fill fullcircle for some reason. Perhaps I should changle my habit :) Sorry, my fault. What I meant was the difference between draw point and drawpoint point where the first should be replaced in this situation with the later, fullcircle produce nice circles and Donald Knuth took care about this. 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 ___
Re: [NTG-context] need help with creating a grid with context
2007/10/10, Peter Rolf [EMAIL PROTECTED]: Hi Peter, MASON Peter J schrieb: I'm trying to layout a grid of bullets. The results isn't the expected one. Perhaps someone could offer help here? Thanks. Here's the sort of thing I'm doing \setuplayout[leftmargin=0pt, leftmargindistance=0pt, backspace=0pt, rightmargin=0pt, rightmargindistance=0pt, cutspace=0pt, width=middle, topspace=0pt, header=0pt, headerdistance=0pt, footer=0pt, footerdistance=0pt, bottomspace=0pt, height=middle] %\showlayout \starttext \setuppositioning[unit=cm] \startpositioning \newcount\Row \Row= 0 \loop { ^^ \newcount\Col ^^ \Col = 0 \loop \position(\Col, \Row) {$\bullet$} \ifnum\Col 14 \advance\Col by 1 \repeat } ^^ \ifnum\Row 36 \advance\Row by 1 \repeat \stoppositioning \stoptext You introduce spurious spaces (line break sometimes adds a space) in you loops. See http://tug.ctan.org/tex-archive/info/texbytopic/ if you want to learn more about it. \starttext \setuppositioning[unit=cm] \startpositioning \newcount\Row \newcount\Col \Row=0 \dorecurse{36} {\Col=0 \dorecurse{14} {\position(\Col,\Row){$\bullet$} \advance\Col by 1 }% \advance\Row by 1 } \stoppositioning \stoptext Remove the comment sign behind the inner loop and see what happens. Also see http://wiki.contextgarden.net/System_Macros/Loops_and_Recursion for the nicer ConTeXt loop macros. Best wishes, Peter Hi, there is smarter and better solution than loop for doing this work, you can use leaders. I prefer myself xledaers in this example (alternative b). \defineoverlay[PageGrid][\PageGrid] \setupbackgrounds[page][background=PageGrid,offset=5mm] \starttext % alternative a: \def\PageGrid {\setbox\scratchbox\hbox to\dimexpr\paperwidth-1cm\relax {\leaders\hbox to 1cm{\hss$\bullet$\hss}\hfill}% \vbox to\dimexpr\paperheight-1cm\relax {\leaders\vbox to 1cm{\vss\box\scratchbox\vss}\vfill}} \page[empty] % alternative b: \def\PageGrid {\setbox\scratchbox\hbox to\dimexpr\paperwidth-1cm\relax {\xleaders\hbox to 1cm{\hss$\bullet$\hss}\hfill}% \vbox to\dimexpr\paperheight-1cm\relax {\xleaders\vbox to 1cm{\vss\box\scratchbox\vss}\vfill}} \page[empty] % alternative c: \def\PageGrid {\setbox\scratchbox\hbox to\dimexpr\paperwidth-1cm\relax {\cleaders\hbox to 1cm{\hss$\bullet$\hss}\hfill}% \vbox to\dimexpr\paperheight-1cm\relax {\cleaders\vbox to 1cm{\vss\box\scratchbox\vss}\vfill}} \page[empty] \stoptext 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 ___
Re: [NTG-context] need help with creating a grid with context
Hi Peter, MASON Peter J schrieb: I'm trying to layout a grid of bullets. The results isn't the expected one. Perhaps someone could offer help here? Thanks. Here's the sort of thing I'm doing \setuplayout[leftmargin=0pt, leftmargindistance=0pt, backspace=0pt, rightmargin=0pt, rightmargindistance=0pt, cutspace=0pt, width=middle, topspace=0pt, header=0pt, headerdistance=0pt, footer=0pt, footerdistance=0pt, bottomspace=0pt, height=middle] %\showlayout \starttext \setuppositioning[unit=cm] \startpositioning \newcount\Row \Row= 0 \loop { ^^ \newcount\Col ^^ \Col = 0 \loop \position(\Col, \Row) {$\bullet$} \ifnum\Col 14 \advance\Col by 1 \repeat } ^^ \ifnum\Row 36 \advance\Row by 1 \repeat \stoppositioning \stoptext You introduce spurious spaces (line break sometimes adds a space) in you loops. See http://tug.ctan.org/tex-archive/info/texbytopic/ if you want to learn more about it. \starttext \setuppositioning[unit=cm] \startpositioning \newcount\Row \newcount\Col \Row=0 \dorecurse{36} {\Col=0 \dorecurse{14} {\position(\Col,\Row){$\bullet$} \advance\Col by 1 }% \advance\Row by 1 } \stoppositioning \stoptext Remove the comment sign behind the inner loop and see what happens. Also see http://wiki.contextgarden.net/System_Macros/Loops_and_Recursion for the nicer ConTeXt loop macros. Best wishes, Peter Before printing, please consider the environment. IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the RTA. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. ___ 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 ___
Re: [NTG-context] need help with creating a grid with context
On 10/10/07, MASON Peter J wrote: Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately over the whole page. Why not using MetaPost? \starttext \startMPcode % or \startMPpage for i=0 upto 10: for j=0 upto 20: fill fullcircle scaled 1mm shifted ((i,j) scaled 1cm); endfor; endfor; \stopMPcode \stoptext Mojca ___ 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] need help with creating a grid with context
2007/10/10, Mojca Miklavec [EMAIL PROTECTED]: On 10/10/07, MASON Peter J wrote: Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately over the whole page. Why not using MetaPost? \starttext \startMPcode % or \startMPpage for i=0 upto 10: for j=0 upto 20: fill fullcircle scaled 1mm shifted ((i,j) scaled 1cm); endfor; endfor; \stopMPcode \stoptext Mojca Because TeX is faster in this situation and it takes more time to write the Metapost code in external file, process this file, convert it into a PDF file and include it into the document etc. I know what I say because this was one of the reasons why the sgf module place the field within TeX and not with Metapost, a matter of speed and you can reuse the objects. You should also replace the fullcircle with drawdot in your example, drawdot renders better on screen and looks better. 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 ___
Re: [NTG-context] need help with creating a grid with context
On 10/10/07, Wolfgang Schuster wrote: 2007/10/10, Mojca Miklavec: On 10/10/07, MASON Peter J wrote: Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately over the whole page. Why not using MetaPost? \starttext \startMPcode % or \startMPpage for i=0 upto 10: for j=0 upto 20: fill fullcircle scaled 1mm shifted ((i,j) scaled 1cm); endfor; endfor; \stopMPcode \stoptext Mojca Because TeX is faster in this situation and it takes more time to write the Metapost code in external file, process this file, convert it into a PDF file and include it into the document etc. I know what I say because this was one of the reasons why the sgf module place the field within TeX and not with Metapost, a matter of speed and you can reuse the objects. OK, that's a good point, and I fully agree with it. It's only that I would probably use something like that for really simple, short, one-page documents, where I would be concerned about the speed I need to come to a solution, not with the speed of document processing - half a second more or less. With the route tex - .plt file - gnuplot - tex (metafun) - metapost (- mpto or \sometxt) - pdf, which I frequently use, the situation is much much worse, but it's still acceptable. ConTeXt became at least 10 times faster during the last three or four years. (Or at least that's my impression.) You should also replace the fullcircle with drawdot in your example, drawdot renders better on screen and looks better. Thanks. I always use fill fullcircle for some reason. Perhaps I should changle my habit :) Mojca ___ 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] need help with creating a grid with context
You introduce spurious spaces (line break sometimes adds a space) in you loops. See ... Yes, you're right. A programmer, I tend to think that white space is always good for readability. Thanks for that tip. But I DO like the \dorecurse(...) version better. I didn't know of this macro. I couldn't survive context with this list! Thanks very much. IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the RTA. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. ___ 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] need help with creating a grid with context
I'm trying to layout a grid of bullets. The results isn't the expected one. Perhaps someone could offer help here? Thanks. Here's the sort of thing I'm doing \setuplayout[leftmargin=0pt, leftmargindistance=0pt, backspace=0pt, rightmargin=0pt, rightmargindistance=0pt, cutspace=0pt, width=middle, topspace=0pt, header=0pt, headerdistance=0pt, footer=0pt, footerdistance=0pt, bottomspace=0pt, height=middle] %\showlayout \starttext \setuppositioning[unit=cm] \startpositioning \newcount\Row \Row= 0 \loop { \newcount\Col \Col = 0 \loop \position(\Col, \Row) {$\bullet$} \ifnum\Col 14 \advance\Col by 1 \repeat } \ifnum\Row 36 \advance\Row by 1 \repeat \stoppositioning \stoptext IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the RTA. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. ___ 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] need help with creating a grid with context
Perhaps I ought to tell what I'm expecting :-) ... Hope to create a regular (1cm spacing) grid on page, of bullets. Ultimately over the whole page. The context code supplied produces successive rows with an offset to the right. Have I missed something obvious? IMPORTANT NOTICE: This e-mail and any attachment to it are intended only to be read or used by the named addressee. It is confidential and may contain legally privileged information. No confidentiality or privilege is waived or lost by any mistaken transmission to you. The RTA is not responsible for any unauthorised alterations to this e-mail or attachment to it. Views expressed in this message are those of the individual sender, and are not necessarily the views of the RTA. If you receive this e-mail in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or use any part of this e-mail if you are not the intended recipient. ___ 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] need help for the installation of luatools
Dear Thomas, I found the folder /usr/local/Build/powerpc/TeXLive.2006. I remembered that I have tried to install TeX using the source before. When I open terminal, .luatex in not implemented yet and texexec -- make --all --pdftex run without any errors. % texexec --make --all --pdftex TeXExec | using search method 'kpsewhich' TeXExec | updating file database mktexlsr: Updating /usr/local/gwTeX/texmf/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.gwtex/ls-R... ... mktexlsr: Done. TeXExec | using tex engine pdftex TeXExec | using tex format path /Users/dalyoung/Library/texmf/web2c/ pdftex TeXExec | generating tex format cont-en This is pdfTeX, Version 3.141592-1.40.3 (Web2C 7.5.6) (INITEX) (/usr/local/gwTeX/texmf.pkgs/web2c/natural.tcx) ... %%% As you see in the above output, it uses the searching method 'kpsewhich' and '/usr/local/gwTeX/texmf.pkgs/web2c/natural.tcx' But after running 'source ~/.luatex', it used the same searaching path but different path for format and engine paths as following even though I removed /usr/local/Build folder. However, to run 'luatools --generate', I need to run .luatex. Still, I have a problem in 'luatools --ini --compile...'. %%% texexec --make --all --pdftex TeXExec | using search method 'kpsewhich' TeXExec | updating file database ... TeXExec | using tex engine pdftex TeXExec | using tex format path /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c/pdftex TeXExec | generating tex format cont-en ... TeXExec | tex engine path: /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c/pdftex TeXExec | mps engine path: /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c ... So I think that .luatex change the setting for the ConTeXt. I attached .luatex file which shows the TDS in my mac. By the way, what is 'whence'? It is a unknown cmd in my machine. and how to remove '/usr/local/Build/...' from the engine path? Thank you for your help. Best regards, Dalyoung export TEXMFCACHE=/tmp export TEXMFCNF=/usr/local/gwTeX/ export TEXMF={/Users/dalyoung/Library/texmf,/usr/local/gwTeX/texmf.local,/usr/local/gwTeX/texmf.pkgs,/usr/local/gwTeX/texmf.gwtex,/usr/local/gwTeX/texmf.texlive,/usr/local/gwTeX/texmf} export LUAINPUTS={/usr/local/gwTeX/texmf.pkgs/tex/context/base,/usr/local/gwTeX/texmf.pkgs/scripts/context/lua} ___ 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] need help for the installation of luatools
Thank you, Thomas, Arthur, and Taco, I checked texmf.cnf. There are two texmf.cnf gwTeX/texmf.cnf --- there is no code for the memory setup, it just describe the TDS structure. gwTeX/texmf/web2c/texmf.cnf --- trie_size = 40 gwTeX/texmf.local/web2c/ no texmf.cnf Gerben made other cnf file(he said that it is for the context). gwTeX/texmf.pkgs/web2c/{context.cnf, natural.ctx} --- trie_size.context = 50 The result of kpsewhich texmf.cnf is /usr/local/gwTeX/texmf.cnf. And kpsewhich --expand-var = '$TEXMF' shows the directory system of gwTeX. At this moment, I don't know what I can do. I'll test it more after changing the memory setup. Thank you again. Best regards, Dalyoung ___ 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] need help for the installation of luatools
Dalyoung Jeong wrote: Thank you, Thomas, Arthur, and Taco, I checked texmf.cnf. There are two texmf.cnf gwTeX/texmf.cnf --- there is no code for the memory setup, it just describe the TDS structure. The problem could be that luatools only sees this one (Hans has to answer that). Best wishes, Taco ___ 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] need help for the installation of luatools
Taco Hoekwater wrote: Dalyoung Jeong wrote: Thank you, Thomas, Arthur, and Taco, I checked texmf.cnf. There are two texmf.cnf gwTeX/texmf.cnf --- there is no code for the memory setup, it just describe the TDS structure. The problem could be that luatools only sees this one (Hans has to answer that). multiple cnf files are read (if the specification says so); the first values encountered are taken (so the order matters) 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] need help for the installation of luatools
Thomas A. Schmitz wrote: On Sep 14, 2007, at 7:49 AM, Dalyoung Jeong wrote: Is it OK? or should I change something? This is influenced by the variable trie_size in your texmf.cnf. In my unmodified TeXLive 2007, this is 30; I have no idea why Gerben changed it. You could try setting this to a larger value and then regenerate the formats. The most likely cause is that it is not changed at all, but that texmf.cnf is not found, so you get the compile-time default. 3. Is it possible to use OTF fonts installed in the system not in TeXmf tree? Not sure if this is implemented yet. Yes, just add the system font directory to the proper variable (porbably OPENTYPEFONTS, but perhaps OTFFONTS, I don't remember which one). I have here: OSFONTDIR=/usr/share/fonts/OTF OPENTYPEFONTS=.;$TEXMF/fonts/data//;$TEXMF/fonts/opentype//;$OSFONTDIR;./fonts// and that works fine. Best wishes, Taco ___ 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] need help for the installation of luatools
On Sep 14, 2007, at 7:49 AM, Dalyoung Jeong wrote: Dear Thomas and Arthur, Thank you for your detailed help. Copying texlua and creating .luatex file make luatools run smoothly. Now, luatools --generate run well. I'd like to ask a few questions. 1. But, there is a warning message as following for luatools -- ini .. ... language : patterns us for us loaded (n=[13],e=default,m=default) language : patterns agr for agr loaded (n=15,e=default,m=default) (/usr/local/gwTeX/texmf.pkgs/tex/context/patterns/lang-agr.pat ! TeX capacity exceeded, sorry [pattern memory=8]. l.820 ἀ2ν1έλαι in use: 1448 node words from 100604 still untouched: 99048 node words size 1 avail list: 3 size 2 avail list:22 size 3 avail list: 6 size 4 avail list:36 size 6 avail list:24 size 8 avail list:16 No pages of output. Transcript written on cont-en.log. LuaTools | LuaTools | runtime: 0.18 seconds % Is it OK? or should I change something? This is influenced by the variable trie_size in your texmf.cnf. In my unmodified TeXLive 2007, this is 30; I have no idea why Gerben changed it. You could try setting this to a larger value and then regenerate the formats. 2. Also I got 'bad path' errors when I try to make other formats. % texexec --make --all --pdftex TeXExec | using search method 'kpsewhich' TeXExec | updating file database mktexlsr: Updating /usr/local/gwTeX/texmf/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.gwtex/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.local/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.pkgs/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.texlive/ls-R... mktexlsr: Updating /var/tmp/texfonts/ls-R... mktexlsr: Done. TeXExec | using tex engine pdftex TeXExec | using tex format path /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c/pdftex TeXExec | generating tex format cont-en warning: Could not open char translation file `natural.tcx'. ! I can't read pdftex.pool; bad path? TeXExec | generating tex format cont-nl warning: Could not open char translation file `natural.tcx'. ! I can't read pdftex.pool; bad path? TeXExec | generating tex format mptopdf warning: Could not open char translation file `natural.tcx'. ! I can't read pdftex.pool; bad path? TeXExec | using mp engine mpost TeXExec | using mps format path /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c TeXExec | generating mps format metafun warning: Could not open char translation file `natural.tcx'. This is MetaPost, Version 0.993 (Web2C 7.5.6) (INIMP) ! I can't find file `metafun'. * metafun %% Yesterday, I have no problem to use texexec --pdf --make --all. Hmm, you have conflicting path names: this is what kps uses: /usr/local/gwTeX/texmf.local and this is where texexec looks for the files: /usr/local/Build/powerpc/TeXLive.2006/ Where does this path come from? Do you have leftovers from older installations? Did you install TeXLIve from source at some point? What does whence -av texexec give? 3. Is it possible to use OTF fonts installed in the system not in TeXmf tree? Not sure if this is implemented yet. Thomas ___ 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] need help for the installation of luatools
Dear Thomas and Arthur, Thank you for your detailed help. Copying texlua and creating .luatex file make luatools run smoothly. Now, luatools --generate run well. I'd like to ask a few questions. 1. But, there is a warning message as following for luatools -- ini .. ... language : patterns us for us loaded (n=[13],e=default,m=default) language : patterns agr for agr loaded (n=15,e=default,m=default) (/usr/local/gwTeX/texmf.pkgs/tex/context/patterns/lang-agr.pat ! TeX capacity exceeded, sorry [pattern memory=8]. l.820 ἀ2ν1έλαι in use: 1448 node words from 100604 still untouched: 99048 node words size 1 avail list: 3 size 2 avail list:22 size 3 avail list: 6 size 4 avail list:36 size 6 avail list:24 size 8 avail list:16 No pages of output. Transcript written on cont-en.log. LuaTools | LuaTools | runtime: 0.18 seconds % Is it OK? or should I change something? 2. Also I got 'bad path' errors when I try to make other formats. % texexec --make --all --pdftex TeXExec | using search method 'kpsewhich' TeXExec | updating file database mktexlsr: Updating /usr/local/gwTeX/texmf/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.gwtex/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.local/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.pkgs/ls-R... mktexlsr: Updating /usr/local/gwTeX/texmf.texlive/ls-R... mktexlsr: Updating /var/tmp/texfonts/ls-R... mktexlsr: Done. TeXExec | using tex engine pdftex TeXExec | using tex format path /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c/pdftex TeXExec | generating tex format cont-en warning: Could not open char translation file `natural.tcx'. ! I can't read pdftex.pool; bad path? TeXExec | generating tex format cont-nl warning: Could not open char translation file `natural.tcx'. ! I can't read pdftex.pool; bad path? TeXExec | generating tex format mptopdf warning: Could not open char translation file `natural.tcx'. ! I can't read pdftex.pool; bad path? TeXExec | using mp engine mpost TeXExec | using mps format path /usr/local/Build/powerpc/TeXLive.2006/ texmf/web2c TeXExec | generating mps format metafun warning: Could not open char translation file `natural.tcx'. This is MetaPost, Version 0.993 (Web2C 7.5.6) (INIMP) ! I can't find file `metafun'. * metafun %% Yesterday, I have no problem to use texexec --pdf --make --all. 3. Is it possible to use OTF fonts installed in the system not in TeXmf tree? Thank you again. Best regards, Dalyoung ___ 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] need help for the installation of luatools
On Sep 12, 2007, at 6:20 AM, Dalyoung Jeong wrote: Hi, all, I have downloaded binary files(lua5_1_2_Darwin89_bin_tar). What are these files? Where did you download them? After unzip, there are 3 files bin2c5.1, lua5.1, luac5.1. I copied lua5.1 as luatex and texlua in the folder /usr/texbin. lua != luatex. You need to download the luatex binaries. Sorry if this isn't helpful, but you need to provide more and more precise information. Thomas ___ 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] need help for the installation of luatools
Dalyoung Jeong wrote: Hi, all, I have downloaded binary files(lua5_1_2_Darwin89_bin_tar). After unzip, there are 3 files bin2c5.1, lua5.1, luac5.1. I copied lua5.1 as luatex and texlua in the folder /usr/texbin. I also copied luatools.lua as luatools in the folder /usr/texbin. You don't have to install lua itself at all. Luatex is an executable that is both tex and lua rolled into one, and that is the one you need. I have (attempted to) convert the installation section from the Mark IV magazine into a wiki page, I hope that helps: http://wiki.contextgarden.net/install_Mark_IV (the wiki page desparately needs improvement, but it is better than nothing) Best wishes, Taco ___ 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] need help for the installation of luatools
I copied lua5.1 as luatex and texlua in the folder /usr/texbin. That's not what you should do: lua5.1 is only the lua interpreter, nothing more, and cannot act as LuaTeX (the TeX engine with embedded Lua scripting). Nor can it act as TeXLua, the LuaTeX-aware Lua interpreter. Of course both lua5.1 and texlua are Lua interpreters and this is why luatools superficially works; but the latter has more libraries than lua alone, one of them called 'lua': luatools cannot work without those. What you should do is take the Mac binary for *LuaTeX* and copy it under the different names (texlua and texluac); symlinks are fine, too. Recent binaries are available at http://foundry.supelec.fr/frs/?group_id=10 as both Intel Mac and universal binaries (no PPC-alone binary, sorry). That way, you actually don't need Lua itself (everything you need is built-in into LuaTeX). One you've done that, you can start over again. Feel free to ask questions if you have other problems. Arthur ___ 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] need help for the installation of luatools
Dear Thomas, How careless I am! and sorry not to give you a sufficient information. As you said, lua!=luatex. I downloaded and installed luatex in the folder /usr/texbin. I also copied it as texlua. Now, It seems to me that luatools is working without the previous error. However, there is a problem of doing luatools --generate yet because I used TeXlive based on the gwTeX distribution. LuaTools | skipping /texmf-local/web2c/texmf.cnf LuaTools | skipping /texmf/web2c/texmf.cnf LuaTools | LuaTools | runtime: 0.05 seconds apple:~ dalyoung$ luatools --ini --compile --verbose cont-en LuaTools | version 1.1.1 - 2006+ - PRAGMA ADE / CONTEXT LuaTools | skipping configuration for /texmf-local/web2c from /Users/ dalyoung/luatex-cache/context/trees/d80510d450a3fa2a64df4d3741825f1d LuaTools | skipping configuration for /texmf/web2c from /Users/ dalyoung/luatex-cache/context/trees/3113242409ded67a0ad7bd508bd26609 LuaTools | no tex file with name cont-en.tex LuaTools | LuaTools | runtime: 0.05 seconds In my gwTeX, texmf.cnf is located in geTeX folder which also included the folders {texmf, texmf.gwtex. texmf.local, texmf.pkgs, texmf.texlive}, but neither in texmf.local/web2c nor in texmf/web2c. Also, context is installed in the folder texmf.pkgs/tex/context I think that it cause the problem. Is it a real cause of the above problem? Thank you. Best regards, Dalyoung ___ 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] need help for the installation of luatools
On Sep 13, 2007, at 3:02 AM, Dalyoung Jeong wrote: Dear Thomas, How careless I am! and sorry not to give you a sufficient information. As you said, lua!=luatex. I downloaded and installed luatex in the folder /usr/texbin. I also copied it as texlua. Now, It seems to me that luatools is working without the previous error. However, there is a problem of doing luatools --generate yet because I used TeXlive based on the gwTeX distribution. LuaTools | skipping /texmf-local/web2c/texmf.cnf LuaTools | skipping /texmf/web2c/texmf.cnf LuaTools | LuaTools | runtime: 0.05 seconds apple:~ dalyoung$ luatools --ini --compile --verbose cont-en LuaTools | version 1.1.1 - 2006+ - PRAGMA ADE / CONTEXT LuaTools | skipping configuration for /texmf-local/web2c from /Users/ dalyoung/luatex-cache/context/trees/d80510d450a3fa2a64df4d3741825f1d LuaTools | skipping configuration for /texmf/web2c from /Users/ dalyoung/luatex-cache/context/trees/3113242409ded67a0ad7bd508bd26609 LuaTools | no tex file with name cont-en.tex LuaTools | LuaTools | runtime: 0.05 seconds In my gwTeX, texmf.cnf is located in geTeX folder which also included the folders {texmf, texmf.gwtex. texmf.local, texmf.pkgs, texmf.texlive}, but neither in texmf.local/web2c nor in texmf/web2c. Also, context is installed in the folder texmf.pkgs/tex/context I think that it cause the problem. Is it a real cause of the above problem? Thank you. Best regards, Dalyoung OK, you're making progress. The installation is successful by itself, but in order for luatex to work, you need to set some environment variables. On my machine (OS X with TeXLive 2007), I have these lines in a file .luatex which I put in my home directory: CUT HERE%% export TEXMFCACHE=/tmp export TEXMFCNF=/usr/local/texlive/2007/texmf/web2c export TEXMF={/Users/tas/.texlive2007/texmf-config,/Users/ tas/.texlive2007/texmf-var,/Users/tas/texmf,/usr/local/texlive/2007/ texmf-config,/usr/local/texlive/2007/texmf-var,/usr/local/texlive/ 2007/texmf,/usr/local/texlive/texmf-local,/usr/local/texlive/2007/ texmf-dist,/usr/local/texlive/2007/texmf.gwtex} export LUAINPUTS={/usr/local/texlive/texmf-local/tex/context/base,/ usr/local/texlive/texmf-local/scripts/context/lua} CUT HERE%% Adapt these settings to your needs: TEXMFCACHE /tmp is OK. TEXMFCNF should point to the web2c where your texmf.cnf is located. To find out what that is, run kpsewhich texmf.cnf TEXMF should list all your TEXMF trees. Run kpsewhich --expand-var='$TEXMF' You will need to clean up the output (remove stuff like !! etc.) so it is just a flat list of directories like mine. LUAINPUTS points to your current ConTeXt installation. So put these variables in a file .luatex and run source ~/.luatex After that, luatools --generate and luatools --ini --compile should work for you. HTH Thomas ___ 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] need help for the installation of luatools
Hi, all, I have downloaded binary files(lua5_1_2_Darwin89_bin_tar). After unzip, there are 3 files bin2c5.1, lua5.1, luac5.1. I copied lua5.1 as luatex and texlua in the folder /usr/texbin. I also copied luatools.lua as luatools in the folder /usr/texbin. I updated the ConTeXt and try to install LuaTeX. But, I got an error as following when I issue luatools. apple: dalyoung$ luatools texlua: /usr/texbin/luatools:4183: attempt to index global 'lua' (a nil value) stack traceback: /usr/texbin/luatools:4183: in main chunk [C]: ? I am using TeXlive installed with i-installer. Please give me some hints to avoid the errors. Thank you. Best regards, Dalyoung ___ 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 ___