On Wed, Oct 29, 2008 at 11:32 AM, Hans Hagen <pragma@wxs.nl> wrote:
> How do you call ctx files from within a main ctx file ?

<ctx:include name='whatever.ctx"/>

should work

In my first attempt to cook something up, something seems to be missing and/or wrong because no output is generated. If all is put into one *.ctx file it works.

texmfstart texexec --lua --ctx=ctx-main ctx-test

*** ctx-test.tex ***

\starttext

\doifmode{mode1a}
    {mode1a}
   
\doifmode{mode2a}
    {\blank mode2a}

\stoptext

*** ctx-main.ctx ***

<?xml version='1.0' standalone='yes'?>

<ctx:job>
    <ctx:preprocess>
            <ctx:include name='ctx-flags.ctx'/>
            <ctx:include name='ctx-modes1.ctx'/>
    </ctx:preprocess>
     <ctx:flags/>
     <ctx:process/>
     <ctx:postprocess/>
</ctx:job>

*** ctx-flags.ctx ***

<?xml version='1.0' standalone='yes'?>

<ctx:job>
     <ctx:preprocess/>
    <ctx:flags>
        <ctx:flag>texengine=luatex</ctx:flag>
        <ctx:flag>interface=en</ctx:flag>
        <ctx:flag>result=ctx-modes</ctx:flag>
    </ctx:flags>
     <ctx:process/>
     <ctx:postprocess/>
</ctx:job>

*** ctx-modes1.ctx ***

<?xml version='1.0' standalone='yes'?>

<ctx:job>
     <ctx:preprocess/>
     <ctx:flags/>
    <ctx:process>
        <ctx:resources>
            <ctx:mode>mode1a</ctx:mode>
        </ctx:resources>
    </ctx:process>
     <ctx:postprocess/>     
</ctx:job>

*** ctx-modes2.ctx ***

<?xml version='1.0' standalone='yes'?>

<ctx:job>
     <ctx:preprocess/>
     <ctx:flags/>
    <ctx:process>
        <ctx:resources>
            <ctx:mode>mode2a</ctx:mode>
        </ctx:resources>
    </ctx:process>
    <ctx:postprocess/>
</ctx:job>

*** end of code ***

Best,
Alan

--
* texexec --lua foo
* ConTeXt  minimals ver: 2008.10.08 23:34 MKIV  fmt: 2008.10.13  int: english/english
* Ubuntu 8.04 Hardy Heron