ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Willi Egger" <w.egger@boede.nl>
Subject: Re: ConTeXt project structure?
Date: Tue, 22 Jul 2003 14:05:12 +0200	[thread overview]
Message-ID: <002201c35049$8d3c7490$0100a8c0@vademecum> (raw)
In-Reply-To: <E994315C-BC24-11D7-913B-000A95901A7E@rna.nl>

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

  reply	other threads:[~2003-07-22 12:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-22  9:14 Gerben Wierda
2003-07-22 12:05 ` Willi Egger [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002201c35049$8d3c7490$0100a8c0@vademecum' \
    --to=w.egger@boede.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).