ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Typesetting products and components
Date: Tue, 15 Feb 2005 19:47:36 +0100	[thread overview]
Message-ID: <421243C8.3050003@wxs.nl> (raw)
In-Reply-To: <ba4316d30502141227686070d5@mail.gmail.com>

Randall Skelton wrote:

> generated for the set of components.  Is it appropriate to want to do
> this or have I misunderstood the role of projects, products and
> components entirely.
as long as you understand the logic behind your choices it;s ok

I'll add a system mode: (put this in cont-new.tex)

\startvariables          dutch                     english
                          german                    czech
                          italian                   romanian

             environment: omgeving                  environment
                          umgebung                  prostredi
                          ambiente                  mediu
               component: onderdeel                 component
                          komponente                komponenta
                          componente                componenta
                 product: produkt                   product
                          produkt                   produkt
                          prodotto                  produs
                 project: project                   project
                          projekt                   projekt
                          progetto                  proiect

\stopvariables

\unprotect

\let\currentcomponent\v!text

\def\donextlevel#1#2#3#4#5#6#7\\%
   {\pushmacro\currentcomponent
    \let\currentcomponent#1
    \setsystemmode\currentcomponent
    \beforesplitstring#7\at.\to#2\relax
    \ifcase\filelevel\relax
      \starttext
      \def\project     ##1 {#3{##1}}%
      \def\environment ##1 {#4{##1}}%
      \def\product     ##1 {#5{##1}}%
      \def\component   ##1 {#6{##1}}%
    \fi
    \increment\filelevel\relax
    \fullexpandoneargafter\addtocommalist{#1}\loadedfiles}

\def\doprevlevel
   {\popmacro\currentcomponent
    \setsystemmode\currentcomponent
    \ifnum\filelevel=\plusone
      \expandafter\stoptext
    \else
      \decrement\filelevel\relax
      \expandafter\endinput
    \fi}

\def\startproject #1 %
   {\donextlevel\v!project\currentproject
      \donotexecutefile\doexecutefileonce
      \doexecutefileonce\doexecutefile#1\\}

\def\startproduct #1 %
   {\doateverystarttext
    \donextlevel\v!product\currentproduct
      \doexecutefileonce\doexecutefileonce
      \donotexecutefile\doexecutefile#1\\}

\def\startcomponent #1 %
   {\doateverystarttext
    \donextlevel\v!component\currentcomponent
      \doexecutefileonce\doexecutefileonce
      \donotexecutefile\doexecutefile#1\\}

\def\startenvironment #1 %
   {\donextlevel\v!environment\currentenvironment
      \donotexecutefile\doexecutefileonce
      \donotexecutefile\donotexecutefile#1\\}

\protect

\starttext

% \startproject test

%     1: \startmode[*project] project \stopmode \endgraf
%     2: \startmode[*product] product \stopmode \endgraf

% \stopproject

\startproduct test

1: \startmode[*project] project \stopmode \endgraf
2: \startmode[*product] product \stopmode \endgraf

\stopproduct

\stoptext



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

      parent reply	other threads:[~2005-02-15 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-14 20:27 Randall Skelton
2005-02-15 18:38 ` Peter Münster
2005-02-15 18:59   ` Hans Hagen
2005-02-15 18:47 ` Hans Hagen [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=421243C8.3050003@wxs.nl \
    --to=pragma@wxs.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).