ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Florian Leupold <fleupold@posteo.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Creating cloze texts
Date: Sun, 4 Sep 2016 16:32:01 +0200	[thread overview]
Message-ID: <AFF5C5C8-F42C-4AE4-B47C-A05C93ACE6BD@posteo.net> (raw)
In-Reply-To: <A6B384EF-B8F8-4F1F-91A1-A8807A1A6C35@posteo.net>


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


> On 04.09.16, at 16:28, Florian Leupold <fleupold@posteo.net> wrote:
> 
> 
>> On 04.09.16, at 14:14, Hans Hagen <pragma@wxs.nl> wrote:
>> 
>> On 9/4/2016 12:03 PM, Hans Hagen wrote:
>> 
>>> \definebar[ClozedBar][underbar][continue=yes]
>>> 
>>> \unexpanded\def\Clozed#1{\ClozedBar{\zwj#1\zwj}}
>>> 
>>> \starttext
>>> 
>>> \input ward
>>> \Clozed{\color[red]{CLOZE 1}}
>>> \input ward
>>> \Clozed{\quad\color[red]{CLOZE 2}\quad}
>>> \input ward
>>> \Clozed{\color[white]{x}\quad\color[red]{CLOZE 3}\quad\color[white]{x}}
>>> \input ward
>>> \Clozed{\color[green]{x}\quad\color[red]{CLOZE 4}\quad\color[white]{x}}
>>> \input ward
>>> space \Clozed{\color[red]{CLOZE 5}\qquad\color[white]{x}} space
>>> \input ward
>>> 
>>> \stoptext
>> 
>> in next beta you can specify an empty option which will remove the text (otherwise one can still copy it from the pdf):
>> 
>> \definebar[ClozedBar][underbar][continue=yes,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://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 
> Dear Hans,
> 
> thanks a lot for your solution!
> 
> I have added "color=black” to \definebar to prevent the bar’s color from changing at a line break, which happens otherwise:
> 
> \definebar[ClozedBar][underbar][continue=yes]
> %\definebar[ClozedBar][underbar][continue=yes, color=black]
> \unexpanded\def\Clozed#1{\ClozedBar{\zwj\quad#1\quad\zwj}}
> \starttext
> \Clozed{\color[red]{CLOZE 1}} text text text text text text text text text text text
> \Clozed{\color[red]{CLOZE 2 CLOZE 2}}
> \stoptext
> 
> Now the extra space is hardcoded by \quad. I guess it’s not so easy then to make the underbar’s width a factor times the input text width? Or, alternatively, an explicitly given width?
> 
> Cheers,
> Florian
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

ADDENDUM:

There is still another problem: The fixed leading space may be eaten away by a line break.

\definebar[ClozedBar][underbar][continue=yes, color=black]
\unexpanded\def\Clozed#1{\ClozedBar{\zwj\quad#1\quad\zwj}}

\starttext
\Clozed{\color[red]{CLOZE 1}} text text text text text text text text text text text text text
\Clozed{\color[red]{CLOZE 2 CLOZE 2}}
\stoptext



[-- Attachment #1.2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 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
___________________________________________________________________________________

      reply	other threads:[~2016-09-04 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 13:27 Florian Leupold
2016-09-04 10:03 ` Hans Hagen
2016-09-04 12:14   ` Hans Hagen
2016-09-04 14:28     ` Florian Leupold
2016-09-04 14:32       ` Florian Leupold [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AFF5C5C8-F42C-4AE4-B47C-A05C93ACE6BD@posteo.net \
    --to=fleupold@posteo.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).