ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* finding project files in parent dirs automatically
@ 2006-04-08 16:31 Sanjoy Mahajan
  2006-04-08 16:54 ` Taco Hoekwater
  0 siblings, 1 reply; 5+ messages in thread
From: Sanjoy Mahajan @ 2006-04-08 16:31 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2852 bytes --]

I'm learning how to use projects/products/components, and have got
reasonably far.  However, I'm confused about far upwards context
searches for the configuration files (product/project/environment
files).

Here's a directory structure that worked fine:

double/chap/1/c_ch1.tex
double/prd_oom.tex
double/project_books.tex
double/env_books.tex

It's called 'double' to signify that the components are two levels below
the main project file.  I cd to double/chap/1/ and then 'texexec c_ch1',
and c_ch1.log tells me:

  systems         : begin file c_ch1 at line 1
  systems         : begin file project_books at line 3
  (../../project_books.tex
  systems         : begin file env_books at line 3
  (../../env_books.tex)
  systems         : end file env_books at line 3
  )
  systems         : end file project_books at line 3

So the project and environment files got read in.  By the way, why isn't
the product file loaded?  Is it not needed when making just one
component?  But it could modify the environment.

Leaving that question aside, here is the chap/1/c_ch1.tex file (all the
.tex files and the log files are in the small attached .tgz archive):

  \startcomponent c_ch1
  \product prd_oom
  \project project_books
  \title{chapter 1}
  \input tufte
  \par
  \stopcomponent

The prd_oom.tex:

  \startproduct prd_oom
  \project project_books
  \component chap/1/c_ch1
  \stopproduct

And project_books.tex:

  % output=pdf interface=en
  \startproject project_books
  \environment env_books
  \product prd_oom
  \stopproject

So the "\project project_books" in c_ch1.tex is sufficient for context
to find ../../project_books.tex

But I really want each product to live in its own directory.  In this
minimal example, the only product is 'oom', for "Order of Magnitude
physics".  So I tried this directory structure:

triple/oom/chap/1/c_ch1.tex
triple/oom/chap/1/c_ch1.log
triple/oom/prd_oom.tex
triple/project_books.tex
triple/env_books.tex

Now the project_books.tex file is three levels up from the component,
and project_books.tex has "\product oom/prd_oom" instead of "\product
prd_oom".  Now project_books.tex isn't found when compiling c_ch1.tex.
>From c_ch1.log:

systems         : begin file project_books at line 3
systems         : end file project_books at line 3

Is there a hardcoded limit on how far up context searches?

$ texexec --version

 TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

               texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
               texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006
                   tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4)
               context : ver: 2006.03.25 13:21
               cont-en : ver: 2006.03.25 13:21  fmt: 2006.4.6  mes: english

-Sanjoy

`A society of sheep must in time beget a government of wolves.'
   - Bertrand de Jouvenal


[-- Attachment #2: minimal tex and log files --]
[-- Type: application/x-gtar, Size: 1770 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: finding project files in parent dirs automatically
  2006-04-08 16:31 finding project files in parent dirs automatically Sanjoy Mahajan
@ 2006-04-08 16:54 ` Taco Hoekwater
  2006-04-08 18:29   ` Sanjoy Mahajan
  2006-04-10  3:42   ` Sanjoy Mahajan
  0 siblings, 2 replies; 5+ messages in thread
From: Taco Hoekwater @ 2006-04-08 16:54 UTC (permalink / raw)


Sanjoy Mahajan wrote:
> So the project and environment files got read in.  By the way, why isn't
> the product file loaded?  Is it not needed when making just one
> component?  But it could modify the environment.

It could modify the environment, but it shouldnt. So I guess Hans
never considered loading it. (for Hans: please don't do anything
about this right now, I want to investigate what would be needed
for partial recompilation, first)

> 
> Is there a hardcoded limit on how far up context searches?

Like you just discovered, it searches three levels (current, parent,
grandparent). The max level is defined in this macro:

   \def\maxreadlevel{3}

You can simply redefine the macro if needed (you have to do that in
cont-sys, otherwise you have a bootstrapping problem).

The file reading macros are in supp-fil.tex, if interested.

Cheers, Taco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: finding project files in parent dirs automatically
  2006-04-08 16:54 ` Taco Hoekwater
@ 2006-04-08 18:29   ` Sanjoy Mahajan
  2006-04-09 18:00     ` Hans Hagen
  2006-04-10  3:42   ` Sanjoy Mahajan
  1 sibling, 1 reply; 5+ messages in thread
From: Sanjoy Mahajan @ 2006-04-08 18:29 UTC (permalink / raw)


From:    Taco Hoekwater <taco@elvenkind.com>
> > Is there a hardcoded limit on how far up context searches?
> 
> Like you just discovered, it searches three levels (current, parent,
> grandparent). The max level is defined in this macro:
> 
>    \def\maxreadlevel{3}
> 
> You can simply redefine the macro if needed (you have to do that in
> cont-sys, otherwise you have a bootstrapping problem).
> 
> The file reading macros are in supp-fil.tex, if interested.

Tested and works great, thanks.  I had looked around for such an
object but didn't find it.

Can the default be 4? (If it doesn't break other assumptions.)

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: finding project files in parent dirs automatically
  2006-04-08 18:29   ` Sanjoy Mahajan
@ 2006-04-09 18:00     ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2006-04-09 18:00 UTC (permalink / raw)


Sanjoy Mahajan wrote:
> From:    Taco Hoekwater <taco@elvenkind.com>
>   
>>> Is there a hardcoded limit on how far up context searches?
>>>       
>> Like you just discovered, it searches three levels (current, parent,
>> grandparent). The max level is defined in this macro:
>>
>>    \def\maxreadlevel{3}
>>
>> You can simply redefine the macro if needed (you have to do that in
>> cont-sys, otherwise you have a bootstrapping problem).
>>
>> The file reading macros are in supp-fil.tex, if interested.
>>     
>
> Tested and works great, thanks.  I had looked around for such an
> object but didn't find it.
>
> Can the default be 4? (If it doesn't break other assumptions.)
>
>   
best put this directive in your local cont-sys.tex 

you may formulate it as a feature request (i have to think about it) 

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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: finding project files in parent dirs automatically
  2006-04-08 16:54 ` Taco Hoekwater
  2006-04-08 18:29   ` Sanjoy Mahajan
@ 2006-04-10  3:42   ` Sanjoy Mahajan
  1 sibling, 0 replies; 5+ messages in thread
From: Sanjoy Mahajan @ 2006-04-10  3:42 UTC (permalink / raw)


Taco Hoekwater <taco@elvenkind.com> wrote:
> [the product file] could modify the environment, but it shouldnt.

That ability might be useful.  For example, a project with a textbook,
teacher's guide, and solutions manual as the products might want
different papersizes for each product.  Or some products (issues) for a
magazine project might be in full color, some in spot color, and others
in black and white.

-Sanjoy

`A society of sheep must in time beget a government of wolves.'
   - Bertrand de Jouvenal

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-04-10  3:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-08 16:31 finding project files in parent dirs automatically Sanjoy Mahajan
2006-04-08 16:54 ` Taco Hoekwater
2006-04-08 18:29   ` Sanjoy Mahajan
2006-04-09 18:00     ` Hans Hagen
2006-04-10  3:42   ` Sanjoy Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).