ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* add more blank space when using \starteffect[hidden]
       [not found] <mailman.1356.1615533411.1211.ntg-context@ntg.nl>
@ 2021-03-12 21:08 ` Jeong Dal
  2021-03-13  9:18   ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Jeong Dal @ 2021-03-12 21:08 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1146 bytes --]

Hi,

Sometimes, I need to hide the solution of a problem.
So I use \doifmode{} and \starteffect[hidden] as in the following sample file.
Since I want to set more blank space if it is hidden, I add \blank[5cm] when it is in the \enablemode[hideSolution].
It works well except the figures and bars are not hidden. Only texts, even  in the mp part, are hidden.
It is OK for me.

However, it would be much better to set the height of blank space depends on the height of hidden texts.
Is there a way to set the variable height  using “overlay” stuff instead of \blank[5cm]?

Thank for reading.

Best regards,

Dalyoung


\startbuffer[circles]
draw fullcircle scaled 1cm;
draw fullcircle scaled 1cm shifted (2cm,0);
dotlabel.top(“O”,origin);
\stopbuffer

\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}   
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[5cm]}}   

%\enablemode[hideSolution]

\starttext
\framed[]{This is what I want:}
\framedtext[]{
  \StartHide
  \samplefile{knuth}
 
 Overbar is not \overbar{hidden}.
  {\processMPbuffer[circles]}
  
  \StopHide
}
\stoptext


[-- Attachment #1.2: Type: text/html, Size: 4820 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: add more blank space when using \starteffect[hidden]
  2021-03-12 21:08 ` add more blank space when using \starteffect[hidden] Jeong Dal
@ 2021-03-13  9:18   ` Hans Hagen
  2021-03-14 13:13     ` Jeong Dal
  2021-03-16 19:08     ` Jeong Dal
  0 siblings, 2 replies; 6+ messages in thread
From: Hans Hagen @ 2021-03-13  9:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jeong Dal

On 3/12/2021 10:08 PM, Jeong Dal wrote:
> Hi,
> 
> Sometimes, I need to hide the solution of a problem.
> So I use \doifmode{} and \starteffect[hidden] as in the following sample 
> file.
> Since I want to set more blank space if it is hidden, I add \blank[5cm] 
> when it is in the \enablemode[hideSolution].
> It works well except the figures and bars are not hidden. Only texts, 
> even  in the mp part, are hidden.
> It is OK for me.
> 
> However, it would be much better to set the height of blank space 
> depends on the height of hidden texts.
> Is there a way to set the variable height  using “overlay” stuff instead 
> of \blank[5cm]?
> 
> Thank for reading.
> 
> Best regards,
> 
> Dalyoung
> 
> 
> \startbuffer[circles]
> draw fullcircle scaled 1cm;
> draw fullcircle scaled 1cm shifted (2cm,0);
> dotlabel.top(“O”,origin);
> \stopbuffer
> 
> \def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}
> \def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[5cm]}}
> 
> %\enablemode[hideSolution]
> 
> \starttext
> \framed[]{This is what I want:}
> \framedtext[]{
> \StartHide
> \samplefile{knuth}
> Overbar is not \overbar{hidden}.
> {\processMPbuffer[circles]}
> \StopHide
> }
> \stoptext
In your case it's easier than you mightt think:

\framedtext[empty=yes]


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: add more blank space when using \starteffect[hidden]
  2021-03-13  9:18   ` Hans Hagen
@ 2021-03-14 13:13     ` Jeong Dal
  2021-03-16 19:08     ` Jeong Dal
  1 sibling, 0 replies; 6+ messages in thread
From: Jeong Dal @ 2021-03-14 13:13 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

Thank you for your answer.

> 
> \framedtext[empty=yes]
> 

Yes, it clears everything in the frame.
But the frame is also clean when I disable \hideSolution. In that case, texts should be appeared.
What I want is the following:

If \hideSolution then
	hide text and add more blank spaces
else
	show full text and no more space.
endif

The full text  for the students another for the lecture.

Is there a way not using \framedtext?

Thank you again.
Best regards,

Dalyoung

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: add more blank space when using \starteffect[hidden]
  2021-03-13  9:18   ` Hans Hagen
  2021-03-14 13:13     ` Jeong Dal
@ 2021-03-16 19:08     ` Jeong Dal
  2021-03-17 13:57       ` Hans Hagen
  1 sibling, 1 reply; 6+ messages in thread
From: Jeong Dal @ 2021-03-16 19:08 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 741 bytes --]

Dear Hans,

I found a command \determinenoflines by googling.
I made a MWE as following. It is working well.

But I have to write the paragraph twice for couning.
Is there a better way?

Thank you again.
Best regards,

Dalyoung

%%%%%%%
\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}   
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[\the\noflines*line + \the\noflines*halfline]}}   

\enablemode[hideSolution]

\starttext

The first line.

\hrule
\StartHide
\samplefile{knuth}
\determinenoflines{\samplefile{knuth}}
\StopHide
\hrule

The second line.

\hrule

\StartHide
\samplefile{ward}
\determinenoflines{\samplefile{ward}}
\StopHide

\hrule

The last line.
\stoptext


[-- Attachment #1.2: Type: text/html, Size: 4695 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: add more blank space when using \starteffect[hidden]
  2021-03-16 19:08     ` Jeong Dal
@ 2021-03-17 13:57       ` Hans Hagen
  2021-03-17 14:47         ` Jeong Dal
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2021-03-17 13:57 UTC (permalink / raw)
  To: Jeong Dal; +Cc: mailing list for ConTeXt users

On 3/16/2021 8:08 PM, Jeong Dal wrote:
> Dear Hans,
> 
> I found a command \determinenoflines by googling.
> I made a MWE as following. It is working well.
> 
> But I have to write the paragraph twice for couning.
> Is there a better way?
> 
> Thank you again.
> Best regards,
> 
> Dalyoung
> 
> %%%%%%%
> \def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}
> \def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[\the\noflines*line 
> + \the\noflines*halfline]}}
> 
> \enablemode[hideSolution]
> 
> \starttext
> 
> The first line.
> 
> \hrule
> \StartHide
> \samplefile{knuth}
> \determinenoflines{\samplefile{knuth}}
> \StopHide
> \hrule
> 
> The second line.
> 
> \hrule
> 
> \StartHide
> \samplefile{ward}
> \determinenoflines{\samplefile{ward}}
> \StopHide
> 
> \hrule
> 
> The last line.
> \stoptext
Let me show you some magic ...

\def\determinednoflines#1%
   {\localcontrolled{\determinenoflines{#1}}\noflines}

\startbuffer
     \input tufte
\stopbuffer

\fillinrules[n=\determinednoflines{\getbuffer},
   width=fit]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
   width=broad]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
   width=3cm]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
   width=3cm,distance=.5em,separator=:]{first}
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}

i'll make a better hider later

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: add more blank space when using \starteffect[hidden]
  2021-03-17 13:57       ` Hans Hagen
@ 2021-03-17 14:47         ` Jeong Dal
  0 siblings, 0 replies; 6+ messages in thread
From: Jeong Dal @ 2021-03-17 14:47 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

It is very interesting example.
Thank you for a new method.

Best regards,

Dalyoung

> 
> \def\determinednoflines#1%
>  {\localcontrolled{\determinenoflines{#1}}\noflines}
> 
> \startbuffer
>    \input tufte
> \stopbuffer
> 
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=fit]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=broad]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=3cm]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=3cm,distance=.5em,separator=:]{first}
> \fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
> 
> i'll make a better hider later
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>       tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-17 14:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1356.1615533411.1211.ntg-context@ntg.nl>
2021-03-12 21:08 ` add more blank space when using \starteffect[hidden] Jeong Dal
2021-03-13  9:18   ` Hans Hagen
2021-03-14 13:13     ` Jeong Dal
2021-03-16 19:08     ` Jeong Dal
2021-03-17 13:57       ` Hans Hagen
2021-03-17 14:47         ` Jeong Dal

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