ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan via ntg-context <ntg-context@ntg.nl>
To: Bruce Horrocks via ntg-context <ntg-context@ntg.nl>
Cc: Aditya Mahajan <adityam@umich.edu>
Subject: Re: Aaligned numbers in a matrix?
Date: Sun, 26 Feb 2023 23:40:05 -0500 (EST)	[thread overview]
Message-ID: <7427957r-r56p-n175-1p98-7srn52n87q59@hzvpu.rqh> (raw)
In-Reply-To: <727E4D90-5418-480A-B5D0-8C1E7F3AAD22@scorecrow.com>

On Mon, 27 Feb 2023, Bruce Horrocks via ntg-context wrote:

> I'm using the following MWE to produce a matrix:
> 
> \definemathmatrix[bmatrix]
>   [matrix:brackets]
>   [simplecommand=bmatrix]
> \starttext
> $ a \rightarrow
>   \bmatrix{1, 2, 3, 4; 
>            2, 1, 4, 3;
>            3,-4, 1,-2;
>            4,-3, 2,-1} $
> \stoptext
> 
> The columns with negative numbers in are centred and I would rather have them right-aligned so that the digits stack up above each other and the negative signs stick out to the left, so to speak. Is there an easy way to achieve this?

You can right align all columns, though I am not sure that this looks better, because column 2 and 3 now appear to be "too close".

\definemathmatrix[bmatrix]
  [matrix:brackets]
  [align=all:right,simplecommand=bmatrix]
\starttext
$ a \rightarrow
  \bmatrix{1, 2, 3, 4;
           2, 1, 4, 3;
           3,-4, 1,-2;
           4,-3, 2,-1} $
\stoptext

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

      parent reply	other threads:[~2023-02-27  4:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27  0:55 Bruce Horrocks via ntg-context
2023-02-27  1:09 ` fv leung via ntg-context
2023-02-27  4:40 ` Aditya Mahajan via ntg-context [this message]

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=7427957r-r56p-n175-1p98-7srn52n87q59@hzvpu.rqh \
    --to=ntg-context@ntg.nl \
    --cc=adityam@umich.edu \
    /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).