* Sum and mathalignment
@ 2021-11-30 19:34 Alexandre Christe via ntg-context
2021-11-30 22:51 ` Bruce Horrocks via ntg-context
0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Christe via ntg-context @ 2021-11-30 19:34 UTC (permalink / raw)
To: ntg-context; +Cc: Alexandre Christe
[-- Attachment #1.1.1: Type: text/plain, Size: 723 bytes --]
Dear list,
[image: image.png]
What I've done is to play with mathalignment and \framed. Here is a MWE:
\starttext
\defineoverlay[midrule][{\blackrule[height=.02cm,width=5.5cm]}]
\framed[frame=off,background=midrule,boffset=.65cm]{\startformula
\startmathalignment[n=12,align={middle,middle,middle,middle,middle,middle,middle,middle,middle,middle,middle,middle}]
\NC \NC S_6 \NC= \NC 1 \NC+ \NC 2 \NC+ \NC\dots \NC+ \NC 5 \NC+ \NC 6
\NR
\NC + \NC S_6 \NC= \NC 6 \NC+ \NC 5 \NC+ \NC\dots \NC+ \NC 2\NC+ \NC 1
\NR
\NC\NC 2S_6 \NC= \NC 7 \NC+ \NC 7 \NC+ \NC\dots \NC+ \NC 7 \NC+ \NC 7
\NR
\stopmathalignment
\stopformula}
\stoptext
Is there a simpler way to typeset something like this?
Thanks in advance!
[-- Attachment #1.1.2: Type: text/html, Size: 977 bytes --]
[-- Attachment #1.2: image.png --]
[-- Type: image/png, Size: 5145 bytes --]
[-- Attachment #2: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Sum and mathalignment
2021-11-30 19:34 Sum and mathalignment Alexandre Christe via ntg-context
@ 2021-11-30 22:51 ` Bruce Horrocks via ntg-context
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Horrocks via ntg-context @ 2021-11-30 22:51 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Bruce Horrocks
> On 30 Nov 2021, at 19:34, Alexandre Christe via ntg-context <ntg-context@ntg.nl> wrote:
>
> Dear list,
>
> <image.png>
>
> What I've done is to play with mathalignment and \framed. Here is a MWE:
>
> \starttext
> \defineoverlay[midrule][{\blackrule[height=.02cm,width=5.5cm]}]
>
> \framed[frame=off,background=midrule,boffset=.65cm]{\startformula
> \startmathalignment[n=12,align={middle,middle,middle,middle,middle,middle,middle,middle,middle,middle,middle,middle}]
> \NC \NC S_6 \NC= \NC 1 \NC+ \NC 2 \NC+ \NC\dots \NC+ \NC 5 \NC+ \NC 6 \NR
> \NC + \NC S_6 \NC= \NC 6 \NC+ \NC 5 \NC+ \NC\dots \NC+ \NC 2\NC+ \NC 1 \NR
> \NC\NC 2S_6 \NC= \NC 7 \NC+ \NC 7 \NC+ \NC\dots \NC+ \NC 7 \NC+ \NC 7 \NR
> \stopmathalignment
> \stopformula}
> \stoptext
>
> Is there a simpler way to typeset something like this?
How about:
\usecolors[svg]
\starttext
\ssa\bold
\starttabulate[|r|CT{red}c|c|CT{yellow}c|c|CT{green}c|c|CT{cyan}c|c|CT{blue}c|c|CT{darkmagenta}c|]
\NC S = \NC 1 \NC + \NC 2 \NC + \NC 3 \NC + \NC 4 \NC + \NC 5 \NC + \NC 6 \NC\NR
\NC + S = \NC 6 \NC + \NC 5 \NC + \NC 4 \NC + \NC 3 \NC + \NC 2 \NC + \NC 1 \NC\NR
\HL[cornflowerblue]
\NC 2S = \NC 7 \NC + \NC 7 \NC + \NC 7 \NC + \NC 7 \NC + \NC 7 \NC + \NC 7 \NC\NR
\stoptabulate
\stoptext
—
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-30 22:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 19:34 Sum and mathalignment Alexandre Christe via ntg-context
2021-11-30 22:51 ` Bruce Horrocks 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).