* Hide section content
@ 2011-11-19 23:56 Aditya Mahajan
2011-11-20 10:16 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2011-11-19 23:56 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
I have a tex file that looks like follows:
\startsection[title=...][review=yes]
...
\stopsection
\startsection[title=...][review=no]
...
\stopsection
When I compile the document with --mode=review, I want that all sections
that have `review=no` should not be displayed. What is the best way of
achieving this? In particular, can we have an option that'll let us say:
\setuphead[section][placebody=hidden] (analogous to placehead=hidden).
Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hide section content
2011-11-19 23:56 Hide section content Aditya Mahajan
@ 2011-11-20 10:16 ` Wolfgang Schuster
2011-11-20 18:49 ` Aditya Mahajan
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2011-11-20 10:16 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 20.11.2011 um 00:56 schrieb Aditya Mahajan:
> Hi,
>
> I have a tex file that looks like follows:
>
> \startsection[title=...][review=yes]
> ...
> \stopsection
>
> \startsection[title=...][review=no]
> ...
> \stopsection
>
> When I compile the document with --mode=review, I want that all sections that have `review=no` should not be displayed. What is the best way of achieving this? In particular, can we have an option that'll let us say:
>
> \setuphead[section][placebody=hidden] (analogous to placehead=hidden).
To hide the content of the section you can use this (maybe a buffer would be better) but to hide the title of the section together with the list entry Hans has to modify the heading macros.
\def\gobblesection
{\doif{\structureuservariable{review}}{no}
{\gobbleuntil\stopsection}}
\setuphead[section][insidesection=\gobblesection]
\starttext
\startsection[title=Knuth][review=yes]
\input knuth
\stopsection
\startsection[title=Zapf][review=no]
\input zapf
\stopsection
\stoptext
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hide section content
2011-11-20 10:16 ` Wolfgang Schuster
@ 2011-11-20 18:49 ` Aditya Mahajan
0 siblings, 0 replies; 3+ messages in thread
From: Aditya Mahajan @ 2011-11-20 18:49 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Sun, 20 Nov 2011, Wolfgang Schuster wrote:
> Am 20.11.2011 um 00:56 schrieb Aditya Mahajan:
>
>> Hi,
>>
>> I have a tex file that looks like follows:
>>
>> \startsection[title=...][review=yes]
>> ...
>> \stopsection
>>
>> \startsection[title=...][review=no]
>> ...
>> \stopsection
>>
>> When I compile the document with --mode=review, I want that all sections that have `review=no` should not be displayed. What is the best way of achieving this? In particular, can we have an option that'll let us say:
>>
>> \setuphead[section][placebody=hidden] (analogous to placehead=hidden).
>
>
> To hide the content of the section you can use this (maybe a buffer
> would be better)
>
> \def\gobblesection
> {\doif{\structureuservariable{review}}{no}
> {\gobbleuntil\stopsection}}
>
> \setuphead[section][insidesection=\gobblesection]
Thanks.
> but to hide the title of the section together with the
> list entry Hans has to modify the heading macros.
Yes. I noticed that beforesection is used before user variables are set,
so the above approach does not work for section heads. For now, I have
just defined a different head, 'noreviewsection`, and I set it to a buffer
in the review mode.
Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-20 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-19 23:56 Hide section content Aditya Mahajan
2011-11-20 10:16 ` Wolfgang Schuster
2011-11-20 18:49 ` Aditya Mahajan
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).