ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Moving the old book-structure to a recent ConTeXt
Date: Sun, 18 Jul 2021 12:37:47 +0200	[thread overview]
Message-ID: <d5328d8a-f544-20c2-f1c3-ac89d6b7a7ee@gmail.com> (raw)
In-Reply-To: <AEAD2288-25FB-4667-99D9-07B18A4652DA@rna.nl>

Gerben Wierda schrieb am 16.07.2021 um 15:51:

> Is there a new template I can download somewhere to start from scratch?

There is no template but show below a example for a document which
uses the project structure. The examples are just my own preference
and there are many ways to change them to fit your own style.


1. File names

In the example all sub files (style + chapters) start with the
name of the main file and append a sub name. Another popular
naming scheme is to prefix the files with c_ (component),
p_ (product) or s_ (style/environment).

To avoid problems should also try to use only ASCII characters
for the file names and avoid anything which is special in TeX,
using spaces or extra periods should be avoided as well.


2. Arguments for \component etc.

In my example I passed the argument to \component, \startproduct
etc. in square brackets but this is only a alternative form
to older way, where you passed it without the brackets. Both

	\component document-xxx

and

	\component [document-xxx]

are valid and you can use whatever you prefer.


3. Position of \environment

In my example I load the environment-file after \startproduct
and \startcomponent but it's also possible to load it before
them. There are reasons for both positions and when you choose
one you should keep it for all files.


4. \startdocument

In my product file I added a document-environment, while it
isn't necessary in this case it provides a nice hook to insert
a title page for your document.


%%%% begin document.tex
\startproduct [*]

\environment [document-environment]

\startdocument

% \startfrontmatter
%
% load components with table of contents, introduction etc.
%
% \stopfrontmatter

\startbodymatter

\component [document-xxx]

\stopbodymatter

\stopdocument

\stopproduct
%%%% end document.tex

%%%% begin document-environment.tex
\startenvironment [*]

% sub directory for images
%
% \setupexternalfigures
%   [directory=...]
%
% sub directories for components
%
% \usepath
%   [...]

% put you setups here

\stopenvironment
%%%% end document-environment.tex

%%%% begin document-xxx.tex
\startcomponent [*]

\environment [document-environment]

% put your content here

\stopcomponent
%%%% end document-xxx.tex


Wolfgang
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2021-07-18 10:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12  8:25 Gerben Wierda
2021-07-12 10:15 ` Henning Hraban Ramm
2021-07-15 10:19   ` Gerben Wierda
2021-07-15 14:00     ` Henning Hraban Ramm
2021-07-16 13:51       ` Gerben Wierda
2021-07-18 10:37         ` Wolfgang Schuster [this message]

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=d5328d8a-f544-20c2-f1c3-ac89d6b7a7ee@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --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).