ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: math align
Date: Mon, 16 Jan 2006 21:41:24 +0100	[thread overview]
Message-ID: <43CC04F4.3090203@wxs.nl> (raw)
In-Reply-To: <C6AEF966-9F62-4147-B54E-5D48B0661E73@cox.net>

David Arnold wrote:

> Hans, Willi, et al,
>
> I was thinking there are pros and cons to each solution, Hans' and  
> Willi's. So I tried:
>
> Here are some simple examples of adding fractions already having  
> common denominators.
>
> %output=pdf
>
> \input math-ext
>
> \starttext
>
> \placeformula[-]
> \startformula
>   \startalign[m=2,distance=5em]
>     \frac5{21}-\frac3{21}&=\frac{5-3}{21} &
>     \frac{2}{x+2}-\frac{x-3}{x+2}&=\frac{2-(x-3)}{x+2}\\
>     &=\frac2{21} & &=\frac{2-x+3}{x+2}\\
>     &&&=\frac{5-x}{x+2}
>   \stopalign
> \stopformula
>
> \startbuffer[1]
> \framed[frame=on,width=fit]
>    {\startformula
>      \eqalign{
>        \frac{5}{21}-\frac{3}{21}
>        &=\frac{5-3}{21}\cr
>        &=\frac{2}{21}}
>    \stopformula}
> \stopbuffer
>
> \startbuffer[2]
>   \framed[frame=on,width=fit]
>   {\startformula
>     \eqalign{
>       \frac2{x+2}-\frac{x-3}{x+2}
>       &=\frac{2-(x-3)}{x+2}\cr
>       &=\frac{2-x+3}{x+2}\cr
>       &=\frac{5-x}{x+2}}
>   \stopformula}
> \stopbuffer
>
> \startbuffer
>   \startcombination[2*1]
>     {\externalfigure[1][width=0.45\textwidth,type=buffer]}{}
>     {\externalfigure[2][width=0.45\textwidth,type=buffer]}{}
>   \stopcombination
> \stopbuffer
>
> \placefigure
> [][-]
> {none}
> {\getbuffer}
>
> \stoptext
>
> As you can see, Hans' solution works perfectly, but note the very  
> ugly source code for that section. Willi's source is cleaner, much  
> easier to read (especially at a later date when I will have to  
> revisit for revisions), but it doesn't work (the output is scaled of  
> course).
>
> Any suggestions as to how I can fix Willi's approach so it doesn't  
> scale?


wikiable:

\definecombination[twoformulas][location=top,align=middle]

\startalignment[middle] \dontleavehmode \startcombination[twoformulas][2*1]
    {\getbuffer[1]} {}
    {\getbuffer[2]} {}
\stopcombination \stopalignment

\def\StartTwo{\startalignment[middle] \dontleavehmode 
\startcombination[twoformulas][2*1]}
\def\StopTwo {\stopcombination \stopalignment}]

\StartTwo
  {\getbuffer[1]} {}
  {\getbuffer[2]} {}
\StopTwo

\StartTwo
  {\getbuffer[1]} {correct}
  {\getbuffer[2]} {wrong}
\StopTwo

  reply	other threads:[~2006-01-16 20:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-15 22:37 Hans Hagen
2006-01-16  3:31 ` Aditya Mahajan
2006-01-16  6:17 ` David Arnold
2006-01-16  7:30 ` David Arnold
2006-01-16  9:02   ` Taco Hoekwater
2006-01-16 12:30     ` Hans Hagen
2006-01-16 15:40       ` Mojca Miklavec
2006-01-16 16:38         ` Hans Hagen
2006-01-16 19:47           ` Aditya Mahajan
2006-01-16 21:43             ` Hans Hagen
2006-01-16 23:03               ` Aditya Mahajan
2006-01-17  3:02       ` Aditya Mahajan
2006-01-16 18:01     ` David Arnold
2006-01-16 18:16       ` Hans Hagen
2006-01-16 18:22         ` David Arnold
2006-01-16 19:45           ` Hans Hagen
2006-01-16 18:42         ` David Arnold
2006-01-16 20:41           ` Hans Hagen [this message]
2006-01-16 23:19             ` David Arnold
2006-01-16 18:20       ` Taco Hoekwater
2006-01-16 19:09         ` David Arnold
2006-01-16 20:18           ` 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=43CC04F4.3090203@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).