[NTG-context] components and figure search paths

David Arnold dwarnold45 at cox.net
Wed May 10 17:13:27 CEST 2006


Hans and Sanjoy,

I am doing something similar, so I am following this discussion closely.

On my machine, the main directory is ~/Documents/IntAlgText/trunk.  
The main directory contains my environment files and book.tex (the  
project).

Then I have these directories.

~/Documents/IntAlgText/trunk/chapter0
~/Documents/IntAlgText/trunk/chapter1
...
~/Documents/IntAlgText/trunk/chapter8

Each of these directories contains a chapter and sections for that  
chapter. So, for example, I have:

~/Documents/IntAlgText/trunk/chapter0/chapter0.tex
~/Documents/IntAlgText/trunk/chapter0/section1.tex
~/Documents/IntAlgText/trunk/chapter0/section2.tex

Each of these directories contains a figure directory. So, I have:

~/Documents/IntAlgText/trunk/chapter0/figures
~/Documents/IntAlgText/trunk/chapter1/figures
...
~/Documents/IntAlgText/trunk/chapter8/figures

Each of these "figure" directories contain all of the figures for the  
chapter (the product). There are two files for each "section" of  
chapter that generate the figures.

~/Documents/IntAlgText/trunk/chapter0/figures/section1figs.tex
~/Documents/IntAlgText/trunk/chapter0/figures/figlibSection1.xml
~/Documents/IntAlgText/trunk/chapter0/figures/section2figs.tex
~/Documents/IntAlgText/trunk/chapter0/figures/figlibSection2.xml


My project (book.tex) looks like this:

\startproject book
%\environment bookenv
\doifnotmode{clean1-screen}{\environment bookenv-clean1-print}
\doifmode{clean1-screen}{\environment bookenv-clean1-screen}
\product chapter1/chapter0
\product chapter1/chapter1
\product chapter2/chapter2
\product chapter3/chapter3
\product chapter4/chapter4
\product chapter5/chapter5
\product chapter6/chapter6
\product chapter7/chapter7
\product chapter8/chapter8
\stopproject

chapter0.tex looks like this:

\startproduct chapter0
\project book
\startbodymatter
\setupheadnumber[chapter][-1]
\chapter[chap:0]{Preliminaries}
\component chapter0/section1  %Number Systems
\component chapter0/section2   %Logic
\stopbodymatter
\stopproduct

And the beginning lines in section1.tex look like this:

\startcomponent section1
\project book
\product chapter0/chapter0
\usemodule[newmat]
\usemodule[fig-base]
\usefigurebase[figures/figlibSection1]
\section[section:numbers]{Number systems}

The beginning lines in section2,tex look like this:

\startcomponent section1
\project book
\product chapter0/chapter0
\usemodule[newmat]
\usemodule[fig-base]
\usefigurebase[figures/figlibSection1]
\section[section:numbers]{Number systems}

The files section1figs.tex and section2figs.tex contain Metapost code in

\startMPpage
...
\stopMPpage

pairs. The figure libraries figlibSection1.xml and figlibSection2.xml  
look like this:

<?xml version='1.0'?>
<?context-directive job module fig-make ?>
<?context-directive job mode letter ?>
<figurelibrary language="en">

<description>
<organization>College of the Redwoods Mathematics Department</ 
organization>
<project>Intermediate Algebra Text</project>
<product>Chapter 0</product>
<comment>Figures for Section 1</comment>
</description>

<figure>
<file>section1figs-mpgraph.1</file>
<label>sec1onea</label>
<copyright>College of the Redwoods Mathematics Department</copyright>
<comment></comment>
</figure>

</figurelibrary>

This figure library also contains other graphics such as screen  
captures of my graphing calculator.

It all seems to work. I have compiled individual sections, like  
section1.tex and I've compiled chapters, like chapter0.tex. I haven't  
tried to compile book.tex (too big), so I don't know if that works.

Hope this helps.

On May 10, 2006, at 7:38 AM, Hans Hagen wrote:

> Sanjoy Mahajan wrote:
>>>> Is the idea to use \currentcomponentpath in the directory= 
>>>> {...}?  I put
>>>>
>>>>
>>> indeed
>>>
>>
>> I've just tried the version below, but abc-1.eps cannot be found (I
>> also tried \noexpand\currentcomponentpath):
>>
>> % file: chap/1/c_ch1.tex
>> \startcomponent c_ch1
>> \product onebook
>> \project project_books
>> \setupexternalfigures[directory={\currentcomponentpath}]
>> % but, just as a sanity check, this way works:
>> %  \setupexternalfigures[directory={chap/1}]
>> \title{One}
>> Hi
>> \useexternalfigure[ff][abc-1.eps]
>> \placefigure[here][ff]{Some caption}{\externalfigure[ff]}
>> \stopcomponent
>>
> so how is this component, when run on itself, supposed to locate  
> itself,
>
> - how does the dir structure look
> - where did you put the file
> - where did you run it
>
> (there is also the option to say: \usesubpath[1,2,3,4,5,6])
>
> 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
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context at ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context



More information about the ntg-context mailing list