ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Hiding text
@ 2013-03-22 15:18 Procházka Lukáš Ing. - Pontex s. r. o.
  2013-03-22 15:42 ` Sietse Brouwer
  2013-03-22 17:14 ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2013-03-22 15:18 UTC (permalink / raw)
  To: ConTeXt

Hello,

is it possible to define a start-stop command to hide text within?

Something like:

\definestartstop[Hidden][before=\starthiding,after=\stophiding]

TIA.

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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] 7+ messages in thread

* Re: Hiding text
  2013-03-22 15:18 Hiding text Procházka Lukáš Ing. - Pontex s. r. o.
@ 2013-03-22 15:42 ` Sietse Brouwer
  2013-03-22 16:05   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2013-03-22 17:14 ` Wolfgang Schuster
  1 sibling, 1 reply; 7+ messages in thread
From: Sietse Brouwer @ 2013-03-22 15:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> is it possible to define a start-stop command to hide text within?
>
> Something like:
>
> \definestartstop[Hidden][before=\starthiding,after=\stophiding]

Just define any buffer, and don't call \getbuffer[mybuffer]. Buffers
are not typeset, by default, until you get them. The below is
shamelessly adapted from Hans's \starthiding (which already exists):

\definebuffer[Hidden]
% uncomment the below to turn this into a non-hiding buffer.
% \setupbuffer[Hidden][after={\getbuffer[Hidden]}]

jjjj

\startHidden
asdf asdf
\stopHidden

Cheers,
Sietse
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Hiding text
  2013-03-22 15:42 ` Sietse Brouwer
@ 2013-03-22 16:05   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2013-03-22 16:36     ` Sietse Brouwer
  0 siblings, 1 reply; 7+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2013-03-22 16:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]

Hello,

interesting trick; however, it doesn't work when used inside a macro:

----
\definebuffer[Hidden]

\def\WWW{
   \startHidden
     DDD
   \stopHidden
}

\starttext
   AAA

   \startHidden
     BBB
   \stopHidden

   \WWW
\stoptext
----

Any idea?

TIA.

Best regards,

Lukas


On Fri, 22 Mar 2013 16:42:27 +0100, Sietse Brouwer <sbbrouwer@gmail.com> wrote:

>> is it possible to define a start-stop command to hide text within?
>>
>> Something like:
>>
>> \definestartstop[Hidden][before=\starthiding,after=\stophiding]
>
> Just define any buffer, and don't call \getbuffer[mybuffer]. Buffers
> are not typeset, by default, until you get them. The below is
> shamelessly adapted from Hans's \starthiding (which already exists):
>
> \definebuffer[Hidden]
> % uncomment the below to turn this into a non-hiding buffer.
> % \setupbuffer[Hidden][after={\getbuffer[Hidden]}]
>
> jjjj
>
> \startHidden
> asdf asdf
> \stopHidden
>
> Cheers,
> Sietse


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t-Hid.mkiv --]
[-- Type: application/octet-stream, Size: 163 bytes --]

\definebuffer[Hidden]

\def\WWW{
  \startHidden
    DDD
  \stopHidden
}

\starttext
  AAA

  \startHidden
    BBB
  \stopHidden

  \WWW
\stoptext

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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] 7+ messages in thread

* Re: Hiding text
  2013-03-22 16:05   ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2013-03-22 16:36     ` Sietse Brouwer
  2013-03-22 17:18       ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Sietse Brouwer @ 2013-03-22 16:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 22 March 2013 17:05, Procházka Lukáš Ing. - Pontex s. r. o.
<LPr@pontex.cz> wrote:

> interesting trick; however, it doesn't work when used inside a macro:
> Any idea?

Nope, sorry. It smells like something to do with expansion; all I know
about expansion is that it causes problems (sometimes) when there are
macros inside macros. But it might not be expansion.

I hope that helps, but it probably doesn't. ;-)

--Sietse

> Hello,
>
> interesting trick; however, it doesn't work when used inside a macro:
>
> ----
> \definebuffer[Hidden]
>
> \def\WWW{
>   \startHidden
>     DDD
>   \stopHidden
> }
>
> \starttext
>   AAA
>
>   \startHidden
>     BBB
>   \stopHidden
>
>   \WWW
> \stoptext
> ----
>
> Any idea?
>
> TIA.
>
> Best regards,
>
> Lukas
>
>
>
> On Fri, 22 Mar 2013 16:42:27 +0100, Sietse Brouwer <sbbrouwer@gmail.com>
> wrote:
>
>>> is it possible to define a start-stop command to hide text within?
>>>
>>> Something like:
>>>
>>> \definestartstop[Hidden][before=\starthiding,after=\stophiding]
>>
>>
>> Just define any buffer, and don't call \getbuffer[mybuffer]. Buffers
>> are not typeset, by default, until you get them. The below is
>> shamelessly adapted from Hans's \starthiding (which already exists):
>>
>> \definebuffer[Hidden]
>> % uncomment the below to turn this into a non-hiding buffer.
>> % \setupbuffer[Hidden][after={\getbuffer[Hidden]}]
>>
>> jjjj
>>
>> \startHidden
>> asdf asdf
>> \stopHidden
>>
>> Cheers,
>> Sietse
>
>
>
> --
> Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
> Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
> Bezová 1658
> 147 14 Praha 4
>
> Tel: +420 244 062 238
> Fax: +420 244 461 038
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Hiding text
  2013-03-22 15:18 Hiding text Procházka Lukáš Ing. - Pontex s. r. o.
  2013-03-22 15:42 ` Sietse Brouwer
@ 2013-03-22 17:14 ` Wolfgang Schuster
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2013-03-22 17:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 22.03.2013 um 16:18 schrieb Procházka Lukáš Ing. - Pontex s. r. o. <LPr@pontex.cz>:

> Hello,
> 
> is it possible to define a start-stop command to hide text within?
> 
> Something like:
> 
> \definestartstop[Hidden][before=\starthiding,after=\stophiding]

\usemodule[annotation]

\defineannotation[Hidden][alternative=none]

\starttext

A \Hidden{B} C

A \startHidden B\stopHidden C

\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] 7+ messages in thread

* Re: Hiding text
  2013-03-22 16:36     ` Sietse Brouwer
@ 2013-03-22 17:18       ` Hans Hagen
  2013-03-25  9:20         ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-03-22 17:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 3/22/2013 5:36 PM, Sietse Brouwer wrote:
> On 22 March 2013 17:05, Procházka Lukáš Ing. - Pontex s. r. o.
> <LPr@pontex.cz> wrote:
>
>> interesting trick; however, it doesn't work when used inside a macro:
>> Any idea?
>
> Nope, sorry. It smells like something to do with expansion; all I know
> about expansion is that it causes problems (sometimes) when there are
> macros inside macros. But it might not be expansion.

\def\starthidden#1\stophidden{}

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 7+ messages in thread

* Re: Hiding text
  2013-03-22 17:18       ` Hans Hagen
@ 2013-03-25  9:20         ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 0 replies; 7+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2013-03-25  9:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

thanks H&W - both solutions are useful.

Lukas


On Fri, 22 Mar 2013 18:18:00 +0100, Hans Hagen <pragma@wxs.nl> wrote:


\def\starthidden#1\stophidden{}


\usemodule[annotation]

\defineannotation[Hidden][alternative=none]

\starttext

A \Hidden{B} C

A \startHidden B\stopHidden C

\stoptext


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2013-03-25  9:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-22 15:18 Hiding text Procházka Lukáš Ing. - Pontex s. r. o.
2013-03-22 15:42 ` Sietse Brouwer
2013-03-22 16:05   ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-03-22 16:36     ` Sietse Brouwer
2013-03-22 17:18       ` Hans Hagen
2013-03-25  9:20         ` Procházka Lukáš Ing. - Pontex s. r. o.
2013-03-22 17:14 ` Wolfgang Schuster

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