Re: [NTG-context] Cloze Text (text with gaps)

2013-06-28 Thread Wolfgang Schuster

Am 28.06.2013 um 09:36 schrieb Jaroslav Hajtmar :

> Hello Wolfgang.
> I thank you as well. These macros I will also definitely come in handy. 
> Sometimes I'm doing tests for my students.
> I solved it yet a little awkward, now it is OK.

The code is usable but far from perfect because I make the rule
of many small parts which length depends on the requested width.

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
___


Re: [NTG-context] Cloze Text (text with gaps)

2013-06-28 Thread Jaroslav Hajtmar

Hello Wolfgang.
I thank you as well. These macros I will also definitely come in handy. 
Sometimes I'm doing tests for my students.

I solved it yet a little awkward, now it is OK.

Thanx Jaroslav


Dne 28.6.2013 9:06, Christian Prim napsal(a):

Hello Wolfgang

thanks for both \TextGap and \WordGap. That is exactly what I needed!

Christian


2013/6/27 Wolfgang Schuster >



Am 27.06.2013 um 20:53 schrieb Jaroslav Hajtmar mailto:hajt...@gyza.cz>>:

> Hello Wolfgang.
> Here is example of other using of your TextGap.
> There is a problem in some lines? Why linewidth is change?

Add “width 0pt” to the \vrule arguments. See also my definition of
\WordGap.

\def\TextGap[#1]%
{\scratchdimen#1\relax
\divide\scratchdimen\plusten
\dorecurse\plusten
{\vrule width \scratchdimen height \linewidth depth \zeropoint\relax
\ifnum\recurselevel<10 \hskip\zeropoint\relax \fi}}

\def\WordGap
{\dowithnextbox{\TextGap[\nextboxwd]}\hbox}

\starttext

a \TextGap[4cm] b \TextGap[4cm] c \TextGap[4cm] d \TextGap[4cm] e

My words: \WordGap{My words}. Why is line very thick here?

Here is an sentence: \WordGap{Here is an sentence} -- linewidth is
OK here.

Here is an sentence: \WordGap{Here is an sentence}. And why is
problem here again?

\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

___




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


Re: [NTG-context] Cloze Text (text with gaps)

2013-06-28 Thread Christian Prim
Hello Wolfgang

thanks for both \TextGap and \WordGap. That is exactly what I needed!

Christian


2013/6/27 Wolfgang Schuster 

>
> Am 27.06.2013 um 20:53 schrieb Jaroslav Hajtmar :
>
> > Hello Wolfgang.
> > Here is example of other using of your TextGap.
> > There is a problem in some lines? Why linewidth is change?
>
> Add “width 0pt” to the \vrule arguments. See also my definition of
> \WordGap.
>
> \def\TextGap[#1]%
>  {\scratchdimen#1\relax
>   \divide\scratchdimen\plusten
>   \dorecurse\plusten
> {\vrule width \scratchdimen height \linewidth depth \zeropoint\relax
>  \ifnum\recurselevel<10 \hskip\zeropoint\relax \fi}}
>
> \def\WordGap
>   {\dowithnextbox{\TextGap[\nextboxwd]}\hbox}
>
> \starttext
>
> a \TextGap[4cm] b \TextGap[4cm] c \TextGap[4cm] d \TextGap[4cm] e
>
> My words: \WordGap{My words}. Why is line very thick here?
>
> Here is an sentence: \WordGap{Here is an sentence} -- linewidth is OK here.
>
> Here is an sentence: \WordGap{Here is an sentence}. And why is problem
> here again?
>
> \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
>
> ___
>
___
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
___

Re: [NTG-context] Cloze Text (text with gaps)

2013-06-27 Thread Wolfgang Schuster

Am 27.06.2013 um 20:53 schrieb Jaroslav Hajtmar :

> Hello Wolfgang.
> Here is example of other using of your TextGap.
> There is a problem in some lines? Why linewidth is change?

Add “width 0pt” to the \vrule arguments. See also my definition of \WordGap.

\def\TextGap[#1]%
 {\scratchdimen#1\relax
  \divide\scratchdimen\plusten
  \dorecurse\plusten
{\vrule width \scratchdimen height \linewidth depth \zeropoint\relax
 \ifnum\recurselevel<10 \hskip\zeropoint\relax \fi}}

\def\WordGap
  {\dowithnextbox{\TextGap[\nextboxwd]}\hbox}

\starttext

a \TextGap[4cm] b \TextGap[4cm] c \TextGap[4cm] d \TextGap[4cm] e

My words: \WordGap{My words}. Why is line very thick here?

Here is an sentence: \WordGap{Here is an sentence} -- linewidth is OK here.

Here is an sentence: \WordGap{Here is an sentence}. And why is problem here 
again?

\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
___


Re: [NTG-context] Cloze Text (text with gaps)

2013-06-27 Thread Jaroslav Hajtmar

Hello Wolfgang.
Here is example of other using of your TextGap.
There is a problem in some lines? Why linewidth is change?

Thanx Jaroslav Hajtmar


\def\TextGap[#1]%
  {\scratchdimen#1\relax
   \divide\scratchdimen\plusten
   \dorecurse\plusten
 {\vrule width \scratchdimen height \linewidth\relax
  \ifnum\recurselevel<10 \hskip\zeropoint\relax \fi}}

\def\textgap#1{\setbox0=\hbox{#1}%
\TextGap[\the\wd0]%
}



\starttext
a \TextGap[4cm] b \TextGap[4cm] c \TextGap[4cm] d \TextGap[4cm] e


My words: \textgap{My words}. Why is line very thick here?

Here is an sentence: \textgap{Here is an sentence} -- linewidth is OK here.

Here is an sentence: \textgap{Here is an sentence}. And why is problem 
here again?



\stoptext


Dne 27.6.2013 20:23, Wolfgang Schuster napsal(a):

\def\TextGap[#1]%
   {\scratchdimen#1\relax
\divide\scratchdimen\plusten
\dorecurse\plusten
  {\vrule width \scratchdimen height \linewidth\relax
   \ifnum\recurselevel<10 \hskip\zeropoint\relax \fi}}

\starttext
a \TextGap[4cm] b \TextGap[4cm] c \TextGap[4cm] d \TextGap[4cm] e
\stoptext


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


Re: [NTG-context] Cloze Text (text with gaps)

2013-06-27 Thread Wolfgang Schuster

Am 24.06.2013 um 16:36 schrieb Christian Prim :

> Hi list
> 
> I wonder if I can typeset a cloze text using context. The gaps (__) 
> must have a given length (say in cm or the length of a given word, given 
> sentence) and must break at the end of a line.
> 
> \hl[4] is nice but won't do the trick since it won't break. \fillinline and 
> others fill the hole line, but I only want to fill a given size.
> 
> Are there some ideas how to deal with it?

\def\TextGap[#1]%
  {\scratchdimen#1\relax
   \divide\scratchdimen\plusten
   \dorecurse\plusten
 {\vrule width \scratchdimen height \linewidth\relax
  \ifnum\recurselevel<10 \hskip\zeropoint\relax \fi}}

\starttext
a \TextGap[4cm] b \TextGap[4cm] c \TextGap[4cm] d \TextGap[4cm] e
\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
___


Re: [NTG-context] Cloze Text (text with gaps)

2013-06-27 Thread Christian Prim
Thanks David

I think the first one is a very good idea. But I failed to give the
\underbar a color different to the one of the text. Can you help me please?

Thanks
Christian


2013/6/27 David Rogers 

> Christian Prim  writes:
>
> > I wonder if I can typeset a cloze text using context. The gaps
> (__)
> > must have a given length (say in cm or the length of a given word, given
> > sentence) and must break at the end of a line.
> >
> > \hl[4] is nice but won't do the trick since it won't break. \fillinline
> and
> > others fill the hole line, but I only want to fill a given size.
> >
> > Are there some ideas how to deal with it?
> >
> > Example:
> >
> > The name of the _ is _
> > . And now it's time to go to bed.
> > Some more text.
>
>
> I haven't tested these ideas...
>
> One possibility: type the answer in white, but give it a coloured
> \underbar. (You might need to type longer answers, or in a larger font
> size, to leave enough room for hand writing.)
>
> Another: use a \fillinline - you can define the length.
>
> --
> David
>
> ___
> 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
___

Re: [NTG-context] Cloze Text (text with gaps)

2013-06-26 Thread David Rogers
Christian Prim  writes:

> I wonder if I can typeset a cloze text using context. The gaps (__)
> must have a given length (say in cm or the length of a given word, given
> sentence) and must break at the end of a line.
>
> \hl[4] is nice but won't do the trick since it won't break. \fillinline and
> others fill the hole line, but I only want to fill a given size.
>
> Are there some ideas how to deal with it?
>
> Example:
>
> The name of the _ is _
> . And now it's time to go to bed.
> Some more text.


I haven't tested these ideas...

One possibility: type the answer in white, but give it a coloured
\underbar. (You might need to type longer answers, or in a larger font
size, to leave enough room for hand writing.)

Another: use a \fillinline - you can define the length.

-- 
David
___
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
___


[NTG-context] Cloze Text (text with gaps)

2013-06-24 Thread Christian Prim
Hi list

I wonder if I can typeset a cloze text using context. The gaps (__)
must have a given length (say in cm or the length of a given word, given
sentence) and must break at the end of a line.

\hl[4] is nice but won't do the trick since it won't break. \fillinline and
others fill the hole line, but I only want to fill a given size.

Are there some ideas how to deal with it?

Example:

The name of the _ is _
. And now it's time to go to bed.
Some more text.

Hope you get the point.

Thanks in advance
Christian

PS.: For Latex there is a package:
http://tex.stackexchange.com/questions/79689/control-ulines-for-cloze-text
___
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
___