ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* ConTeXt project structure?
@ 2003-07-22  9:14 Gerben Wierda
  2003-07-22 12:05 ` Willi Egger
  0 siblings, 1 reply; 8+ messages in thread
From: Gerben Wierda @ 2003-07-22  9:14 UTC (permalink / raw)


It is probably my lack of brain cells, but I do not understand chapter 
2 of the ConTeXt manual at all.

Suppose I have a manual-like document and I want to produce different 
PDF-files out of it:

1. The book
2. The book in another layout
3. The book in screen format with navigation
4. A simple presentation with bullet points, one or more pages per 
chapter

As I understand it I will need 4 environments:

	.../foo/bookenv.tex
	.../foo/book2env.tex
	.../foo/bookscreenenv.tex
	.../foo/presentation.tex

and I can put each chapter in a component file, i.e. chapter1.tex, 
chapter2.tex etc.

	.../foo/chapter1.tex
	.../foo/chapter2.tex

But here my understanding stops.
- Should I create a project file for each of the 4 modes above? And put 
these in different subdirectories as in:

	.../foo/book/book.tex
	.../foo/book2/book2.tex

etc.? Or do I use multiple environments in one project and I can get 4 
PDF's as a result? Or are these multiple products (I would guess this, 
but how then to set it up)? Should my chapter files contain 
\startcomponent \stopcomponent and does that mean they are 
independently compilable?

I have been reading and re-reading this, but the relation between 
project, environment, component and product keeps escaping me.

Is there a good example somewhere?

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

* Re: ConTeXt project structure?
  2003-07-22  9:14 ConTeXt project structure? Gerben Wierda
@ 2003-07-22 12:05 ` Willi Egger
  2003-07-22 13:35   ` Henning Hraban Ramm
  2003-07-29 14:44   ` Gerben Wierda
  0 siblings, 2 replies; 8+ messages in thread
From: Willi Egger @ 2003-07-22 12:05 UTC (permalink / raw)


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

Hi Gerben,

>
> It is probably my lack of brain cells, but I do not understand chapter
> 2 of the ConTeXt manual at all.
>
> Suppose I have a manual-like document and I want to produce different
> PDF-files out of it:
>
> 1. The book
> 2. The book in another layout
> 3. The book in screen format with navigation
> 4. A simple presentation with bullet points, one or more pages per
> chapter
>
> As I understand it I will need 4 environments:

No you can define modes in a single environment file.
Later you can ask texexec to use one ore more of the defined modes.

texexec --mode=mode1
texexec --mode=mode1,mod5
>
> .../foo/bookenv.tex
> .../foo/book2env.tex
> .../foo/bookscreenenv.tex
> .../foo/presentation.tex
>
> and I can put each chapter in a component file, i.e. chapter1.tex,
> chapter2.tex etc.
>
> .../foo/chapter1.tex
> .../foo/chapter2.tex
>
You can do this. It might be worthwhile to think about making the chapter a
product, then you keep the possibility to add components if the size of the
chapters is too large.

> But here my understanding stops.
> - Should I create a project file for each of the 4 modes above? And put
> these in different subdirectories as in:
>
> .../foo/book/book.tex
> .../foo/book2/book2.tex

No, use modes in the environment file.
>
> etc.? Or do I use multiple environments in one project and I can get 4
> PDF's as a result?

texexec --mode=mode-x --result=jobname-mode-x jobname

Or are these multiple products (I would guess this,
> but how then to set it up)? Should my chapter files contain
> \startcomponent \stopcomponent and does that mean they are
> independently compilable?

Any level of the project can be compiled separatly. So you can compile a
component, a product or the project.

>
> I have been reading and re-reading this, but the relation between
> project, environment, component and product keeps escaping me.

The basic idea is not that complicated:

The project(file) is the cuboard
The product(file)s are drawers of the cupboard
The component(file)s are boxes in one of the drawers whithin the cupboard.

Teh environment is used to handle the whole project.

>
> Is there a good example somewhere?
>
Whether is is a good example you will have to decide...

Success Willi

[-- Attachment #2: project.tex --]
[-- Type: application/octet-stream, Size: 1854 bytes --]

% Project in ConTeXt
% Basic layout


\startproject Example

\environment layout

\product beginmat       %Frontmatter: Intro, lists etc.

\startbodymatter

\product Chapter1       %Chapter 1 contains components:
                              %Component 11
                              %Component 12
                              %Component 13

\product Chapter2    %Chapter 2 no components
\product Chapter3    %Chapter 3 contains components:
                              %Component 31
                              %Component 32

\stopbodymatter

\product backmat     %Backmatter: Index
\product appendix    %Appendices: contanining components
                              %Impressum

\nomorefiles

\stopproject


% Project-product file

\startproduct Chapter1
\project Example

\component Component11
\component Component12
\component Component13

\stopproduct


%Project-component file

\startcomponent Component11
\product Chapter1
\project Example

\stopcomponent

%environment file

\startenvironment layout

\startmode[book]

  .. all kind of setupinformation ..

\stopmode

\startmode[screen]

  .. all kind of setupinformation ..

\stopmode


\startmode[presentation]

  .. all kind of setupinformation ..

\stopmode


% Running the project


texexec --mode=book Example --> the whole project is produced

texexec --mode=book Chapter1 --> the chapter 1 with all its components is typeset

texexec --mode=book Component11 --> the component number 11 is typeset.



% Structuring the content

You might want to perform specific tasks or specific bits of content only when using a certain mode

\doifmode{screen}{%

    all what you want to do only for this condition
}

\startmode[book]

    what should be done when in mode book

\stopmode

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

* Re: ConTeXt project structure?
  2003-07-22 12:05 ` Willi Egger
@ 2003-07-22 13:35   ` Henning Hraban Ramm
  2003-07-29 14:44   ` Gerben Wierda
  1 sibling, 0 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2003-07-22 13:35 UTC (permalink / raw)


>> .../foo/bookenv.tex
>> .../foo/book2env.tex
>> .../foo/bookscreenenv.tex
>> .../foo/presentation.tex
>>
>> and I can put each chapter in a component file, i.e. chapter1.tex,
>> chapter2.tex etc.
>>
>> .../foo/chapter1.tex
>> .../foo/chapter2.tex
>>
> You can do this. It might be worthwhile to think about making the 
> chapter a
> product, then you keep the possibility to add components if the size 
> of the
> chapters is too large.

I won't do that...

>> But here my understanding stops.
>> - Should I create a project file for each of the 4 modes above? And 
>> put
>> these in different subdirectories as in:
>>
>> .../foo/book/book.tex
>> .../foo/book2/book2.tex
>
> No, use modes in the environment file.

Or use products if the content is very different.

>> Is there a good example somewhere?
> Whether is is a good example you will have to decide...

Perhaps have a look at my ConTeXt tutorial (german), it uses the 
structure.
Link below or directly 
http://www.ramm.ch/fiee/texnique/material/fiee_source.zip

Grüßlis vom Hraban!
-- 
http://www.fiee.net/texnique/?lang=en

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

* Re: ConTeXt project structure?
  2003-07-22 12:05 ` Willi Egger
  2003-07-22 13:35   ` Henning Hraban Ramm
@ 2003-07-29 14:44   ` Gerben Wierda
  2003-07-30  1:56     ` Matthias Weber
  1 sibling, 1 reply; 8+ messages in thread
From: Gerben Wierda @ 2003-07-29 14:44 UTC (permalink / raw)


On Tuesday, Jul 22, 2003, at 14:05 Europe/Amsterdam, Willi Egger wrote:

> Hi Gerben,
>
> The basic idea is not that complicated:
>
> The project(file) is the cuboard
> The product(file)s are drawers of the cupboard
> The component(file)s are boxes in one of the drawers whithin the 
> cupboard.
>
> Teh environment is used to handle the whole project.
>
>> Is there a good example somewhere?
>>
> Whether is is a good example you will have to decide...

> <project.tex>

This helped, but I am not there yet. I would like to think of this in a 
more concept-oriented idea

A project contains all products created from the same sources

A product us something that could ship separately. Hence a chapter is 
generally not a product but a presentation versus a booklet is.

A component is something with which you build products. You do not ship 
these separately, but you may work on them separately. The chapters of 
a book are natural components for me. I will never ship chapter1.pdf 
but I might want to work on my book one chapter at a time.

In your example, a chapter is a product. You produce different what I 
would call `products' by using different modes.

That is confusing for me. Never mind the cupboard and drawers, I am 
writing a book, in final, concept, screen formats as well as a 
presentation. So, I would say, presentation and book are two different 
products and final, concept and screen are different modes for product 
book.

And as an extra, I would like to use a good directory structure. But 
the way ConTeXt searches, my product files need to be deeper nested 
than my chapter sources. This is OK to me, but then the whole project 
file loses its role because there has to be a copy of this in each 
subdirectory.

I am writing this, so ConTeXt experts can see the kind of confusion a 
newbie like me can end up in.

One more thing. ConTeXt relies heavily on texexec. Giving different 
flags to texexec might be easy from the command line, but many 
frontends have fixed typesetting commands you can choose from (e.g. 
pdflatex and texexec --pdf). Having a different texexec call depending 
on what you want may not be compatible with using a gui frontend, 
unless the frontend enables setting a call per file (which makes it a 
complicated frontend). I know I can set texexec stuff in teh first line 
of a file, but I r ather not do that because other programs try to do 
the same thing (we need a TeX-file preamble syntax, a bit like 
PostScript has).

G

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

* Re: ConTeXt project structure?
  2003-07-29 14:44   ` Gerben Wierda
@ 2003-07-30  1:56     ` Matthias Weber
  2003-09-03 15:55       ` Patrick Gundlach
  0 siblings, 1 reply; 8+ messages in thread
From: Matthias Weber @ 2003-07-30  1:56 UTC (permalink / raw)


I am so far almost completely happy with the following:


The top directory contains the layout file (s) and the main 'project 
file', and the litter TeX is producing.
The project file invokes the products (say a textbook for the screen, a 
printed textbook,  a solution manual, etc) which I put in
separate subdirectories to keep them out of the way. I also set 
specific options for the products (invoke color for the screen stuff 
etc)
in these product files only. The TeX sources for the actual texts are 
then separated into parts and chapters and sections within 
subdirectories of the
main directory. This allows me to work on a small portion of the 
project by working always in small directories, and keeping the
figures together. I can also modify a product relatively easily by 
changing its 'styles' without affecting other products.
So a product is for me an entity with coherent style and content. 
Products can share TeX sources and differ by style, or they can share
styles by use different sources.

My only complaint so far: As far as I understand it, context requires 
full path names relative to the main directory.
But probably I haven't figured it out yet...


Matthias

On Tuesday, July 29, 2003, at 09:44 AM, Gerben Wierda wrote:

> On Tuesday, Jul 22, 2003, at 14:05 Europe/Amsterdam, Willi Egger wrote:
>
>> Hi Gerben,
>>
>> The basic idea is not that complicated:
>>
>> The project(file) is the cuboard
>> The product(file)s are drawers of the cupboard
>> The component(file)s are boxes in one of the drawers whithin the 
>> cupboard.
>>
>> Teh environment is used to handle the whole project.
>>
>>> Is there a good example somewhere?
>>>
>> Whether is is a good example you will have to decide...
>
>> <project.tex>
>
> This helped, but I am not there yet. I would like to think of this in 
> a more concept-oriented idea
>
> A project contains all products created from the same sources
>
> A product us something that could ship separately. Hence a chapter is 
> generally not a product but a presentation versus a booklet is.
>
> A component is something with which you build products. You do not 
> ship these separately, but you may work on them separately. The 
> chapters of a book are natural components for me. I will never ship 
> chapter1.pdf but I might want to work on my book one chapter at a > time.
>
> In your example, a chapter is a product. You produce different what I 
> would call `products' by using different modes.
>
> That is confusing for me. Never mind the cupboard and drawers, I am 
> writing a book, in final, concept, screen formats as well as a 
> presentation. So, I would say, presentation and book are two different 
> products and final, concept and screen are different modes for product 
> book.
>
> And as an extra, I would like to use a good directory structure. But 
> the way ConTeXt searches, my product files need to be deeper nested 
> than my chapter sources. This is OK to me, but then the whole project 
> file loses its role because there has to be a copy of this in each 
> subdirectory.
>
> I am writing this, so ConTeXt experts can see the kind of confusion a 
> newbie like me can end up in.
>
> One more thing. ConTeXt relies heavily on texexec. Giving different 
> flags to texexec might be easy from the command line, but many 
> frontends have fixed typesetting commands you can choose from (e.g. 
> pdflatex and texexec --pdf). Having a different texexec call depending 
> on what you want may not be compatible with using a gui frontend, 
> unless the frontend enables setting a call per file (which makes it a 
> complicated frontend). I know I can set texexec stuff in teh first 
> line of a file, but I r ather not do that because other programs try 
> to do the same thing (we need a TeX-file preamble syntax, a bit like 
> PostScript has).
>
> G
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>

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

* Re: ConTeXt project structure?
  2003-07-30  1:56     ` Matthias Weber
@ 2003-09-03 15:55       ` Patrick Gundlach
  2003-09-04 19:31         ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Patrick Gundlach @ 2003-09-03 15:55 UTC (permalink / raw)


Hello Matthias,

> My only complaint so far: As far as I understand it, context requires
> full path names relative to the main directory.
> But probably I haven't figured it out yet...

As far as I can see, there are two ways to include the products:

a) as you said with path names directory/productname

b) on web2c systems via the TEXINPUTS environment variable. 

I am looking for a third (...) way as well


Patrick

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

* Re: Re: ConTeXt project structure?
  2003-09-03 15:55       ` Patrick Gundlach
@ 2003-09-04 19:31         ` Hans Hagen
  2003-09-04 21:19           ` Patrick Gundlach
  0 siblings, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2003-09-04 19:31 UTC (permalink / raw)


At 17:55 03/09/2003 +0200, you wrote:

 > I am looking for a third (...) way as well

what direction?

(i'm thinking of a database option)

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

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

* Re: ConTeXt project structure?
  2003-09-04 19:31         ` Hans Hagen
@ 2003-09-04 21:19           ` Patrick Gundlach
  0 siblings, 0 replies; 8+ messages in thread
From: Patrick Gundlach @ 2003-09-04 21:19 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> writes:

Hello,

>  > I am looking for a third (...) way as well
>
> what direction?
>
> (i'm thinking of a database option)

I didn't know of the \usepath and \usesubpath (what is the
difference?). So I've got my third.

Patrick

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

end of thread, other threads:[~2003-09-04 21:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22  9:14 ConTeXt project structure? Gerben Wierda
2003-07-22 12:05 ` Willi Egger
2003-07-22 13:35   ` Henning Hraban Ramm
2003-07-29 14:44   ` Gerben Wierda
2003-07-30  1:56     ` Matthias Weber
2003-09-03 15:55       ` Patrick Gundlach
2003-09-04 19:31         ` Hans Hagen
2003-09-04 21:19           ` Patrick Gundlach

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