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 17:33:32 -0400	[thread overview]
Message-ID: <20070802173332.aak2q1tvokoww8w8@web.mail.umich.edu> (raw)
In-Reply-To: <46B24BB1.1020404@tiscali.nl>

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

Hi Wim,

Quoting WN <wneimeijer@tiscali.nl>:

> I tried the new code you send me, and of course I did a quick test.
> But when doing a texmfstart texexec --autopdf --pdf testalignfontnew.tex
> texexec hangs ''forever''  while trying to process the \section{} command.
> Actually its pdftex trying to do something.
>
> To make sure I did not make a edit mistake, I copied my old test code into
> the file testalignfontnew.tex and run a diff to see where the 
> difference with the new code
> are.
>
> Looking at the code (and I am not a Tex expert, and forgive me, when 
> I ask a dumb question)
> I don't see where the \scratchcounter itself is defined ? Must surely 
> be a global Context counter ?

Yes. \scratchcounter is defined in syst-gen (IIRC). So are a bunch of 
other temporary variables.

> Attached the new test code.
> Hope it helps the debugging process and thanks for all your help sofar.

I can not really check the font stuff, since I do not have txfonts and 
rsfs on this machine. But the matrix alignment appears to be working 
fine. I am attaching the test for just the matrix alignment. When I get 
home, I will try to see what goes wrong when you add other fonts.

Aditya

[-- Attachment #2: test2.tex --]
[-- Type: text/plain, Size: 2459 bytes --]

\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

\definetypeface[mainface] [rm]   [serif]  [times]     [default]  [encoding=texnansi]
\definetypeface[mainface] [mm] [math] [modern] [modern] [encoding=texnansi]
\setupbodyfont[mainface,11pt]

\definemathmatrix[mycases][left={\left\{\,},right={\,\right.}]
\definemathmatrix[aligned][n=3,align={right,left,left},distance=4pt]
\definemathmatrix[alignedfour][n=4,align={left,middle,left,right}]

\startbuffer
\startformula
\startalignedfour[left={\left\{},right={\right\}}]
\NC left \NC middle \NC  left \NC right \NR
\NC aaa \NC = \NC 0 \NC |x| > 0 \NR
\NC aaaa \NC = \NC 1 \NC |x| < 0 \NR
\NC bbb \NC = \NC 2 \NC bb \NR
\NC bb \NC = \NC 3 \NC ccc \NR
\stopalignedfour
\stopformula

\startformula
\startmycases[n=4,align={left,middle,middle,right},distance=1em]
\NC left \NC middle \NC middle \NC right \NR
\NC aaaaaa \NC baaaaaaaaa \NC cccc \NC ddddddddddddd  \NR
\NC aaaaaaaaa \NC bbb \NC c \NC ddd \NR
\stopmycases
\stopformula

\startformula
\startaligned[left={\left.},right={\right\}}]
\NC (\lambda + \mu ) \cdot a \NC = \NC \lambda \cdot a + \mu \cdot a \NR
\NC \lambda ( a + b ) \NC = \NC \lambda \cdot a + \lambda \cdot b \NR
\stopaligned
\quad
\text{(distributieve eigenschappen)}
\stopformula
\stopbuffer

\starttext
Test user defined math matrices without a section (with Aditya's fix)
\blank
Math matrix alignment works.
\getbuffer
\section{Test user defined math matrices but after a section (with Aditya's fix)}
Math matrix alignment broken
\getbuffer

\page
\section{Default math characters}
\showmathcharacters

\stoptext


[-- Attachment #3: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2007-08-02 21:33 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
2007-08-02 21:25       ` WN
2007-08-02 21:33         ` Aditya Mahajan [this message]
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=20070802173332.aak2q1tvokoww8w8@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).