[NTG-context] how to do adaptation

Susanne G. Loeber dekleurenfamilie at gmail.com
Mon Oct 14 15:16:50 CEST 2019

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

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]


% Working

\doifmodeelse{asg} {\par First sentence} {\par Second sentence}
\doifmodeelse{asg} {\par First sentence} {\par Second sentence}
\doifnotmode{asg} {\par Third sentence}

% Not working

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

\doifmodeelse{one} {First sentence} {Second sentence}
TOP2 paragraphs

\doifnotmode{one} {Third sentence}
TOP3 paragraphs


Kind regards,
Susanne G. Loeber

More information about the ntg-context mailing list