ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: equation to right margin
Date: Thu, 10 Oct 2024 16:44:54 -0400 (EDT)	[thread overview]
Message-ID: <67o047o5-184o-27qn-q9s4-1792q3rs1nq0@hzvpu.rqh> (raw)
In-Reply-To: <5A1DEF8D-911B-43D7-B5F2-6869EC0048BA@gmail.com>

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

On Thu, 10 Oct 2024, Otared Kavian wrote:

> Hi Mikael,
> 
> My personal experience with numbered equations gathered with a big left curly brace (assuming that the numbers are put to the right of formulas) is that it is very useful (or indispensable…) to be able to number each equation and be able to refer to them. For instance, when one writes a partial differential equation, usually there are boundary conditions, initial conditions and such, which may take 3, 4 or 5 lines of equations (some authors may even have more than that, but I personally avoid it…). It is useful to be able to refer to each of these equations, either by numebring them as subformulas, or numebering them sequentially. It is true that in this case, that is when each line has a number, usually one does not number the whole system of equations gathered by the big left brace. The optimal solution would be to have the option to number each line, or to number them as subformulas.
> 
> For instance in the following minimal example (based on one of your answers some time ago), the reference to « eq:Robin » does not work and the numbers of each line of the PDE problem are not correctly aligned to the right.

Reference to eq:Robin doesn't work because of the following reason: You define

> \define[1]\eqref{(\in[eq:#1])}

and then use \eqref[eq:Robin] which is then translated to (\in[eq:eq:Robin]). It may be better to use:

\definereferenceformat
  [eqref]
  [left=(, right=), style=normal]


Regarding \startcases number not being to the right edge of the textarea: there is no good solution here. Keep in mind that \startcases is an "inner level" construct, so it is not aware of the width of the outer environment. It is possible to circumvent it on a code-logic level, but we first need to decide how should the following behave:

\startformula
  x(t) = \startcases
    \NC 0, \NC t < 0 \NR
    \NC 1, \NC t \ge 0 \NR[+]
  \stopcases
  \quad\text{and}\quad
  y(t) = \startcases
    \NC 0, \NC t < 0 \NR[+]
    \NC 1, \NC t \ge 0 \NR
  \stopcases
\stopformula

The point is, that \stopcases can be followed by additional text, so placing the number at the right edge may interfere with other things. 

In the example that you sent, the solution presented by Mikael (\startalign[fences=cases]) will work. 

Aditya

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

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2024-10-10 20:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 21:45 [NTG-context] " Alan Bowen
2024-10-09 14:19 ` [NTG-context] " Mikael Sundqvist
2024-10-09 15:15   ` Alan Bowen
2024-10-09 16:11     ` Mikael Sundqvist
2024-10-09 16:20       ` Alan Bowen
2024-10-10  0:17         ` Alan Braslau via ntg-context
2024-10-10  5:32           ` Mikael Sundqvist
2024-10-10 18:14             ` Otared Kavian
2024-10-10 20:44               ` Aditya Mahajan [this message]
2024-10-12 14:11             ` Alan Bowen

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=67o047o5-184o-27qn-q9s4-1792q3rs1nq0@hzvpu.rqh \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /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).