ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Repeating binary operators with split multiline formulas
@ 2022-08-20 23:04 Adam Reviczky via ntg-context
  2022-08-21  8:01 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Reviczky via ntg-context @ 2022-08-20 23:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Adam Reviczky


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

Hi,

Since there has been a lot of work done on the math side of things, I
wanted to ask if there is an automated way to have binary operators
repeated when splitting a formula.

From the MKIV math manual there is an option to move the operators into the
new line:

\setupmathematics[setups=math:spacing:split]
\setupformulas[split=yes,align=flushleft]
\startformula
x\dorecurse{30}{ + #1x^{#1x}} = 10
\stopformula

Would it be possible to achieve this via a custom setup like
math:spacing:split to get an output like this?

𝑥 + 1𝑥1𝑥 + 2𝑥2𝑥 + 3𝑥3𝑥 + 4𝑥4𝑥 + 5𝑥5𝑥 + 6𝑥6𝑥 + 7𝑥7𝑥 + 8𝑥8𝑥 +
9𝑥9𝑥 + 10𝑥10𝑥 +
+ 11𝑥11𝑥 + 12𝑥12𝑥 + 13𝑥13𝑥 + 14𝑥14𝑥 + 15𝑥15𝑥 + 16𝑥16𝑥 + 17𝑥17𝑥 +
18𝑥18𝑥 + 19𝑥19𝑥 +
+ 20𝑥20𝑥 + 21𝑥21𝑥 + 22𝑥22𝑥 + 23𝑥23𝑥 + 24𝑥24𝑥 + 25𝑥25𝑥 + 26𝑥26𝑥 +
27𝑥27𝑥 + 28𝑥28𝑥 +
+ 29𝑥29𝑥 + 30𝑥30𝑥 = 10

Adam

[-- Attachment #1.2: Type: text/html, Size: 12564 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Repeating binary operators with split multiline formulas
  2022-08-20 23:04 Repeating binary operators with split multiline formulas Adam Reviczky via ntg-context
@ 2022-08-21  8:01 ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen via ntg-context @ 2022-08-21  8:01 UTC (permalink / raw)
  To: Adam Reviczky via ntg-context; +Cc: Hans Hagen

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

On 8/21/2022 1:04 AM, Adam Reviczky via ntg-context wrote:

> Since there has been a lot of work done on the math side of things, I
> wanted to ask if there is an automated way to have binary operators
> repeated when splitting a formula.
> 
>  From the MKIV math manual there is an option to move the operators into the
> new line:
> 
> \setupmathematics[setups=math:spacing:split]
> \setupformulas[split=yes,align=flushleft]
> \startformula
> x\dorecurse{30}{ + #1x^{#1x}} = 10
> \stopformula
> 
> Would it be possible to achieve this via a custom setup like
> math:spacing:split to get an output like this?
> 
> 𝑥 + 1𝑥1𝑥 + 2𝑥2𝑥 + 3𝑥3𝑥 + 4𝑥4𝑥 + 5𝑥5𝑥 + 6𝑥6𝑥 + 7𝑥7𝑥 + 8𝑥8𝑥 +
> 9𝑥9𝑥 + 10𝑥10𝑥 +
> + 11𝑥11𝑥 + 12𝑥12𝑥 + 13𝑥13𝑥 + 14𝑥14𝑥 + 15𝑥15𝑥 + 16𝑥16𝑥 + 17𝑥17𝑥 +
> 18𝑥18𝑥 + 19𝑥19𝑥 +
> + 20𝑥20𝑥 + 21𝑥21𝑥 + 22𝑥22𝑥 + 23𝑥23𝑥 + 24𝑥24𝑥 + 25𝑥25𝑥 + 26𝑥26𝑥 +
> 27𝑥27𝑥 + 28𝑥28𝑥 +
> + 29𝑥29𝑥 + 30𝑥30𝑥 = 10
What you are basically asking for is "math discretionaries that don't 
interfere with spacing and penalties as assigned in math processing" .

I attached what we have done so far. Regular discretionaries are already 
supported but recently - not yet in the upload - and last week I added 
support for specific math discretionaries to the engine (no need to 
switch to math in a dicretionary so no style guesswork needed) and then 
also a more native handling of characters directly (using \\hmcode's) so 
no need for some command that injects the discretionary.

We have no high level interface yes so if you have suggestions on how 
this is to be used (what binaries for instance, is it language 
dependent) let us know.

Mikael and I still need to look into more granular inter-atom penalties 
(there is quite some control possible but it is simply not yet used).

There will probably be an upload one of these days (all build engines 
need to be up and running) btu we're first wrapping up some other (cool) 
mechanism.

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

[-- Attachment #2: ontarget-mathcharacters.pdf --]
[-- Type: application/pdf, Size: 37152 bytes --]

[-- Attachment #3: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-21  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-20 23:04 Repeating binary operators with split multiline formulas Adam Reviczky via ntg-context
2022-08-21  8:01 ` Hans Hagen via ntg-context

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).