ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: WN <wneimeijer@tiscali.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: extra math symbols and alignment
Date: Thu, 02 Aug 2007 12:28:45 -0400	[thread overview]
Message-ID: <20070802122845.132djva7ks08gg0k@web.mail.umich.edu> (raw)
In-Reply-To: <46B071E7.9060002@tiscali.nl>

Hi Wim,

Quoting WN <wneimeijer@tiscali.nl>:

> I tried your code and performed more tests. My first tests show your fix
> works. But than I added a \section{} in my test code and I am sorry 
> to say that
> the math matrix alignment does not work at that point.

:-) Section modifies \!!counta so things get messed up again. Actually, 
this really helped to narrow down the bug. Basically, dostartmatrix 
does a test

\scratchcounter=\ifnum\eqaligncolumn>\scratchcounter \eqaligncolumn 
\else \plusone \fi

which is comparing eqaligncolmn with scratch counter, but 
scratchcounter is never initialized. Therefore, everything depends on 
what was the value of scratchcounter, which explains, different 
behaviour depending on when the matrix  occurred, and why you had a 
hard time pinning down a minimal example.

The fix is easy, change the scratchcounter to zerocount (or maybe just 
change to \ifcase\eqaligncolunm). So add this to your file,

\unprotect
\def\dostartmathmatrix[#1][#2]%
  {\begingroup
   \edef\currentmathmatrix{#1}%
   \doifassignmentelse{#2}{\setupmathmatrix[#1][#2]}\donothing
   \null
   
\executeifdefined{\??mx:\mathmatrixparameter\c!location}{\getvalue{\??mx:\v!lohi}}%
   \mathmatrixleft
   \mathmatrixbox\bgroup
   \pushmacro\domatrixNC
   \let\endmath\relax
   \def\NC{\domatrixNC}%
   \def\MC{\domatrixNC\ifmmode\else$\def\endmath{$}\fi}%
   \global\let\domatrixNC\dodomatrixNC
   \def\NR{\endmath\global\let\domatrixNC\dodomatrixNC\crcr}%
   \normalbaselines
   \mathsurround\zeropoint
   \everycr\emptytoks
   \tabskip\zeropoint
   \eqaligncolumn\zerocount 
\processcommacommand[\mathmatrixparameter\c!align]{\advance\eqaligncolumn\plusone\dosetmatrixcolumn}%
   \scratchcounter=\ifnum\eqaligncolumn>\zerocount \eqaligncolumn \else 
\plusone \fi
   \global\eqaligncolumn\plusone
   \preparemathmatrix } % uses scratchcounter
\protect


Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2007-08-02 16:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 13:28 WN
2007-08-01  3:27 ` Aditya Mahajan
2007-08-01 11:43   ` WN
2007-08-01 16:33     ` Aditya Mahajan
2007-08-02 16:28     ` Aditya Mahajan [this message]
2007-08-02 21:25       ` WN
2007-08-02 21:33         ` Aditya Mahajan
2007-08-02 21:48           ` extra math symbols and alignment (WORKS) WN
  -- strict thread matches above, loose matches on Subject: below --
2007-07-28 20:00 extra math symbols and alignment w.neimeijer

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=20070802122845.132djva7ks08gg0k@web.mail.umich.edu \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    --cc=wneimeijer@tiscali.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).