Re: [NTG-context] Unicode superscript and subscript parentheses as operators

2021-12-30 Thread Hans Åberg via ntg-context

> On 28 Dec 2021, at 23:05, Hans Hagen  wrote:
> 
> On 12/28/2021 10:53 PM, Hans Åberg wrote:
> 
>> This is great, though there is a typo in the second line. I attach a 
>> corrected example, illustrating what I might use it for: A logic program, 
>> where I found it readable in plain text to use the Unicode superscript and 
>> subscript parentheses. But when typeset, they should be superscripts and 
>> subscripts.
> i still want to come up with domain specific math features ... sp fpr 
> instance we could have a module for logic but it's users who have to come up 
> with demands ...

With direct bindings in LuaTeX it might be easier. —TeX syntax is good for 
writing by hand only.


___
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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Åberg via ntg-context

> On 28 Dec 2021, at 23:05, Hans Hagen  wrote:
> 
> On 12/28/2021 10:53 PM, Hans Åberg wrote:
> 
>> This is great, though there is a typo in the second line. I attach a 
>> corrected example, illustrating what I might use it for: A logic program, 
>> where I found it readable in plain text to use the Unicode superscript and 
>> subscript parentheses. But when typeset, they should be superscripts and 
>> subscripts.
> i still want to come up with domain specific math features ... sp fpr 
> instance we could have a module for logic but it's users who have to come up 
> with demands ...

I found using Unicode superscript and subscript parentheses more readable in 
general than the TeX convention in plain text. Otherwise, the program has logic 
as a basis, but is not intended to be restricted to that. FYI, the program is 
posted here, but has some dependencies to get running. The directory 'tests' 
has examples that are precompiled (checked agains with 'make check').

https://savannah.gnu.org/git/?group=metalogic-inference


___
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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Åberg via ntg-context

> On 28 Dec 2021, at 23:03, Hans Hagen  wrote:
> 
> On 12/28/2021 10:53 PM, Hans Åberg wrote:
>> \starttext
>> Course-of-values induction:
>>   $$휞 ⊢ 푷(0); 휞, 풚 ≤ 풙 ⇒ 푷(풚) ⊢⁽풚⁾₍풙₎ 푷(s(풙)) ⊩ 휞 ⊢ 푷(풕)$$
>> \stoptext
> 
> stay away from $$ but use
> 
>  \startformula
>  휞 ⊢ 푷(0); 휞, 풚 ≤ 풙 ⇒ 푷(풚) ⊢⁽풚⁾₍풙₎ 푷(s(풙)) ⊩ 휞 ⊢ 푷(풕)
>  \stopformula

Thanks, I am aware if that, but wrote it in a hurry. :-)


___
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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Hagen via ntg-context

On 12/28/2021 10:53 PM, Hans Åberg wrote:


This is great, though there is a typo in the second line. I attach a corrected 
example, illustrating what I might use it for: A logic program, where I found 
it readable in plain text to use the Unicode superscript and subscript 
parentheses. But when typeset, they should be superscripts and subscripts.
i still want to come up with domain specific math features ... sp fpr 
instance we could have a module for logic but it's users who have to 
come up with demands ...


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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Hagen via ntg-context

On 12/28/2021 10:53 PM, Hans Åberg wrote:



On 28 Dec 2021, at 22:29, Hans Hagen  wrote:

\protected\def\FancySuperscript#1⁾{\superscript{#1}}
\protected\def\FancySubscript  #1₍{\subscript  {#1}}

\protected\def\FancyScripts
  {\catcode`⁽=\activecatcode\letcharcode`⁽=\FancySuperscript
   \catcode`₍=\activecatcode\letcharcode`₍=\FancySubscript}

\appendtoks
\FancyScripts
\to \everymathematics

\starttext

test $ x⁽3y⁾ $

\stoptext


This is great, though there is a typo in the second line. I attach a corrected 
example, illustrating what I might use it for: A logic program, where I found 
it readable in plain text to use the Unicode superscript and subscript 
parentheses. But when typeset, they should be superscripts and subscripts.

—
\definefallbackfamily 
[mainface][serif][stixtwotext][range={00B2-00B3,00B9,02070-0208F},force=yes]

\definefallbackfamily [mainface][mono][stix][range={0100-10},force=yes]

\definefallbackfamily 
[mainface][mono][stixtwotext][range={00B2-00B3,00B9,02070-0208F},force=yes]
\definefallbackfamily 
[mainface][math][stixtwomath][range={00B2-00B3,00B9,02070-0208F},force=yes]

\definefontfamily [mainface][serif][stix]
\definefontfamily [mainface][mono][courier]

\definefontfamily [mainface][math][stix]

\setupbodyfont[mainface,10pt]

\setmathfontalternate{upright}

\setupmathematics[integral=nolimits, lcgreek=normal, default=normal]
\setupformulae[location=left, indentnext=auto]
\setuptyping[indentnext=auto]

% Might use: 'small' indentation, no indentation on 'first':
\setupindenting[yes, medium, next]
\setupheads[indentnext=yes]

\setupinteraction[state=start, click=yes, focus=standard, color=darkblue]

\mainlanguage[en]


\protected\def\FancySuperscript#1⁾{\superscript{#1}}
\protected\def\FancySubscript  #1₎{\subscript  {#1}}

\protected\def\FancyScripts
  {\catcode`⁽=\activecatcode\letcharcode`⁽=\FancySuperscript
   \catcode`₍=\activecatcode\letcharcode`₍=\FancySubscript}

\appendtoks
\FancyScripts
\to \everymathematics

\starttext
Course-of-values induction:
   $$휞 ⊢ 푷(0); 휞, 풚 ≤ 풙 ⇒ 푷(풚) ⊢⁽풚⁾₍풙₎ 푷(s(풙)) ⊩ 휞 ⊢ 푷(풕)$$

\stoptext


stay away from $$ but use

  \startformula
  휞 ⊢ 푷(0); 휞, 풚 ≤ 풙 ⇒ 푷(풚) ⊢⁽풚⁾₍풙₎ 푷(s(풙)) ⊩ 휞 ⊢ 푷(풕)
  \stopformula




--

-
  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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Åberg via ntg-context

> On 28 Dec 2021, at 22:29, Hans Hagen  wrote:
> 
> \protected\def\FancySuperscript#1⁾{\superscript{#1}}
> \protected\def\FancySubscript  #1₍{\subscript  {#1}}
> 
> \protected\def\FancyScripts
>  {\catcode`⁽=\activecatcode\letcharcode`⁽=\FancySuperscript
>   \catcode`₍=\activecatcode\letcharcode`₍=\FancySubscript}
> 
> \appendtoks
>\FancyScripts
> \to \everymathematics
> 
> \starttext
> 
> test $ x⁽3y⁾ $
> 
> \stoptext

This is great, though there is a typo in the second line. I attach a corrected 
example, illustrating what I might use it for: A logic program, where I found 
it readable in plain text to use the Unicode superscript and subscript 
parentheses. But when typeset, they should be superscripts and subscripts.

—
\definefallbackfamily 
[mainface][serif][stixtwotext][range={00B2-00B3,00B9,02070-0208F},force=yes]

\definefallbackfamily [mainface][mono][stix][range={0100-10},force=yes]

\definefallbackfamily 
[mainface][mono][stixtwotext][range={00B2-00B3,00B9,02070-0208F},force=yes]
\definefallbackfamily 
[mainface][math][stixtwomath][range={00B2-00B3,00B9,02070-0208F},force=yes]

\definefontfamily [mainface][serif][stix]
\definefontfamily [mainface][mono][courier]

\definefontfamily [mainface][math][stix]

\setupbodyfont[mainface,10pt]

\setmathfontalternate{upright}

\setupmathematics[integral=nolimits, lcgreek=normal, default=normal]
\setupformulae[location=left, indentnext=auto]
\setuptyping[indentnext=auto]

% Might use: 'small' indentation, no indentation on 'first':
\setupindenting[yes, medium, next]
\setupheads[indentnext=yes]

\setupinteraction[state=start, click=yes, focus=standard, color=darkblue]

\mainlanguage[en]


\protected\def\FancySuperscript#1⁾{\superscript{#1}}
\protected\def\FancySubscript  #1₎{\subscript  {#1}}

\protected\def\FancyScripts
 {\catcode`⁽=\activecatcode\letcharcode`⁽=\FancySuperscript
  \catcode`₍=\activecatcode\letcharcode`₍=\FancySubscript}

\appendtoks
   \FancyScripts
\to \everymathematics

\starttext
Course-of-values induction:
  $$휞 ⊢ 푷(0); 휞, 풚 ≤ 풙 ⇒ 푷(풚) ⊢⁽풚⁾₍풙₎ 푷(s(풙)) ⊩ 휞 ⊢ 푷(풕)$$

\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] Unicode superscript and subscript parentheses as operators

2021-12-28 Thread Hans Hagen via ntg-context

On 12/28/2021 5:54 PM, Hans Åberg via ntg-context wrote:

Is it possible to use the Unicode superscript and subscript parentheses as 
superscript and subscript operators? That is, ⁽…⁾ having the same function as 
^{…}, and ₍…₎ as _{…}.

It might be something like the following, but somehow bundling the last part of 
\letcharcode into a command.
\appendtoks
  \catcode`⁽=\activecatcode
  \letcharcode `⁽ ^{
  \catcode`⁾=\activecatcode
  \letcharcode `⁾ }
  \catcode`₍=\activecatcode
  \letcharcode `₍ _{
  \catcode`₎=\activecatcode
  \letcharcode `₎ }
\to \everymathematics



\protected\def\FancySuperscript#1⁾{\superscript{#1}}
\protected\def\FancySubscript  #1₍{\subscript  {#1}}

\protected\def\FancyScripts
  {\catcode`⁽=\activecatcode\letcharcode`⁽=\FancySuperscript
   \catcode`₍=\activecatcode\letcharcode`₍=\FancySubscript}

\appendtoks
\FancyScripts
\to \everymathematics

\starttext

test $ x⁽3y⁾ $

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