[NTG-context] bug in latest beta?

2016-09-04 Thread Pablo Rodriguez
Hans,

the following sample gives a Lua error with latest beta (2016.09.04 13:46):

\setupinteraction[state=start]
\define[1]\myurl{{\tt\goto{\hyphenatedurl{#1}}[url(#1)]}}

\starttext
\input knuth \myurl{http://wiki.contextgarden.net}.
\stoptext

Compilation is fine with beta from 2016.07.18 16:46.

Is this a bug or am I missing something?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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] Enumeration: chapter in counter, problem next to placefigure, and documentation issues

2016-09-04 Thread Wolfgang Schuster

Florian Leupold 
4. September 2016 um 19:37
Issues with the documentation:
- In “ConTeXt Commands”, it says on page 224 that \setupenumeration 
inherits from \setupcounter; but in “ConTEXt reference manual", it 
says on page 246 that \setupenumerations inherits from \setupdescriptions.
- In “ConTEXt reference manual”, the key “location” for 
\defineenumeration should probably replaced by “alternative”. Right 
now, all examples on page 247 are unaffected by this setting and hence 
look the same.
ConTeXt contains two different interface files, a) a old one 
(cont-en.xml) which was written for MkII and extended of the time with a 
few new command introduced by MkIV (e.g. \definefontfeature) and b) a 
new one (i-context.xml) which was rewritten with MkIV as its base.


Most of the existing documents use the old file which contains either 
wrong keys (e.g. location vs. alternative) or document no longer 
existing functions (compare counter related settings in both files).


The new file takes also into account internal changes for commands, e.g. 
in MkII note descriptions are based on enumerations which are itself a 
extension to the description commands. In MkIV notations (new name for 
note descriptions), enumerations and descriptions all use a internal 
mechanism called constructions with extra functions for each instance.


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] Wrong bookmark for TOC

2016-09-04 Thread Henri Menke
On 09/04/2016 07:28 PM, Wolfgang Schuster wrote:
>> Henri Menke 
>> 4. September 2016 um 13:28
>> Dear list,
>>
>> when I specify that titles should be added to the bookmarks, the text of the 
>> bookmark is somewhat wrong. The heading of the table of contents is 
>> »Contents«, so I expect this to appear as bookmark. Unfortunately, the 
>> bookmark read »content« (all lowercase and singular). MWE is below. How do I 
>> fix this?
>>
>> Cheers, Henri
>>
>> ---
>>
> \enabledirectives[references.bookmarks.preroll]

Thank you Wolfgang, but hat enables expansion for all macros in bookmarks.  For 
me it is okay but this is perhaps not the best way to deal with it.  I think 
strings like »content« should be expanded by default in bookmarks (just like 
synonyms).

Cheers, Henri

>> \setupinteraction[state=start]
>> \placebookmarks[chapter,title][force=yes]
>> \starttext
>> \completecontent
>> \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] Enumeration: chapter in counter, problem next to placefigure, and documentation issues

2016-09-04 Thread Otared Kavian
Hi Florian,

The following setup works fine here, I wonder whether this is what you want:

\defineenumeration[theorem]
[text={Theorem},
style=slanted,
title=yes,
alternative=hanging,
%   hang=2,
width=fit,
right={~},
way=bychapter,
%   way=bysection,
prefix=yes,
%   prefixsegments={chapter:section},
prefixsegments={chapter},
]

Another more versatile solution is to define an enumeration like the \proclaim 
definition of plain TeX, as follows:

\defineenumeration[proclaim]
[text=,
style=slanted,
title=yes,
titleleft=,
titleright={.},
alternative=hanging,
%   hang=2,
width=fit,
right={~},
way=bychapter,
%   way=bysection,
prefix=yes,
%   prefixsegments={chapter:section},
prefixsegments={chapter},
]

and the use it as in the following example:

\startproclaim{Pythagoras Theorem}
The square on the hypotenuse is equal to the sum of the squares on the other 
two sides.
\stopproclaim

You can play with other options in the setups above and tune them to your taste.

Best regards: OK

> On 4 Sep 2016, at 19:37, Florian Leupold  wrote:
> 
> Dear list,
> 
> I am trying to use enumerations with MKIV I am a bit at a loss when it comes 
> to the documentation (see below for a few issues).
> 
> Working on a concrete example, I have come pretty close to what I want for my 
> enumeration ‘theorem’:
> 
> \setupexternalfigures[location=default]
> \setupenumerations[
>   alternative=left,
>   text=Theorem,
>   headstyle=bold,
>   title=no,
>   way=bychapter,
>   stopper={:},
>   distance=1ex,
>   width=fit,
>   style=normal,
>   hang=fit]
> \defineenumeration[theorem]
> \starttext
> \chapter{First chapter}
> \starttheorem
> The square on the hypotenuse is equal to the sum of the squares on the other 
> two sides.
> \stoptheorem
> \chapter{Second chapter}
> \placefigure[right, none]{}{\externalfigure[mill]}
> \starttheorem
> The square on the hypotenuse is equal to the sum of the squares on the other 
> two sides.
> \stoptheorem
> \stoptext
> 
> QUESTIONS:
> 1) I would like to prefix the theorem counter with the chapter number, such 
> that the number of the second theorem becomes 2.1. Can this be done?
> 2) Is it possible to circumvent the misplacement of the second theorem due to 
> the placed figure? Ideally, the theorem would just use the space to the left 
> it.
> 
> Issues with the documentation:
> - In “ConTeXt Commands”, it says on page 224 that \setupenumeration inherits 
> from \setupcounter; but in “ConTEXt reference manual", it says on page 246 
> that \setupenumerations inherits from \setupdescriptions.
> - In “ConTEXt reference manual”, the key “location” for \defineenumeration 
> should probably replaced by “alternative”. Right now, all examples on page 
> 247 are unaffected by this setting and hence look the same.
> - The wiki seems to use MKII, which makes a difference for the example on 
> http://wiki.contextgarden.net/Command/enumeration, which compiles differently 
> under ConTeXT online.
> 
> Thanks for your help!
> 
> Best regards,
> 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
> ___

___
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] Enumeration: chapter in counter, problem next to placefigure, and documentation issues

2016-09-04 Thread Florian Leupold
Dear list,

I am trying to use enumerations with MKIV I am a bit at a loss when it comes to 
the documentation (see below for a few issues).

Working on a concrete example, I have come pretty close to what I want for my 
enumeration ‘theorem’:

\setupexternalfigures[location=default]
\setupenumerations[
alternative=left,
text=Theorem,
headstyle=bold,
title=no,
way=bychapter,
stopper={:},
distance=1ex,
width=fit,
style=normal,
hang=fit]
\defineenumeration[theorem]
\starttext
\chapter{First chapter}
\starttheorem
The square on the hypotenuse is equal to the sum of the squares on the other 
two sides.
\stoptheorem
\chapter{Second chapter}
\placefigure[right, none]{}{\externalfigure[mill]}
\starttheorem
The square on the hypotenuse is equal to the sum of the squares on the other 
two sides.
\stoptheorem
\stoptext

QUESTIONS:
1) I would like to prefix the theorem counter with the chapter number, such 
that the number of the second theorem becomes 2.1. Can this be done?
2) Is it possible to circumvent the misplacement of the second theorem due to 
the placed figure? Ideally, the theorem would just use the space to the left it.

Issues with the documentation:
- In “ConTeXt Commands”, it says on page 224 that \setupenumeration inherits 
from \setupcounter; but in “ConTEXt reference manual", it says on page 246 that 
\setupenumerations inherits from \setupdescriptions.
- In “ConTEXt reference manual”, the key “location” for \defineenumeration 
should probably replaced by “alternative”. Right now, all examples on page 247 
are unaffected by this setting and hence look the same.
- The wiki seems to use MKII, which makes a difference for the example on 
http://wiki.contextgarden.net/Command/enumeration, which compiles differently 
under ConTeXT online.

Thanks for your help!

Best regards,
Florian


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] Opentype feature and "aligncharacter=yes"

2016-09-04 Thread Hans Hagen

On 9/4/2016 5:33 PM, Jose Luis Arellano wrote:

Hello Hans.


I have no clue what you expect ..

Use old style numbers as default feature in text and tabular-lining
numbers for tables.


and how about oldstyle tabular lining numbers ... if we would disable 
oldstyle then someone would complain that oldstyle fixed width digits 
would fail


\definefontfeature
  [system:tabnum]
  [system:tabnum]
  [onum=no]

\definefontfeature[default][default][onum=yes]

\setupbodyfont[pagella]

\starttext

\enabledirectives[typesetters.characteralign.autofont]

\bTABLE
\setupTABLE[alignmentcharacter={text->.},aligncharacter=yes,align=middle]
\bTR \bTD 1.23456789 \eTD \eTR
\bTR \bTD 12.3456789 \eTD \eTR
\bTR \bTD 123.456789 \eTD \eTR
\eTABLE

\disabledirectives[typesetters.characteralign.autofont]

\bTABLE
\setupTABLE[alignmentcharacter={text->.},aligncharacter=yes,align=middle]
\bTR \bTD 1.23456789 \eTD \eTR
\bTR \bTD 12.3456789 \eTD \eTR
\bTR \bTD 123.456789 \eTD \eTR
\eTABLE

\stoptext



what font is used? Not all fonts have those num features.

This issue is not related to font. You can reproduce it with default
font (Latin Modern) just use the MWE.

Thanks

2016-09-04 6:40 GMT-03:00 Hans Hagen :

On 9/4/2016 6:38 AM, Jose Luis Arellano wrote:


Hello list.
I want to report a very annoying issue when one use oldstyle numbers
by default. You can check the result in the following MWE:

%\definefontfeature[default][default][onum=yes]
\definefontfeature[lnum][tnum=yes,lnum=yes]

\starttext
\bTABLE

\setupTABLE[alignmentcharacter={text->.},aligncharacter=yes,align=middle,style={\feature[+][lnum]}]
\bTR \bTD 1.23456789 \eTD \eTR
\bTR \bTD 12.3456789 \eTD \eTR
\bTR \bTD 123.456789 \eTD \eTR
\eTABLE
\stoptext

As you can see, when you uncomment the line above, "aligncharacter"
has no effect.



I have no clue what you expect .. what font is used? Not all fonts have
those num features.

Hans


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

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




--

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

Re: [NTG-context] Captions numbering

2016-09-04 Thread Jose Luis Arellano
2016-09-04 6:42 GMT-03:00 Wolfgang Schuster :
> Use "incrementnumber=list" to get TOC entries for your unnumbered sections.
>
> Wolfgang

Hello Wolfgang.

In fact, with the option "incrementnumber=list" you can to show
unnumbered section in TOC but unfortunately this causes the captions
numbering problem.
In the following example you can check that when one use a
figure/table in a unnumbered section, captions will shown as Table 1,
and not as Table 1.1.

\setuphead[chapter, section, subsection]
\setuphead[subsubsection][number=no,incrementnumber=list]
\starttext
\starttitle[title={Contents}]
\stoptitle
\placelist[chapter,section,subsubsection]
\starttitle[title={Figures}]
\stoptitle
\placelist[figure]
\startchapter[title=Chapter title]
\input ward
\startsection[title=Section title1]
\input ward
\placefigure[here][]{Caption}{\externalfigure[dummy]}
\startsubsubsection[title=Subsubsection title]
\input ward
\placefigure[here][]{Caption}{\externalfigure[dummy]}
\stopsubsubsection
\stopsection
\stopsection
\stopchapter
\stoptext

Thanks.
___
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] Opentype feature and "aligncharacter=yes"

2016-09-04 Thread Jose Luis Arellano
Hello Hans.

> I have no clue what you expect ..
Use old style numbers as default feature in text and tabular-lining
numbers for tables.

>what font is used? Not all fonts have those num features.
This issue is not related to font. You can reproduce it with default
font (Latin Modern) just use the MWE.

Thanks

2016-09-04 6:40 GMT-03:00 Hans Hagen :
> On 9/4/2016 6:38 AM, Jose Luis Arellano wrote:
>>
>> Hello list.
>> I want to report a very annoying issue when one use oldstyle numbers
>> by default. You can check the result in the following MWE:
>>
>> %\definefontfeature[default][default][onum=yes]
>> \definefontfeature[lnum][tnum=yes,lnum=yes]
>>
>> \starttext
>> \bTABLE
>>
>> \setupTABLE[alignmentcharacter={text->.},aligncharacter=yes,align=middle,style={\feature[+][lnum]}]
>> \bTR \bTD 1.23456789 \eTD \eTR
>> \bTR \bTD 12.3456789 \eTD \eTR
>> \bTR \bTD 123.456789 \eTD \eTR
>> \eTABLE
>> \stoptext
>>
>> As you can see, when you uncomment the line above, "aligncharacter"
>> has no effect.
>
>
> I have no clue what you expect .. what font is used? Not all fonts have
> those num features.
>
> Hans
>
>
> -
>   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
> ___
___
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] Creating cloze texts

2016-09-04 Thread Florian Leupold

> On 04.09.16, at 16:28, Florian Leupold  wrote:
> 
> 
>> On 04.09.16, at 14:14, Hans Hagen  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




signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] Creating cloze texts

2016-09-04 Thread Florian Leupold

> On 04.09.16, at 14:14, Hans Hagen  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


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] Creating cloze texts

2016-09-04 Thread Hans Hagen

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
___

Re: [NTG-context] Creating cloze texts

2016-09-04 Thread Hans Hagen

On 9/2/2016 3:27 PM, Florian Leupold wrote:

Dear list,

I would like to create cloze texts for my students with ConTeXt.

Ideally, I would have a command \cloze[]{} with the following 
functionality:

1) \cloze{} would insert an underlined gap in the text with a width 
of (say) 1.3 times the width of solution and puts the solution on top of it with 
centered alignment. I will then color the text read if the mode is ‘teacher’ and in 
white if not.
2) \cloze[]{} would do the same, but with a fixed width of the 
underline. The solution should then be flush left, maybe with a horizontal space of \quad.
3) The underline should allow for line breaks and hyphenation, but not such 
that only empty space is broken into the next line of left in the previous (see 
MNWE).

In this way, the student’s and teacher’s versions of the script will look 
exactly the same, except for the visible solution in the teacher’s version.

The macro \underbar does a good job in terms of line breaks and hyphenation. But it is 
"too smart" in the sense that it does not underline horizontal spaces. The MNWE 
below showcases problems with my naive attempts to achieve underlining:
- CLOZE 1 does not have any extra space.
- CLOZE 2 does not underline the horizontal spaces.
- CLOZE 3 does not show the underline, supposedly because the first text 
elements in it are white.
- CLOZE 4 shows that introducing fake characters is not a good idea anyways 
because the cloze is broken without any “real” solution in the first line.
- CLOZE 5 shows the same for trailing space.

MNWE:
\starttext
\input ward
\underbar{\color[red]{CLOZE 1}}
\input ward
\underbar{\quad\color[red]{CLOZE 2}\quad}
\input ward
\underbar{\color[white]{x}\quad\color[red]{CLOZE 3}\quad\color[white]{x}}
\input ward
\underbar{\color[green]{x}\quad\color[red]{CLOZE 4}\quad\color[white]{x}}
\input ward
space \underbar{\color[red]{CLOZE 5}\qquad\color[white]{x}} space
\input ward
\stoptext

I would greatly appreciate help with this problem.


\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


--

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

Re: [NTG-context] Captions numbering

2016-09-04 Thread Wolfgang Schuster

Jose Luis Arellano 
3. September 2016 um 04:35
Thanks for the answer Jan, but unfortunately this doesn't solve my
problem because the option "incrementnumber=no" causes that the
unnumbered section are not show in TOC.

Use "incrementnumber=list" to get TOC entries for your unnumbered sections.

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] Opentype feature and "aligncharacter=yes"

2016-09-04 Thread Hans Hagen

On 9/4/2016 6:38 AM, Jose Luis Arellano wrote:

Hello list.
I want to report a very annoying issue when one use oldstyle numbers
by default. You can check the result in the following MWE:

%\definefontfeature[default][default][onum=yes]
\definefontfeature[lnum][tnum=yes,lnum=yes]

\starttext
\bTABLE
\setupTABLE[alignmentcharacter={text->.},aligncharacter=yes,align=middle,style={\feature[+][lnum]}]
\bTR \bTD 1.23456789 \eTD \eTR
\bTR \bTD 12.3456789 \eTD \eTR
\bTR \bTD 123.456789 \eTD \eTR
\eTABLE
\stoptext

As you can see, when you uncomment the line above, "aligncharacter"
has no effect.


I have no clue what you expect .. what font is used? Not all fonts have 
those num features.


Hans


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

Re: [NTG-context] \vfill shifts content off grid

2016-09-04 Thread Wolfgang Schuster

Henri Menke 
31. August 2016 um 19:45
Dear list,

when I use a body font size other than the standard, issuing \vfill 
will move the content off the grid. MWE is below. How do I fix this?


Cheers, Henri

---

\setupbodyfont[9pt]
\setuplayout[grid=yes]
\showgrid
\starttext
Hello

\vfill

World
\stoptext


You can calculate the number of lines which have to be inserted to move 
the text
to the bottom of the text. The first step for this is to put the text 
which should be
moved into a \vbox which allows paragraphs and not only short texts. 
Afterwards
you can determine how much space is left on the page and with the 
\getnoflines

command you get the number of lines for the free space.

 begin example
\define\MoveToBottom
  {\par
   \dowithnextbox
 
{\scratchdimen\dimexpr\pagegoal-\pagetotal-\nextboxht-\lineheight\relax

  \getnoflines\scratchdimen
  \emptylines[\number\noflines]%
  \flushnextbox}
 \vbox}

\setuplayout[grid=yes]

\showgrid

\starttext

Hello

\MoveToBottom{World}

\page

\input knuth

\MoveToBottom{\input ward }

\stoptext
 end example

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
___