ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Cloze Text (text with gaps)
@ 2013-06-24 14:36 Christian Prim
  2013-06-27  4:31 ` David Rogers
  2013-06-27 18:23 ` Wolfgang Schuster
  0 siblings, 2 replies; 9+ messages in thread
From: Christian Prim @ 2013-06-24 14:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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

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

[-- Attachment #2: 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] 9+ messages in thread

* Re: Cloze Text (text with gaps)
  2013-06-24 14:36 Cloze Text (text with gaps) Christian Prim
@ 2013-06-27  4:31 ` David Rogers
  2013-06-27  7:16   ` Christian Prim
  2013-06-27 18:23 ` Wolfgang Schuster
  1 sibling, 1 reply; 9+ messages in thread
From: David Rogers @ 2013-06-27  4:31 UTC (permalink / raw)
  To: ntg-context

Christian Prim <christian.prim@gmx.ch> 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
___________________________________________________________________________________


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

* Re: Cloze Text (text with gaps)
  2013-06-27  4:31 ` David Rogers
@ 2013-06-27  7:16   ` Christian Prim
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Prim @ 2013-06-27  7:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

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 <davidandrewrogers@gmail.com>

> Christian Prim <christian.prim@gmx.ch> 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
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: 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] 9+ messages in thread

* Re: Cloze Text (text with gaps)
  2013-06-24 14:36 Cloze Text (text with gaps) Christian Prim
  2013-06-27  4:31 ` David Rogers
@ 2013-06-27 18:23 ` Wolfgang Schuster
  2013-06-27 18:53   ` Jaroslav Hajtmar
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2013-06-27 18:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 24.06.2013 um 16:36 schrieb Christian Prim <christian.prim@gmx.ch>:

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


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

* Re: Cloze Text (text with gaps)
  2013-06-27 18:23 ` Wolfgang Schuster
@ 2013-06-27 18:53   ` Jaroslav Hajtmar
  2013-06-27 19:02     ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Jaroslav Hajtmar @ 2013-06-27 18:53 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________


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

* Re: Cloze Text (text with gaps)
  2013-06-27 18:53   ` Jaroslav Hajtmar
@ 2013-06-27 19:02     ` Wolfgang Schuster
  2013-06-28  7:06       ` Christian Prim
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2013-06-27 19:02 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users


Am 27.06.2013 um 20:53 schrieb Jaroslav Hajtmar <hajtmar@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
___________________________________________________________________________________


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

* Re: Cloze Text (text with gaps)
  2013-06-27 19:02     ` Wolfgang Schuster
@ 2013-06-28  7:06       ` Christian Prim
  2013-06-28  7:36         ` Jaroslav Hajtmar
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Prim @ 2013-06-28  7:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hello Wolfgang

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

Christian


2013/6/27 Wolfgang Schuster <schuster.wolfgang@gmail.com>

>
> Am 27.06.2013 um 20:53 schrieb Jaroslav Hajtmar <hajtmar@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
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: 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] 9+ messages in thread

* Re: Cloze Text (text with gaps)
  2013-06-28  7:06       ` Christian Prim
@ 2013-06-28  7:36         ` Jaroslav Hajtmar
  2013-06-28 12:35           ` Wolfgang Schuster
  0 siblings, 1 reply; 9+ messages in thread
From: Jaroslav Hajtmar @ 2013-06-28  7:36 UTC (permalink / raw)
  To: ntg-context

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 <schuster.wolfgang@gmail.com 
> <mailto:schuster.wolfgang@gmail.com>>
>
>
>     Am 27.06.2013 um 20:53 schrieb Jaroslav Hajtmar <hajtmar@gyza.cz
>     <mailto:hajtmar@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 <mailto: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
___________________________________________________________________________________


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

* Re: Cloze Text (text with gaps)
  2013-06-28  7:36         ` Jaroslav Hajtmar
@ 2013-06-28 12:35           ` Wolfgang Schuster
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Schuster @ 2013-06-28 12:35 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users


Am 28.06.2013 um 09:36 schrieb Jaroslav Hajtmar <hajtmar@gyza.cz>:

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


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

end of thread, other threads:[~2013-06-28 12:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24 14:36 Cloze Text (text with gaps) Christian Prim
2013-06-27  4:31 ` David Rogers
2013-06-27  7:16   ` Christian Prim
2013-06-27 18:23 ` Wolfgang Schuster
2013-06-27 18:53   ` Jaroslav Hajtmar
2013-06-27 19:02     ` Wolfgang Schuster
2013-06-28  7:06       ` Christian Prim
2013-06-28  7:36         ` Jaroslav Hajtmar
2013-06-28 12:35           ` 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).