[NTG-context] Wiki: new commands not automatically available for autogenerated syntax (was LTR footnotes from RTL paragraph)

2022-01-12 Thread Denis Maier via ntg-context
Hi, I wanted to wikify a new command, but I don't fully understand what to do...

> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Donnerstag, 13. Januar 2022 00:25
> An: Maier, Denis Christian (UB) ; ntg-
> cont...@ntg.nl
> Cc: oi...@gmx.es
> Betreff: Re: AW: [NTG-context] LTR footnotes from RTL paragraph
> 
[...]
> >>
> >> i'll add this (only a few line addition with no performance hit):
> >>
> >> \definealign[MyAlign][r2l,flushleft]
> >>
> >> so that you can do
> >>
> >> \setupalign[MyAlign]
> >>
> >> and you can also use it as value to the align parameter as well ...
> >> the usual 'context abstraction'
> >>
> >> so again something to wikify ...
> >
> > Wanted to wikify, but is this already implemented?
> sure

Ok, so then: Why will creating a page \definealign not create a page with 
autogenerated syntax? And, the new option for \setupalign does not show up in 
the autogenerated syntax overview at 
https://wiki.contextgarden.net/Command/setupalign

I probably don't fully understand how the wiki works in these regards .. can 
anyone clarify?

Denis

___
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] Conditional text appearing in a fixed vertical space

2022-01-12 Thread fv leung via ntg-context
You can also consider using viewerlayer:


\setupinteraction[state=start]

\defineviewerlayer[solution]

\setupcolors[state=start]
\usecolors[xwi]
\definecolor[keyColor][1.0(maroon)]

\starttext

\startitemize[n]
  \but[ToggleLayer{solution}]
  \samplefile{tufte}
  \blank[big]
  \startviewerlayer[solution]
\keyColor
\samplefile{knuth}
  \stopviewerlayer
\stopitemize

\stoptext

I print the file with the solution layer off to a 'clean' file for students.

Gavin via ntg-context  於 2022年1月12日 週三 下午11:30寫道:

> Thanks Fabrice and Aditya!
>
> With three completely different approaches, I learned three times more
> than I was expecting. This has been a great help. I will probably use the
> framedtext method, but I learned something from each.
>
> Gavin
>
>
> > On Jan 11, 2022, at 4:44 PM, Aditya Mahajan  wrote:
> >
> > On Tue, 11 Jan 2022, Gavin via ntg-context wrote:
> >
> >> Hello List,
> >>
> >> I am making problem sets for a physics class. Solutions use the style
> defined in the example below, and only appear if the “solution” mode is
> enabled. I am struggling to get a vertical space for the solution which is
> the same whether or not the solution is printed. Different problems require
> different amounts of space, so this should be an argument or key-value.
> >
> > This is how I would do it: piggyback on framedtext. Note that framedtext
> doesn't break across pages. So, if you have long answers, a different
> mechanism is needed.
> >
> > \definemode[solution][no]
> >
> > \doifmodeelse{solution}
> >  {\defineframedtext[solution][empty=no]}
> >  {\defineframedtext[solution][empty=yes]}
> >
> > % Doesn't work. Why?
> > %
> \expanded{\defineframedtext[solution][empty=\doifmodeelse{solution}{no}{yes}]}
> >
> > \setupframedtext
> >  [solution]
> >  [
> >spacebefore=medium,
> >spaceafter=medium,
> >width=broad,
> >foregroundstyle=\rm\it,
> >loffset=2em,
> >roffset=2em,
> >indentnext=no,
> >  ]
> >
> >
> > \starttext
> >
> > Sample question. Always show answer.
> >
> > \startsolution[height=1in, empty=no]
> >  Alotta wood!
> > \stopsolution
> >
> >
> > How much wood?
> >
> > \startsolution[height=1in]
> >  Alotta wood!
> > \stopsolution
> >
> > You don't need to specify the height:
> >
> > \startsolution
> >  \input ward
> > \stopsolution
> >
> > No more questions.
> > \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
>
> ___
>
___
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] LTR footnotes from RTL paragraph

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

On 1/12/2022 9:57 PM, denis.ma...@unibe.ch wrote:

-Ursprüngliche Nachricht-
Von: Hans Hagen 
Gesendet: Freitag, 17. Dezember 2021 12:24
An: mailing list for ConTeXt users 
Cc: Maier, Denis Christian (UB) ; oi...@gmx.es
Betreff: Re: [NTG-context] LTR footnotes from RTL paragraph

On 12/17/2021 10:02 AM, Denis Maier via ntg-context wrote:

-Ursprüngliche Nachricht-
Von: ntg-context  Im Auftrag von Pablo
Rodriguez via ntg-context
Gesendet: Donnerstag, 16. Dezember 2021 18:07
An: Denis Maier via ntg-context 
Cc: Pablo Rodriguez 
Betreff: Re: [NTG-context] LTR footnotes from RTL paragraph

On 12/16/21 12:34 PM, Denis Maier via ntg-context wrote:

Ok, this works:

\setupnote[footnote][align=l2r]

Does that have any drawbacks?


Hi Denis,

I don’t think it may have (other than forgetting other options, such
as hz or hanging).


Ah, I alway forget that. By the way, is there a way to append to setting

instead of overriding it?

sure, but I don't think it needs to be avocated (valid but not intuitive)

i'll add this (only a few line addition with no performance hit):

\definealign[MyAlign][r2l,flushleft]

so that you can do

\setupalign[MyAlign]

and you can also use it as value to the align parameter as well ... the usual
'context abstraction'

so again something to wikify ...


Wanted to wikify, but is this already implemented?

sure

-
  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] LTR footnotes from RTL paragraph

2022-01-12 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Freitag, 17. Dezember 2021 12:24
> An: mailing list for ConTeXt users 
> Cc: Maier, Denis Christian (UB) ; oi...@gmx.es
> Betreff: Re: [NTG-context] LTR footnotes from RTL paragraph
> 
> On 12/17/2021 10:02 AM, Denis Maier via ntg-context wrote:
> >> -Ursprüngliche Nachricht-
> >> Von: ntg-context  Im Auftrag von Pablo
> >> Rodriguez via ntg-context
> >> Gesendet: Donnerstag, 16. Dezember 2021 18:07
> >> An: Denis Maier via ntg-context 
> >> Cc: Pablo Rodriguez 
> >> Betreff: Re: [NTG-context] LTR footnotes from RTL paragraph
> >>
> >> On 12/16/21 12:34 PM, Denis Maier via ntg-context wrote:
> >>> Ok, this works:
> >>>
> >>> \setupnote[footnote][align=l2r]
> >>>
> >>> Does that have any drawbacks?
> >>
> >> Hi Denis,
> >>
> >> I don’t think it may have (other than forgetting other options, such
> >> as hz or hanging).
> >
> > Ah, I alway forget that. By the way, is there a way to append to setting
> instead of overriding it?
> 
> sure, but I don't think it needs to be avocated (valid but not intuitive)
> 
> i'll add this (only a few line addition with no performance hit):
> 
>\definealign[MyAlign][r2l,flushleft]
> 
> so that you can do
> 
>\setupalign[MyAlign]
> 
> and you can also use it as value to the align parameter as well ... the usual
> 'context abstraction'
> 
> so again something to wikify ...

Wanted to wikify, but is this already implemented? 

Denis


___
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] \sub conflict with my def

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

On 1/12/2022 7:34 PM, Gavin via ntg-context wrote:

Hi List,

I am converting problem sets from LaTeX to ConTeXt and ran into a puzzling 
problem. I define \sub to produce subscript text in math mode. (See definition 
below.) This worked for my ConTeXt book, but fails in the problem sets because 
in ConTeXt \sub is a special item command, and I use itemize to number problems.

Obviously, I can rename my \sub command, but it is already used in hundreds of 
problems and solutions that I am converting. Is there a way to get my \sub to 
work in an itemize? I only need it in math mode. I will never use \sub for its 
ConTeXt itemizing purpose.


\appendtoks
\define[1]\sub{_{\text{\rm\tf#1}}}%
\to \everymathematics

or nicer:

\define[1]\MyMathSub{_{\text{\rm\tf#1}}}

\appendtoks
\let\sub\MyMathSub
\to \everymathematics



Thanks!
Gavin


\define[1]\sub{_{\text{\rm\tf#1}}}

\starttext

$E\sub{final}$ is the final energy, but not in an itemize:

\startitemize
\item $E_{\text{\rm final}}$ is the final energy.
\item $E\sub{final}$ is a mess.
\stopitemize

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



--

-
  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] \sub conflict with my def

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

I am converting problem sets from LaTeX to ConTeXt and ran into a puzzling 
problem. I define \sub to produce subscript text in math mode. (See definition 
below.) This worked for my ConTeXt book, but fails in the problem sets because 
in ConTeXt \sub is a special item command, and I use itemize to number problems.

Obviously, I can rename my \sub command, but it is already used in hundreds of 
problems and solutions that I am converting. Is there a way to get my \sub to 
work in an itemize? I only need it in math mode. I will never use \sub for its 
ConTeXt itemizing purpose.

Thanks!
Gavin


\define[1]\sub{_{\text{\rm\tf#1}}}

\starttext

$E\sub{final}$ is the final energy, but not in an itemize:

\startitemize
\item $E_{\text{\rm final}}$ is the final energy.
\item $E\sub{final}$ is a mess.
\stopitemize

\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] Conditional text appearing in a fixed vertical space

2022-01-12 Thread Gavin via ntg-context
Thanks Fabrice and Aditya!

With three completely different approaches, I learned three times more than I 
was expecting. This has been a great help. I will probably use the framedtext 
method, but I learned something from each.

Gavin


> On Jan 11, 2022, at 4:44 PM, Aditya Mahajan  wrote:
> 
> On Tue, 11 Jan 2022, Gavin via ntg-context wrote:
> 
>> Hello List,
>> 
>> I am making problem sets for a physics class. Solutions use the style 
>> defined in the example below, and only appear if the “solution” mode is 
>> enabled. I am struggling to get a vertical space for the solution which is 
>> the same whether or not the solution is printed. Different problems require 
>> different amounts of space, so this should be an argument or key-value.
> 
> This is how I would do it: piggyback on framedtext. Note that framedtext 
> doesn't break across pages. So, if you have long answers, a different 
> mechanism is needed. 
> 
> \definemode[solution][no]
> 
> \doifmodeelse{solution}
>  {\defineframedtext[solution][empty=no]}
>  {\defineframedtext[solution][empty=yes]}
> 
> % Doesn't work. Why?
> % 
> \expanded{\defineframedtext[solution][empty=\doifmodeelse{solution}{no}{yes}]}
> 
> \setupframedtext
>  [solution]
>  [
>spacebefore=medium,
>spaceafter=medium,
>width=broad,
>foregroundstyle=\rm\it,
>loffset=2em,
>roffset=2em,
>indentnext=no,
>  ]
> 
> 
> \starttext
> 
> Sample question. Always show answer.
> 
> \startsolution[height=1in, empty=no]
>  Alotta wood!
> \stopsolution
> 
> 
> How much wood? 
> 
> \startsolution[height=1in]
>  Alotta wood!
> \stopsolution
> 
> You don't need to specify the height:
> 
> \startsolution
>  \input ward
> \stopsolution
> 
> No more questions.
> \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] poetry \startlines and tab

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

On 1/12/2022 1:09 AM, jbf via ntg-context wrote:
For poetry that has non-regular indentations, I simply 
\definelines[poem] and set that up the way I want, obviously, with 
\setuplines[poem]  e.g. [before={\blank 
\setupinterlinespace[line=2.5ex]},after={\blank},indenting=first].


And then, but I guess it is still a hack, I use \hskip at a suitable 
dimension whenever I need indented lines:


\startpoem
This is line one,
\hskip1em{This is line two}
This is line three,
\hskip1em{This is line four,}
\hskip1em{This is line five.}

\rightaligned{Poet's name}
\stoppoem

\quad

-
  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] Radius attribute and scaling in lmt_shade[ ]

2022-01-12 Thread Keith McKay via ntg-context
Thanks Hans. Something else I've learned.
Best Wishes
Keith


On Sun, 9 Jan 2022, 22:26 Hans Hagen,  wrote:

> On 1/9/2022 4:53 PM, Keith McKay via ntg-context wrote:
> > Since "a picture paints a thousand words", I attach a pdf showing the
> > results of the execution of the code.
> >
> > Are these bugs or... ?
> more interplay between parameters ...
>
>  draw lmt_shade [
>  trace   = true,
>  path= r shifted - center r,
>  direction   = "up",
>  alternative = "circular",
>  radius  = k*cm,
>  colors  = { "MyColor1", "MyColor2" },
>  ] scaled 4 shifted((k *12)*cm,12*cm);
>
>
>
> -
>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
___