ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mikael Sundqvist via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Mikael Sundqvist <mickep@gmail.com>
Subject: Re: Cron <context@zapf> /var/www/aanhet.net/context/bin/cron/context-mirror
Date: Sun, 24 Jul 2022 15:36:38 +0200	[thread overview]
Message-ID: <CAHy-LL-xZSvzutbzDco4j-oyMYT5t2KMo2t5HqSqywTOFSw1Rg@mail.gmail.com> (raw)
In-Reply-To: <20220724110109.2D9B928595A@zapf.ntg.nl>

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

On Sun, Jul 24, 2022 at 1:01 PM Cron Daemon via ntg-context
<ntg-context@ntg.nl> wrote:
>
> receiving incremental file list
>  ./
>  ctan.lsr
>  document-2.htm
>  download-1.htm
>  download-2.htm
>  logo-ade.png
>  logo-cts.png
>  logo-pod.png
>  rss.xml
>  show-fil.pdf
>  context/latest/
>  context/latest/cont-mpd.zip
>  context/latest/cont-ppc.zip
>  context/latest/cont-sci.zip
>  context/latest/cont-tmf.zip
>  context/latest/cont-tst.tar.xz
>  general/manuals/
>  general/manuals/luametatex.pdf
>
>  sent 98,702 bytes  received 21,728,319 bytes  3,968,549.27 bytes/sec
>  total size is 450,928,426  speedup is 20.66
>
>
> Running archiver:
>
> New dir: /var/www/aanhet.net/context//htdocs/archives/context-2022-07-24.13
> 133269181       /var/www/aanhet.net/context//htdocs/archives/context-2022-07-24.13/latest
> 126745317       /var/www/aanhet.net/context//htdocs/archives/context-2022-07-24.13/current
> 18956262        /var/www/aanhet.net/context//htdocs/archives/context-2022-07-24.13/alpha
> 126707516       /var/www/aanhet.net/context//htdocs/archives/context-2022-07-24.13/beta
> 405682372       /var/www/aanhet.net/context//htdocs/archives/context-2022-07-24.13
> 405682372       total
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

Dear list,

I just noticed that Hans made a new release (thanks Taco for these
cron'd emails!).

I attach to this email somemoreformulas.tex, with some additional
examples to the previous ones, with tests/examples on issues people
had with the previous release. If there still are problems, please
tell!

I finally shamelessly provide a link to the slides of the talk on math
in ConTeXt at tug that I just gave:
https://www.maths.lth.se/matematiklth/personal/mickep/mps-tug.pdf. I
guess there will be a video available in due time, (check
https://tug.org/tug2022/).

/Mikael

[-- Attachment #2: somemoreformulas.tex --]
[-- Type: application/octet-stream, Size: 7716 bytes --]


\setupinteraction[state=start]

\setuphead[subject][
    style={\bfa\WORD},
    align=middle,
]

% \showglyphs
% \showmakeup[mathglue]
% \showboxes

\setupbodyfont[bonum]

\definereferenceformat[eqref][left=(,right=)]
% \showframe


\definemathsimplealign[collectedrightnumbers][
    left={\startmathfenced[sesac]},
    right=\stopmathfenced,
    align={1:right,2:left},
    strut=yes,
]

\definemathsimplealign[collectedleftnumbers][
    left={\startmathfenced[cases]},
    right=\stopmathfenced,
    align={1:right,2:left},
    strut=yes,
]


\starttext


\startbuffer[samples]

Just a simple formula (as before):

\startplaceformula
\startformula
f(x) = \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n
\stopformula
\stopplaceformula

A chain formula that runs over several lines. One formula, numbered at the end.

\startplaceformula
\startformula
f(x) \alignhere = \exp(x) \breakhere
                = 1 + x + x^2/2 + \ldots \breakhere
                = \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \breakhere
                = f'(x)
\stopformula
\stopplaceformula

As above, but with \tex{skiphere} at one place:
\startplaceformula
\startformula
f(x) \alignhere = \exp(x) \breakhere
                = 1 + x + x^2/2 + x^3/6 + x^4/24 \breakhere
                \skiphere[1em] + x^5/120 + x^6/720 \ldots \breakhere
                = \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \breakhere
                = f'(x)
\stopformula
\stopplaceformula

With \typ{align=slanted} we get first line flush left, last one flush right and the rest midaligned:
\startplaceformula
\startformula[align=slanted]
f(x) = \exp(x) = 1 + x + x^2/2 + x^3/6 + x^4/24 + \ldots \breakhere
                = \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n = f'(x)
\stopformula
\stopplaceformula


Don't do this (unclear what the number points to):
\startplaceformula[eq:all]
\startformula
\startalign
  \NC f(x) \EQ \exp(x)                                          \NR
  \NC      \EQ 1 + x + x^2/2 + \ldots                           \NR
  \NC      \EQ \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \NR
  \NC      \EQ f'(x)                                            \NR
\stopalign
\stopformula
\stopplaceformula

Better to brace the formula and give one number:


\doifmodeelse{leftnumbers}{
\startplaceformula
\startformula
\startcollectedleftnumbers
  \NC f(x) = \NC \exp(x)                                          \NR
  \NC      = \NC 1 + x + x^2/2 + \ldots                           \NR
  \NC      = \NC \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \NR
  \NC      = \NC f'(x)                                            \NR
\stopcollectedleftnumbers
\stopformula
\stopplaceformula
}{
\startplaceformula
\startformula
\startcollectedrightnumbers
  \NC f(x) = \NC \exp(x)                                          \NR
  \NC      = \NC 1 + x + x^2/2 + \ldots                           \NR
  \NC      = \NC \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \NR
  \NC      = \NC f'(x)                                            \NR
\stopcollectedrightnumbers
\stopformula
\stopplaceformula
}

% When the formula number is to the left, we should put the brace to the left):



If one needs to number several lines:
\startplaceformula
\startformula
\startalign
  \NC f(x) \EQ \exp(x)                                          \NR[eq:X]
  \NC      \EQ 1 + x + x^2/2 + \ldots                           \NR[eq:Y]
  \NC      \EQ \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \NR
  \NC      \EQ f'(x)                                            \NR[eq:Z]
\stopalign
\stopformula
\stopplaceformula






\stopbuffer


\subject[title={Numbers to the right}]
\getbuffer[samples]

\subject[title={Numbers to the left}]
\bgroup
\enablemode[leftnumbers]
We reuse the same formulas.
\setupformula[location=left]
\getbuffer[samples]
\disablemode[leftnumbers]
\egroup


\subject[title={Subformulas}]
We can get subnumbering with letters:

\startplaceformula
\startformula
\startalign
  \NC f(x) \EQ \exp(x)                                          \NR[eq:a][a]
  \NC      \EQ 1 + x + x^2/2 + \ldots                           \NR[eq:b][b]
  \NC      \EQ \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \NR[eq:c][c]
  \NC      \EQ f'(x)                                            \NR
\stopalign
\stopformula
\stopplaceformula

If we want no dot between we can do

\startbuffer
\defineseparatorset[none][][]
\setupformulas[numberseparatorset=none]
\stopbuffer

\getbuffer
\typebuffer

\startplaceformula
\startformula
\startalign
  \NC f(x) \EQ \exp(x)                                          \NR[eq:A][a]
  \NC      \EQ 1 + x + x^2/2 + \ldots                           \NR[eq:B][b]
  \NC      \EQ \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \NR[eq:C][c]
  \NC      \EQ f'(x)                                            \NR
\stopalign
\stopformula
\stopplaceformula

See \eqref[eq:B].

\subject[title={Breaking fences}]
Fences can break over lines:

\startbuffer[brokenfences]
\startplaceformula
\startformula[textdistance=2em]
  \alignhere 
    P'(iy_1, \ldots, iy_n, i\eta_k) 
  \breakhere
  = (ir)^{k-1} \left[ 
    P_k' \left( z_ 1, \ldots, z_n, \frac{\eta_k}{r} \right) 
    \breakhere
    \skiphere[3] 
    + \frac{1}{ir}P_{k-1}'
      \left( z_ 1, \ldots, z_n, \frac{\eta_k}{r} \right)
    + \ldots
    \right] 
  \breakhere
  = (ir)^{k-1} 
      P_k'\left( z_ 1, \ldots, z_n, \frac{\eta_k}{r} \right) 
    + O(r^{k-2})
\stopformula
\stopplaceformula
\stopbuffer

\getbuffer[brokenfences]
Note that the alignment point is to the left of \im{P}. Then all lines are moved in the amount of \typ{textdistance}, which is set to 2em.
Here the \typ{\skiphere[3]} skips four units of \typ{textmargin}, which by default is set to 2em. In this case we could have used \typ{\skiphere[6em]}


\subject[title={Comments}]

We can add comments in the margin:

\startformula
\startalign[text:1={Foo},text:2={Bar}]
\NC x \EQ r \cos\theta \NR
\NC y \EQ r \sin\theta \NR
\stopalign
\stopformula

Likewise,

\startformula
\texthere[left]{Foo} 
f(x) \alignhere = \exp(x) \breakhere[left]{Bar}
                = 1 + x + x^2/2 + \ldots \breakhere
                = \lim_{n\to+\infty}\left(1 + \frac{x}{n}\right)^n \breakhere[right]{Oh no!}
                = f'(x)
\stopformula

\subject[title={Aligns with several columns}]

\startbuffer[aligns]
\startformula
\startalign[m=3, n=2,distance=2em]
\NC 1 \EQ 2 \NC 3 \EQ 1 \NC 2 \EQ 3 \NR
\NC 4 \EQ 5 \NC 6 \EQ 4 \NC 5 \EQ 6 \NR
\stopalign
\stopformula

\startformula
\mframed[offset=overlay,frame=off,leftframe=on,bottomframe=on]{
\startalign[m=3, n=2,distance=2em]
\NC 1 \EQ 2 \NC 3 \EQ 1 \NC 2 \EQ 3 \NR
\NC 4 \EQ 5 \NC 6 \EQ 4 \NC 5 \EQ 6 \NR
\stopalign
}
\stopformula

\startformula
\startalign[m=3, n=2,distance=0em plus 1 fil]
\NC 1 \EQ 2 \NC 3 \EQ 1 \NC 2 \EQ 3 \NR
\NC 4 \EQ 5 \NC 6 \EQ 4 \NC 5 \EQ 6 \NR
\stopalign
\stopformula


\startformula
\mframed[offset=overlay,frame=off,leftframe=on,bottomframe=on]{
\startalign[m=3, n=2,distance=0em plus 1 fil]
\NC 1 \EQ 2 \NC 3 \EQ 1 \NC 2 \EQ 3 \NR
\NC 4 \EQ 5 \NC 6 \EQ 4 \NC 5 \EQ 6 \NR
\stopalign
}
\stopformula
\stopbuffer

\getbuffer[aligns]

\subject[title={Vertical distance in formulas}]
\startbuffer[spacesetup]
\setupformula[
    spaceinbetween=line,
]
\stopbuffer
We can do
\typebuffer[spacesetup]
\getbuffer[spacesetup]

Then the formula above with broken fences look like this:

\getbuffer[brokenfences]

This also affects the align and simplealign:
\getbuffer[aligns]


\startbuffer[alignspacesetup]
\setupmathalignment[
    spaceinbetween=2cm,
]
\stopbuffer
We can set the vertical space in aligns independently:
\typebuffer[alignspacesetup]
\getbuffer[alignspacesetup]

Then the aligns above look like this:

\getbuffer[aligns]
\stoptext

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

  reply	other threads:[~2022-07-24 13:36 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24 11:01 Cron Daemon via ntg-context
2022-07-24 13:36 ` Mikael Sundqvist via ntg-context [this message]
2022-07-27  5:03   ` Aditya Mahajan via ntg-context
2022-07-27  7:32     ` Hans Hagen via ntg-context
2022-07-29  7:36       ` Jeong Dal via ntg-context
2022-07-27 16:04     ` Hans Hagen via ntg-context
  -- strict thread matches above, loose matches on Subject: below --
2023-04-11 21:01 Cron Daemon via ntg-context
2023-04-11 18:01 Cron Daemon via ntg-context
2023-04-11 17:01 Cron Daemon via ntg-context
2023-04-11 16:01 Cron Daemon via ntg-context
2023-04-11 15:01 Cron Daemon via ntg-context
2023-04-01  9:01 Cron Daemon via ntg-context
2023-03-20 17:01 Cron Daemon via ntg-context
2023-03-20 16:01 Cron Daemon via ntg-context
2023-03-10 23:01 Cron Daemon via ntg-context
2023-03-10 12:01 Cron Daemon via ntg-context
2023-03-09 12:01 Cron Daemon via ntg-context
2023-03-06 23:01 Cron Daemon via ntg-context
2023-03-06 15:01 Cron Daemon via ntg-context
2023-02-23 21:01 Cron Daemon via ntg-context
2023-02-14 17:01 Cron Daemon via ntg-context
2023-02-07 19:01 Cron Daemon via ntg-context
2023-02-07 21:19 ` Giulio Bertellini via ntg-context
2023-02-06 18:01 Cron Daemon via ntg-context
2023-01-26 18:01 Cron Daemon via ntg-context
2023-01-24 14:01 Cron Daemon via ntg-context
2023-01-23 23:01 Cron Daemon via ntg-context
2023-01-15 14:01 Cron Daemon via ntg-context
2023-01-13 12:01 Cron Daemon via ntg-context
2023-01-05 19:01 Cron Daemon via ntg-context
2023-01-04 11:01 Cron Daemon via ntg-context
2022-12-29 14:01 Cron Daemon via ntg-context
2022-12-27 23:01 Cron Daemon via ntg-context
2022-12-27 21:01 Cron Daemon via ntg-context
2022-12-27 17:01 Cron Daemon via ntg-context
2022-12-22 22:01 Cron Daemon via ntg-context
2022-12-21 17:01 Cron Daemon via ntg-context
2022-12-15 18:01 Cron Daemon via ntg-context
2022-12-15  1:03 Cron Daemon via ntg-context
2022-12-09 17:01 Cron Daemon via ntg-context
2022-12-07 21:01 Cron Daemon via ntg-context
2022-12-05 22:01 Cron Daemon via ntg-context
2022-12-01 13:01 Cron Daemon via ntg-context
2022-11-29  0:01 Cron Daemon via ntg-context
2022-11-28 23:01 Cron Daemon via ntg-context
2022-11-18 13:01 Cron Daemon via ntg-context
2022-11-14 23:01 Cron Daemon via ntg-context
2022-10-22 10:01 Cron Daemon via ntg-context
2022-10-21 20:01 Cron Daemon via ntg-context
2022-10-15 10:01 Cron Daemon via ntg-context
2022-10-14  9:01 Cron Daemon via ntg-context
2022-09-16 14:01 Cron Daemon via ntg-context
2022-09-16 13:01 Cron Daemon via ntg-context
2022-09-11 19:01 Cron Daemon via ntg-context
2022-09-10  1:01 Cron Daemon via ntg-context
2022-09-10  7:49 ` Henning Hraban Ramm via ntg-context
2022-09-10  9:12   ` Hans Hagen via ntg-context
2022-09-10  9:32     ` Henning Hraban Ramm via ntg-context
2022-09-09 20:03 Cron Daemon via ntg-context
2022-09-09  0:03 Cron Daemon via ntg-context
2022-09-07 14:03 Cron Daemon via ntg-context
2022-09-07 13:03 Cron Daemon via ntg-context
2022-09-07 12:03 Cron Daemon via ntg-context
2022-09-07 14:27 ` Jeong Dal via ntg-context
2022-09-07 14:32   ` Ursula Hermann via ntg-context
2022-09-07 14:51     ` Henning Hraban Ramm via ntg-context
2022-09-07 15:13       ` Taco Hoekwater via ntg-context
2022-09-07 16:02         ` Hans Hagen via ntg-context
2022-09-07 11:03 Cron Daemon via ntg-context
2022-09-07 10:03 Cron Daemon via ntg-context
2022-09-06  9:01 Cron Daemon via ntg-context
2022-09-06  8:03 Cron Daemon via ntg-context
2022-08-25 18:01 Cron Daemon via ntg-context
2022-08-25 16:01 Cron Daemon via ntg-context
2022-08-16  3:03 Cron Daemon via ntg-context
2022-08-05 16:01 Cron Daemon via ntg-context
2022-08-05 10:01 Cron Daemon via ntg-context
2022-08-01 19:01 Cron Daemon via ntg-context
2022-07-27 16:01 Cron Daemon via ntg-context
2022-07-06 21:01 Cron Daemon via ntg-context
2022-06-25 17:03 Cron Daemon via ntg-context
2022-06-04 12:01 Cron Daemon via ntg-context
2022-06-04 10:01 Cron Daemon via ntg-context
2022-05-22 18:01 Cron Daemon via ntg-context
2022-05-11 10:01 Cron Daemon via ntg-context
2022-05-11  8:01 Cron Daemon via ntg-context
2022-05-10 17:01 Cron Daemon via ntg-context
2022-05-09 16:01 Cron Daemon via ntg-context
2022-05-02 15:01 Cron Daemon via ntg-context
2022-05-03  7:13 ` Taco Hoekwater via ntg-context
2022-05-03  8:35   ` Rudolf Bahr via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHy-LL-xZSvzutbzDco4j-oyMYT5t2KMo2t5HqSqywTOFSw1Rg@mail.gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=mickep@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).