ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Project structure
       [not found] <DUB124-W7A61A44931264E38D65CDB1950@phx.gbl>
@ 2014-02-05 10:21 ` pol stra
  2014-02-06 21:25   ` Marco Patzer
  0 siblings, 1 reply; 6+ messages in thread
From: pol stra @ 2014-02-05 10:21 UTC (permalink / raw)
  To: conteXt mail


[-- Attachment #1.1: Type: text/plain, Size: 1448 bytes --]


Hello,

I want to organize my book as follow:

book/
    env_book.tex
    prd_book.tex
    chapters/
        chap_1.tex
        chap_1/
            intro.tex
        chap_2.tex
        chap_2/
            intro.tex
        chap_3.tex
        chap_3/
            intro.tex
        chap_4.tex
        chap_4/
            intro.tex

Here is the contents of my texfiles:

env_book.tex:
\startenvironment env_book
\usepath[{chapters}]
\stopenvironment

prd_book.tex:

\environment env_book
\startproduct book
\startchapter[title=Chapter 1]
        \component chap_1
\stopchapter

\startchapter[title=Chapter 2]
        \component chap_2
\stopchapter

\startchapter[title=Chapter 3]
        \component chap_3
\stopchapter

\startchapter[title=Chapter 4]
        \component chap_4
\stopchapter
\stopproduct


chap_1.tex
\usepath[{chapters/chap_1}]
\startcomponent chap_1
        \component intro
\stopcomponent

chap_2.tex
\usepath[{chapters/chap_2}]
\startcomponent chap_2
        \component intro
\stopcomponent

and so on.

The problem is that only text of first introduction is used. I want to avoid renaming all introduction files to intro_1.tex intro_2.tex etc because they are already differentiated by their folder.
Is it possible ? The aim is also to have folders for sections and images for each chapter. I attached the project structure.

Thank you,
 		 	   		   		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 2588 bytes --]

[-- Attachment #2: book.zip --]
[-- Type: application/zip, Size: 3068 bytes --]

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

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

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

* Re: Project structure
  2014-02-05 10:21 ` Project structure pol stra
@ 2014-02-06 21:25   ` Marco Patzer
  2014-02-09 11:25     ` Pol Stra
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Patzer @ 2014-02-06 21:25 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 508 bytes --]

On 2014–02–05 pol stra wrote:

> The problem is that only text of first introduction is used.

You can use \allinputpaths to see what's going on. The paths are
indeed added and ConTeXt walks through the list and uses a matching
file, if found. This happens to always be the file of the first
chapter.

I don't know know of a command which resets the custom set up paths.
If none exists, I doubt it will be hard to implement.

> I attached the project structure.

Thanks for that.

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Project structure
  2014-02-06 21:25   ` Marco Patzer
@ 2014-02-09 11:25     ` Pol Stra
  0 siblings, 0 replies; 6+ messages in thread
From: Pol Stra @ 2014-02-09 11:25 UTC (permalink / raw)
  To: ntg-context

Le jeudi 6 février 2014, 22:25:05 Marco Patzer a écrit :
> On 2014–02–05 pol stra wrote:
> > The problem is that only text of first introduction is used.
> 
> You can use \allinputpaths to see what's going on. The paths are
> indeed added and ConTeXt walks through the list and uses a matching
> file, if found. This happens to always be the file of the first
> chapter.
> 
> I don't know know of a command which resets the custom set up paths.
> If none exists, I doubt it will be hard to implement.
> 
> > I attached the project structure.
> 
> Thanks for that.
> 
> Marco

So, if I well understood, their is currently no solution but give a different 
name for each file?

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

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

* Re: project structure
  2014-07-27 11:24 ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2014-07-27 13:59   ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2014-07-27 13:59 UTC (permalink / raw)
  To: ntg-context

On 7/27/2014 1:24 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
> Hello,
>
> On Sat, 26 Jul 2014 11:01:15 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>
>> Hi,
>>
>> There is a new experimental feature (one of the side effects of
>> discussions with Alan about bibliographies and using distributed files
>> in a project structure).
>>
>> Say that you have this:
>>
>> test1.tex : uses \component one/test2
>>
>> one/test2.tex : uses \component two/test3
>>
>> etc. There can be resources under one/two that test3 needs and one way
>> out is to add this path to the used paths. Doing that automatically can
>> result in side effects when multiple resources with the same name are
>> used.
>>
>> However, we now have a concept of the local job path, so when test2 is
>> read the jobfile: prefix will use path one, and when reading test3, that
>> prefix will trigger one/two usage.
>
> very nice and handy feature, thanks for that.
>
> Just a remark -
> - there was a similar prefix "toppath:" introduced some time ago.
>
> And - IIUC - "jobfile" refers to a dir rather than to a file, so
> wouldn't be better to call the prefix "jobdir:" or "jobpath:"?

The difference is that toppath: works on the input stack and jobfile: on 
the accumulated subpaths (normally in a job structure) ... in fact, both 
could work out the same but the top of the inputstack could be different 
... it's all a matter of experiencing, so

\usepath[jobfile:]
\setupexternalfigures[directory=jobfile:]
\usepath[toppath:]
\setupexternalfigures[directory=toppath:]

could have the best of both worlds.

toppath == dir of top of inputstack
jobfile == dir of current jobfile

maybe jobpath is indeed better (i'll change it and keep the old one for 
a while)

>> For this to work, one has to say:
>>
>> \usepath[jobfile:]
>> \setupexternalfigures[directory=jobfile:]
>>
>> To what extent this all works out well is to be tested.
>>
>> Hans
>
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: project structure
  2014-07-26  9:01 project structure Hans Hagen
@ 2014-07-27 11:24 ` Procházka Lukáš Ing. - Pontex s. r. o.
  2014-07-27 13:59   ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2014-07-27 11:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

On Sat, 26 Jul 2014 11:01:15 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> Hi,
>
> There is a new experimental feature (one of the side effects of
> discussions with Alan about bibliographies and using distributed files
> in a project structure).
>
> Say that you have this:
>
> test1.tex : uses \component one/test2
>
> one/test2.tex : uses \component two/test3
>
> etc. There can be resources under one/two that test3 needs and one way
> out is to add this path to the used paths. Doing that automatically can
> result in side effects when multiple resources with the same name are used.
>
> However, we now have a concept of the local job path, so when test2 is
> read the jobfile: prefix will use path one, and when reading test3, that
> prefix will trigger one/two usage.

very nice and handy feature, thanks for that.

Just a remark -
- there was a similar prefix "toppath:" introduced some time ago.

And - IIUC - "jobfile" refers to a dir rather than to a file, so wouldn't be better to call the prefix "jobdir:" or "jobpath:"?

Best regards,

Lukas


> For this to work, one has to say:
>
> \usepath[jobfile:]
> \setupexternalfigures[directory=jobfile:]
>
> To what extent this all works out well is to be tested.
>
> Hans


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

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


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

* project structure
@ 2014-07-26  9:01 Hans Hagen
  2014-07-27 11:24 ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2014-07-26  9:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

There is a new experimental feature (one of the side effects of 
discussions with Alan about bibliographies and using distributed files 
in a project structure).

Say that you have this:

test1.tex : uses \component one/test2

one/test2.tex : uses \component two/test3

etc. There can be resources under one/two that test3 needs and one way 
out is to add this path to the used paths. Doing that automatically can 
result in side effects when multiple resources with the same name are used.

However, we now have a concept of the local job path, so when test2 is 
read the jobfile: prefix will use path one, and when reading test3, that 
prefix will trigger one/two usage.

For this to work, one has to say:

\usepath[jobfile:]
\setupexternalfigures[directory=jobfile:]

To what extent this all works out well is to be tested.

Hans

ps. file loading related code is somewhat complex because we also need 
to support tds/kpse like searching; normally such more direct lookups 
kick in early (there are more prefixes and urls are also kind of special)


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2014-07-27 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <DUB124-W7A61A44931264E38D65CDB1950@phx.gbl>
2014-02-05 10:21 ` Project structure pol stra
2014-02-06 21:25   ` Marco Patzer
2014-02-09 11:25     ` Pol Stra
2014-07-26  9:01 project structure Hans Hagen
2014-07-27 11:24 ` Procházka Lukáš Ing. - Pontex s. r. o.
2014-07-27 13:59   ` Hans Hagen

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