[NTG-context] Changed behavior from \convertnumber{arabicdecimals}{..} as a textcommand for note

2022-01-14 Thread musa furber via ntg-context
This week I updated ConTeXt minimals. Before then, I used the following
code so that footnotes to Arabic passages would have parenthesis around
them and use the digits used in Arabic texts in the Middle East (e.g.
٠١٢٣٤٥٦٧٨٩).

\setupnote [arfootnote] [
  headstyle={\switchtobodyfont[kitab]},
  textcommand=\footnotenotenumbercommand,
  alternative=text,
  ]
\define[1]\footnotenotenumbercommand{{\high{(\convertnumber{arabicdecimals}{#1})}}}

Since the update, for the 123rd footnote, I now get `(123arabic)` instead
of `(١٢٣)`.

Elsewhere, I do get the expected output (i.e. `١٢٣٢`) when calling
\convertnumber{arabicdecimals}{1232}

I'm still relatively new to ConTeXt, so I'm unsure if what used really is
correct, or if it was wrong and I now need to find the right way to do it.

Any help would be greatly appreciated.

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


Re: [NTG-context] Solved! Itemize columns with MPgraphics: another vertical spacing puzzle

2022-01-14 Thread Gavin via ntg-context
Thanks, Hans!

That works, and it makes sense. Playing with frames always pays, indeed.

-Gavin


> On Jan 14, 2022, at 3:18 PM, Hans Hagen  wrote:
> 
> On 1/14/2022 8:10 PM, Gavin via ntg-context wrote:
>> Hi List,
>> I solved this problem, but the solution is a bit mysterious to me. I was 
>> trying to solve another problem – removing the small space underneath the 
>> graphic in the framed box. I did this by adding boffset=-\strutdepth to the 
>> framed command. That not only got rid of the space inside the frame, it also 
>> removed the excess space between the rows in the itemize columns!
>> I don’t know why this fix solved both problems, but I’m happy with the 
>> result. Now I can use options for the choices – like packed and joinedup – 
>> with consistent results for any number of columns. I’ve put the fixed code 
>> and output below, for anyone who is interested.
>> Even when I’m a bit confused, I’m glad to be working with ConTeXt rather 
>> than any other system!
> 
> % your hack:
> 
> \define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,boffset=-\strutdepth,xframe=off]{\useMPgraphic{name}}}
> 
> % but ... you just don't want struts
> 
> \define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,strut=no,frame=off]{\useMPgraphic{name}}}
> 
> % and no offset but also no invisible frame
> 
> \define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=overlay,frame=off]{\useMPgraphic{name}}}
> 
> playing with framed for a while alway spays back
> 
> 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Solved! Itemize columns with MPgraphics: another vertical spacing puzzle

2022-01-14 Thread Hans Hagen via ntg-context

On 1/14/2022 8:10 PM, Gavin via ntg-context wrote:

Hi List,

I solved this problem, but the solution is a bit mysterious to me. I was trying 
to solve another problem – removing the small space underneath the graphic in 
the framed box. I did this by adding boffset=-\strutdepth to the framed 
command. That not only got rid of the space inside the frame, it also removed 
the excess space between the rows in the itemize columns!

I don’t know why this fix solved both problems, but I’m happy with the result. 
Now I can use options for the choices – like packed and joinedup – with 
consistent results for any number of columns. I’ve put the fixed code and 
output below, for anyone who is interested.

Even when I’m a bit confused, I’m glad to be working with ConTeXt rather than 
any other system!


% your hack:

\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,boffset=-\strutdepth,xframe=off]{\useMPgraphic{name}}}

% but ... you just don't want struts

\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,strut=no,frame=off]{\useMPgraphic{name}}}

% and no offset but also no invisible frame

\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=overlay,frame=off]{\useMPgraphic{name}}}

playing with framed for a while alway spays back

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Solved! Itemize columns with MPgraphics: another vertical spacing puzzle

2022-01-14 Thread Gavin via ntg-context
Hi List,

I solved this problem, but the solution is a bit mysterious to me. I was trying 
to solve another problem – removing the small space underneath the graphic in 
the framed box. I did this by adding boffset=-\strutdepth to the framed 
command. That not only got rid of the space inside the frame, it also removed 
the excess space between the rows in the itemize columns!

I don’t know why this fix solved both problems, but I’m happy with the result. 
Now I can use options for the choices – like packed and joinedup – with 
consistent results for any number of columns. I’ve put the fixed code and 
output below, for anyone who is interested.

Even when I’m a bit confused, I’m glad to be working with ConTeXt rather than 
any other system!

Best,
Gavin


\starttext

\defineitemgroup[questions]
\setupquestions [1] [n]
\define\question{\item}

\defineitemgroup[choices]
\setupchoices [each] [A,columns] [left=(, right=), width=1.7em, stopper=,]
\define\choice{\item}

\def\mycolor{.625red}

\startuseMPgraphic{name}
  fill fullcircle scaled 40pt withcolor \mycolor;
\stopuseMPgraphic

\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,boffset=-\strutdepth,frame=off]{\useMPgraphic{name}}}

Here are a few great looking multiple choice questions about colors.
\startquestions
\question What is your favorite color?
\startchoices[columns,four]
  \choice \mycolordot{.625red}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices

\question What is your least favorite color?
\startchoices[columns]
  \choice \mycolordot{.625red}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices

\question Toward which colors do you feel indifferent?
\startchoices[one]
  \choice \mycolordot{.625red}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices
\stopquestions

That's it for questions about colors!

\stoptext



PastedGraphic-2.pdf
Description: Adobe PDF document



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


Re: [NTG-context] Spacing issue in itemize

2022-01-14 Thread Aditya Mahajan via ntg-context
On Fri, 14 Jan 2022, Hans Hagen wrote:

> > @Hans: Does it make sense to add a setups key to \setupitemize to keep such
> > changes local?
> % 0 = before/after
> % 1 = between unless before
> % 2 = between
> 
> \c_strc_itemgroups_spacing_mode\plustwo
> 
> The question then is: "what key" (we have c!inherit available) and "what
> values" (numbers ?) ...

alternative = (a|b|c) like placelist?

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


[NTG-context] Itemize columns with MPgraphics: another vertical spacing puzzle

2022-01-14 Thread Gavin via ntg-context
Hi List,

I need to itemize graphics when I use those graphics as the choices in a 
multiple choice question. When I do that in columns, I am getting excess space 
below the graphics. See example code and output below. Any suggestions for how 
I get rid of this space?

I’m not sure if this is related to the itemize column spacing in my previous 
comment.

Thanks, again!
Gavin


\starttext

\defineitemgroup[choices]
\setupchoices [each] [A,joinedup] [left=(, right=), width=1.7em, stopper=,]
\define\choice{\item}

\def\mycolor{.625red}

\startuseMPgraphic{name}
  fill fullcircle scaled 40pt withcolor \mycolor;
\stopuseMPgraphic

\define[1]\mycolordot{\def\mycolor{#1}\framed[location=top,offset=0pt,frame=off]{\useMPgraphic{name}}}

What is your favorite color? (There is too much space after these choices.)
\startchoices[columns,four]
  \choice \mycolordot{.625red}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices

A ruledhboxs show the extra space is in the itemize, but not in the item 
contents.

\ruledhbox{\startchoices[columns, four]
  \choice \ruledhbox{\mycolordot{.625red}}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices}

Putting a ruledhbox around the first item shows that each item has extra space 
that is not part of the item contents. (The ruledhbox also messes with the 
horizontal alignment, but I don't care about that.)
\startchoices[columns]
  \ruledhbox{\choice \mycolordot{.625red}}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices

The extra space is not present without columns.
\startchoices
  \choice \mycolordot{.625red}
  \choice \mycolordot{.625blue}
  \choice \mycolordot{.625green}
  \choice \mycolordot{.625magenta}
\stopchoices

\ruledhbox{My favorite color is:\def\mycolor{.625blue}
\framed[location=top,offset=0pt,frame=on] {\useMPgraphic{name}}}

\stoptext



PastedGraphic-1.pdf
Description: Adobe PDF document
___
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
___


[NTG-context] process markdown file

2022-01-14 Thread J Huisman via ntg-context
Hi all,

I have updated to the latest version and it seems that the MarkDown
module is no longer part of the context installation. I get an
'undefined control sequence' error for \processmarkdownfile and the
module files are gone. Is this on purpose? Why has it been removed?
Can this please be restored?

MWE

\usemodule[markdown]
\starttext
\processmarkdownfile{file.md}
\stoptext

Manual solution: I have found the files 'm-markdown.lua' and
'm-markdown.mkiv' but I am not sure where/how to install them?

Thanks,

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


Re: [NTG-context] Spacing issue in itemize

2022-01-14 Thread Gavin via ntg-context
Hi Hans, Aditya, and all,

Let me add another case to this discussion. For multiple choice questions, it 
is nice to have the columns option. However, this produces somewhat 
inconsistent results. In the code below, without Aditya's tweak, there is space 
before the choices in the first two cases, which use columns, but not the last. 
Aditya’s  tweak makes them more consistent.

Adding [columns, one] to the last \startchoices makes the results consistent. 
When doing that, I noticed that the spacing between column rows is slightly 
larger than the spacing between items without columns. So, I am happy using 
[columns, one] as a solution for multiple choice problems, just somewhat 
surprised by the difference.

Gavin


\starttext

%\unprotect
%\c_strc_itemgroups_spacing_mode\plusone
%\protect

\defineitemgroup[questions]
\setupquestions [1] [n]
\define\question{\item}

\defineitemgroup[choices]
\setupchoices [each] [A] [left=(, right=), width=1.7em, stopper=,]
\define\choice{\item}

Here are a few great looking multiple choice questions about colors.
\startquestions
\question What is your favorite color?
\startchoices[columns,four]
  \item Red
  \item Blue
  \item Green
  \item Magenta
\stopitemize
\question What is your least favorite color?
\startchoices[columns]
  \item Red
  \item Blue
  \item Green
  \item Magenta
\stopitemize
\question Toward which colors do you feel indifferent?
\startchoices
  \item Red
  \item Blue
  \item Green
  \item Magenta
\stopitemize
\stopquestions
That's it for questions about colors!

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] clartype typescript

2022-01-14 Thread Hans Hagen via ntg-context

On 1/14/2022 2:26 PM, Youssef Cherem via ntg-context wrote:

Hello everyone,

I'm a new Context user, so pardon me if it's obvious.

I found the cleartype typescript, but can't figure out how to use it.

I thought it would be as easy as:

\usetypescript[cleartype]

But I am confused as to what to put in

\setupbodyfont[?]

(there are several sans fonts to choose from).

\setypbodyfont[calibri]

but you can directly do that without loading the typescript because we 
have it aliased


all assuming that youi have the font

(alternmatively you can use selectfont but then you need to know the 
FontName)


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] clartype typescript

2022-01-14 Thread Youssef Cherem via ntg-context
Hello everyone,

I'm a new Context user, so pardon me if it's obvious.

I found the cleartype typescript, but can't figure out how to use it.

I thought it would be as easy as:

\usetypescript[cleartype]

But I am confused as to what to put in

\setupbodyfont[?]

(there are several sans fonts to choose from).
___
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
___


Re: [NTG-context] \setupheadertexts not working when text contains \subject

2022-01-14 Thread Bruce Horrocks via ntg-context


> On 14 Jan 2022, at 07:48, Hans Hagen  wrote:
> 
> Ponder this:
> 
>  [{\stylePageHeader{\structureuservariable{author}}}]
> 
> versus this:
> 
>  [{\stylePageHeader{\namedstructureuservariable{chapter}{author}}}]
> 
> and you can guess what happens.

Thank-you for the quick response. It looks like I've been very lucky in my use 
of \structureuservariable so far. :-)
—
Bruce Horrocks
Hampshire, UK

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


Re: [NTG-context] Spacing issue in itemize

2022-01-14 Thread Hans Hagen via ntg-context

On 1/13/2022 6:15 PM, Aditya Mahajan via ntg-context wrote:

On Thu, 13 Jan 2022, Gavin via ntg-context wrote:


Hi list,

When I define an items group, it seems to mess up the spacing for a nested item 
group. See example below. Any ideas?

I’m typesetting with

> ConTeXt  ver: 2022.01.06 19:51 LMTX  fmt: 2022.1.9  int: 
english/english

on an M1 Mac.

Thanks!
Gavin


\usemodule[visual]

\defineitemgroup[questions]
\setupquestions [each] [n]

\starttext
This numbered list uses my item group \quotation{questions.} The itemize inside 
is missing space above item (a).
\startquestions
   \item \fakewords{15}{20}
 \startitemize[a][left=(,stopper=,right=)]
   \item \fakewords{10}{15}
   \item \fakewords{10}{15}
 \stopitemize
   \item \fakewords{10}{15}
\stopquestions

This numbered list uses itemize. The itemize inside has the expected space 
above item (a).
\startitemize[n]
   \item \fakewords{15}{20}
 \startitemize[a][left=(,stopper=,right=)]
   \item \fakewords{10}{15}
   \item \fakewords{10}{15}
 \stopitemize
   \item \fakewords{10}{15}
\stopitemize

\stoptext


This is by design. This is what is happening:

\usemodule[visual]

\defineitemgroup[questions]

\starttext
This numbered list uses my item group \quotation{questions.} The itemize inside 
is missing space above item (a).
\startquestions[n][inbetween={AAA}]
   \item \fakewords{15}{20}
 \startitemize[a][left=(,stopper=,right=),before={BBB}]
   \item \fakewords{10}{15}
   \item \fakewords{10}{15}
 \stopitemize
   \item \fakewords{10}{15}
\stopquestions

This numbered list uses itemize. The itemize inside has the expected space 
above item (a).
\startitemize[n][inbetween={AAA}]
   \item \fakewords{15}{20}
 \startitemize[a][left=(,stopper=,right=),before={BBB}]
   \item \fakewords{10}{15}
   \item \fakewords{10}{15}
 \stopitemize
   \item \fakewords{10}{15}
\stopitemize

\stoptext

Note that in the first case, the inbetween does not get inserted at the start 
of the nested itemization (because, ConTeXt doesn't think that they are nested 
as the names are different). But the before key of the nested itemization 
doesn't get inserted in both cases because ConTeXt thinks that the itemization 
is nested!

You can change this behavior by using:

\unprotect
\c_strc_itemgroups_spacing_mode\plusone
\protect

in which case both outputs are similar.

@Hans: Does it make sense to add a setups key to \setupitemize to keep such 
changes local?

% 0 = before/after
% 1 = between unless before
% 2 = between

\c_strc_itemgroups_spacing_mode\plustwo

The question then is: "what key" (we have c!inherit available) and "what 
values" (numbers ?) ...


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___