ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Susanne G. Loeber" <dekleurenfamilie@gmail.com>
To: ntg-context@ntg.nl
Subject: how to do adaptation
Date: Mon, 14 Oct 2019 15:16:50 +0200	[thread overview]
Message-ID: <CABRYdKcqeBdYOscG8_cKq8fNa4Pby6BN1cq-FuSv5OC-r3vaCg@mail.gmail.com> (raw)

Hi,
I am looking for ways to adapt the layout and content of texts while
using ConTeXt. Put simple: show part of a text and sort these parts
based on data from the user and the author (.dat file). The biggest
problem is not knowing which part of the text will be first and how
many parts will be shown.

So far, I am trying to get a hang of \setupdocument
(https://wiki.contextgarden.net/Project_structure), \startmode
(https://wiki.contextgarden.net/Modes), \definecolor
(https://wiki.contextgarden.net/Color) and \defineparagraphs
(https://wiki.contextgarden.net/Command/defineparagraphs)

I hope there are more ways to create adaptation.

I would also like to know whether certain combination don't work
together. For example, I cannot seem to get \doifmodeelse to work
inside a \defineparagraphs environment.

\defineparagraphs[BLpar][n=2, frame=on]
\setupparagraphs [BLpar][1][width=\dimexpr.3\textwidth]

\starttext

% Working
\enablemode[asg]

\doifmodeelse{asg} {\par First sentence} {\par Second sentence}
\disablemode[asg]
\doifmodeelse{asg} {\par First sentence} {\par Second sentence}
\doifnotmode{asg} {\par Third sentence}

% Not working
\enablemode[one]

\startBLpar
\doifmodeelse{one} {First sentence} {Second sentence} \disablemode[one]
\BLpar
% \disablemode[one] %% not helping
TOP1 paragraphs
\stopBLpar
% \disablemode[one] %% needed to make the example work

\startBLpar
\doifmodeelse{one} {First sentence} {Second sentence}
\BLpar
TOP2 paragraphs
\stopBLpar

\startBLpar
\doifnotmode{one} {Third sentence}
\BLpar
TOP3 paragraphs
\stopBLpar

\stoptext


Kind regards,
Susanne G. Loeber
___________________________________________________________________________________
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:[~2019-10-14 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 13:16 Susanne G. Loeber [this message]
2019-10-14 20:07 ` Wolfgang Schuster

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=CABRYdKcqeBdYOscG8_cKq8fNa4Pby6BN1cq-FuSv5OC-r3vaCg@mail.gmail.com \
    --to=dekleurenfamilie@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).