On 6/25/2016 10:42 AM, Aditya Mahajan wrote:
On Sat, 25 Jun 2016, Wolfgang Schuster wrote:
Aditya Mahajan mailto:adityam@umich.edu 24. Juni 2016 um 21:19 Hi,
This is based on a question on tex.sx: http://tex.stackexchange.com/q/316504/323
In file-job.lua, we have:
local processors = utilities.storage.allocate { ... [v_product] = { [v_text] = { "many", processfilemany }, [v_project] = { "once", processfileonce }, [v_environment] = { "once", processfileonce }, [v_product] = { "many", processfilemany }, [v_component] = { "many", processfilemany }, }, [v_component] = { [v_text] = { "many", processfilemany }, [v_project] = { "once", processfileonce }, [v_environment] = { "once", processfileonce }, [v_product] = { "none", processfilenone }, [v_component] = { "many", processfilemany }, } }
Then, why is the product file processed multiple times? The rules for a component files are applied *after* \startcomponent which isn’t the case for the example where in the first iteration the "text" rules are applied and in the following iteration the rules for a product file.
Moving \product … after \startcomponent prevents the loop but the environment won’t be loaded anymore because the product file isn’t loaded anymore.
So, what's the recommended alternative? One could move the \environment to the components, but that can lead to a lot of repetitions (if there are many environments).
i always use one main environment (that can include others) and putting an \environment on top of a component is then not much overhead (compared to getting the content done) Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------