ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Reg. fonts and math
Date: Fri, 13 Jan 2006 18:59:21 +0100	[thread overview]
Message-ID: <43C7EA79.5020606@wxs.nl> (raw)
In-Reply-To: <Pine.GSO.4.63.0601121559590.17710@rrpf4327h07.ratva.hzvpu.rqh>

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

Aditya Mahajan wrote:

> No, I mean the complicated math is much harder in context. Consider
>
> \begin{align}
>  a &= b \\
>  c &= d \notag \\
>    &= f \notag \\
>    &= g
> \end{align}
>
> which will typeset as
>
>  a = b        (1)
>  c = d
>    = f
>    = g        (2)
>
> \begin{subequations}
> \begin{align}
>  a &= b \\
>  c &= d
> \end{align}
> \end{subequations}
>
> Compare this from how to do this in context (see the wiki). You have 
> to *manually* set the number of the subequation. Actually, for 
> equation numbering and refering, the context way is rather limited. 
> Consider something like an align environment
>
> a &= b\\
> c &= d\\
> e &= f
>
> Suppose, I want to refer to the second equation.  In latex, I can 
> simply add \label{eq:2} and the end of c&= d and then \ref{eq:2}. For 
> context, the reference label goes at the top, with \placeformula[eqs]. 
> But I am not sure, how to give individual labels to each equations.

this 'loose label' is one of the ugliest concept i can think of -)

i'm willing to implement anything reasonable but since i  hardly use 
such math i only act on 'i want to achieve this' kind of specs (i have 
no time to read tons of tex documents)

much if this 'complicated' math is not that complicated to support,see 
attached file

btw, defaulting to numbers and then using \notag is messy; i prefer 
readable code, even if it takes more  bytes;  inventing a formula takes 
more time than keying it in.  Also, more structure,  means more hooks 
for configurability

Hans






[-- Attachment #2: math-ltx.tex --]
[-- Type: text/x-tex, Size: 2059 bytes --]

% some simple math constructs

\unprotect

\def\numberedeqalign
  {\doifelse\@@fmlocation\v!left\leqalignno\eqalignno}

\def\doalignNR[#1][#2]%
  {\doifsomething{#1}
     {\doifelse{#1}{+}
        {\doformulanumber[][#2][]{}}
        {\doformulanumber[#1][#2][]{}}}}

\long\def\startalign#1\stopalign
  {\def\NC{\crcr\def\NC####1{&####1}}%
   \def\EQ{&=}
   \def\NR{&\dodoubleempty\doalignNR}%
   % amstex compatibility mode:
   \def\notag{\def\\{&\crcr}}%
   \def\\{&\doalignNR[+][]\crcr}%
   % end of compatibility mode
   \numberedeqalign{#1\relax}}

%D \startbuffer
%D \placeformula \startformula \eqalignno {
%D  a &= b & \formulanumber \cr
%D  c &= d \cr
%D    &= e \cr
%D    &= f & \formulanumber
%D } \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D \NC  a \EQ b \NR[+]
%D \NC  c \EQ d \NR
%D \NC    \EQ f \NR[for:hans]
%D \NC    \EQ g \NR[for:whoelse][a]
%D \NC    \EQ h \NR[for:whomore][b]
%D \NC    \EQ i \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D \NC a \EQ b \NR[+]
%D \NC c \EQ d \NR
%D \NC   \EQ f \NR
%D \NC   \EQ g \NR
%D \NC   \EQ h \NR
%D \NC   \EQ i \NR[+]
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D a &= b \\
%D c &= d \notag \\
%D   &= e \notag \\
%D   &= f \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D a &= b \NR[+]
%D c &= d \NR
%D   &= e \NR
%D   &= f \NR[+]
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D \NC  a \NC \eq  b \NR[+]
%D \NC  c \NC \neq d \NR
%D \NC    \NC \neq f \NR[for:hans]
%D \NC    \NC \geq g \NR[for:whoelse][a]
%D \NC    \NC \leq h \NR[for:whomore][b]
%D \NC    \NC \neq i \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer

\protect \endinput

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

  reply	other threads:[~2006-01-13 17:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-12  0:55 Kumar Appaiah
2006-01-12  8:20 ` Hans Hagen
2006-01-12 16:06   ` Aditya Mahajan
2006-01-12 17:47     ` Hans Hagen
2006-01-12 21:29       ` Aditya Mahajan
2006-01-13 17:59         ` Hans Hagen [this message]
2006-01-14  1:48           ` Aditya Mahajan
2006-01-14  8:36             ` Aditya Mahajan
2006-01-14 16:58             ` Adam Duck
2006-01-14 17:04               ` Aditya Mahajan
2006-01-14  9:47           ` Tobias Burnus
2006-01-15 17:27             ` Hans Hagen

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=43C7EA79.5020606@wxs.nl \
    --to=pragma@wxs.nl \
    --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).