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
Susanne G. Loeber schrieb am 14.10.2019 um 15:16:
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. Can you ask a separate question for each individual problem. 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. When you enable or disable a mode the state is local to the current group, e.g. the state at the begin of a environment will be the same at the end and changes in the environment are local to it. In most document this isn't a problem because you enable/disable a mode at the begin of the document and use the state at the whole document.
In your case you want the changed state to remain after the environment has ended, to do this you have to use \globalenablemode[...] and \globaldisablemode[...]. Wolfgang
participants (2)
-
Susanne G. Loeber
-
Wolfgang Schuster