ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LaTeX maths with array...
@ 2008-04-19 18:24 Pau
  2008-04-19 20:41 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Pau @ 2008-04-19 18:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I am preparing an e-journal for astro and I have many articles with
lots of equations. Unfortunately, authors are using LaTeX maths and
this is giving me trouble.

I have read and followed the steps of

http://wiki.contextgarden.net/LaTeX_Math_in_ConTeXt

and

http://wiki.contextgarden.net/Math_with_newmat

and it has helped me a lot but there's a snag I run all the time in: array

Typically, the equation giving troubles is of the kind:

\begin{equation}
\begin{array}{rl}
h & \sim \mu M^{2/3}f^{2/3}/r\\
  & \sim M_{ch}^{5/3}f^{2/3}/r\\
\end{array}
\end{equation}

when I try to compile, I get

! Misplaced alignment tab character &.
l.484 h&
        \sim \mu M^{2/3}f^{2/3}/r\\

Of course, when I use

\startformula\eqalign{
h & \sim \mu M^{2/3}f^{2/3}/r   \cr
  & \sim M_{ch}^{5/3}f^{2/3}/r  \cr
}\stopformula


everything runs smoothly but I cannot convert all equations containing
a {array}{rl} or similar, because I would never end... I guess that
writing a script to convert them in eqlign would be feasible, but it's
a very... precarious way... I would prefer to fix the problem from
ConTeXt itself...

how??

thanks,

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: LaTeX maths with array...
  2008-04-19 18:24 LaTeX maths with array Pau
@ 2008-04-19 20:41 ` Aditya Mahajan
  2008-04-19 22:26   ` Pau
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2008-04-19 20:41 UTC (permalink / raw)
  To: vim.unix, mailing list for ConTeXt users

On Sat, 19 Apr 2008, Pau wrote:

> Hi,
>
> I am preparing an e-journal for astro and I have many articles with
> lots of equations. Unfortunately, authors are using LaTeX maths and
> this is giving me trouble.
>
> I have read and followed the steps of
>
> http://wiki.contextgarden.net/LaTeX_Math_in_ConTeXt
>
> and
>
> http://wiki.contextgarden.net/Math_with_newmat
>
> and it has helped me a lot but there's a snag I run all the time in: array
>
> Typically, the equation giving troubles is of the kind:
>
> \begin{equation}
> \begin{array}{rl}
> h & \sim \mu M^{2/3}f^{2/3}/r\\
>  & \sim M_{ch}^{5/3}f^{2/3}/r\\
> \end{array}
> \end{equation}

The correct way to translate array in ConTeXt is

\startformula
  \startmatrix[align={right,left}]
    \NC h \NC \sim \mu M^{2/3}f^{2/3}/r \NR
    \NC   \NC \sim M_{ch}^{5/3} f^{2/3}/r \NR
\stopmatrix
\stopformula

However, I think that the original input is wrong. The autor probably 
wanted to use split (or align), rather than array.


> when I try to compile, I get
>
> ! Misplaced alignment tab character &.
> l.484 h&
>        \sim \mu M^{2/3}f^{2/3}/r\\
>
> Of course, when I use
>
> \startformula\eqalign{
> h & \sim \mu M^{2/3}f^{2/3}/r   \cr
>  & \sim M_{ch}^{5/3}f^{2/3}/r  \cr
> }\stopformula
>
>
> everything runs smoothly but I cannot convert all equations containing
> a {array}{rl} or similar, because I would never end... I guess that
> writing a script to convert them in eqlign would be feasible, but it's
> a very... precarious way... I would prefer to fix the problem from
> ConTeXt itself...
>
> how??

Do you want ConTeXt to parse \begin{array}{...} ... \end{array} and 
typeset it? This is possible, but essentially involves rewritting array in 
ConTeXt, without any of the configuration options that ConTeXt provides.

The (now deprecated) amsl module provided something similar to LaTeX 
array. Have you tried using that part of the code?

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: LaTeX maths with array...
  2008-04-19 20:41 ` Aditya Mahajan
@ 2008-04-19 22:26   ` Pau
  0 siblings, 0 replies; 3+ messages in thread
From: Pau @ 2008-04-19 22:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks for the answer.

> The (now deprecated) amsl module provided something similar to LaTeX array. Have you > tried using that part of the code?

yes, I followed exactly the steps of the wiki...

For now the only way of fixing this was to rewrite the arrays per
hand. But LaTeX compiles them, so that I don't think this was an error
from the author

... anyway...



2008/4/19, Aditya Mahajan <adityam@umich.edu>:
> On Sat, 19 Apr 2008, Pau wrote:
>
>
> > Hi,
> >
> > I am preparing an e-journal for astro and I have many articles with
> > lots of equations. Unfortunately, authors are using LaTeX maths and
> > this is giving me trouble.
> >
> > I have read and followed the steps of
> >
> > http://wiki.contextgarden.net/LaTeX_Math_in_ConTeXt
> >
> > and
> >
> > http://wiki.contextgarden.net/Math_with_newmat
> >
> > and it has helped me a lot but there's a snag I run all the time in: array
> >
> > Typically, the equation giving troubles is of the kind:
> >
> > \begin{equation}
> > \begin{array}{rl}
> > h & \sim \mu M^{2/3}f^{2/3}/r\\
> >  & \sim M_{ch}^{5/3}f^{2/3}/r\\
> > \end{array}
> > \end{equation}
> >
>
>  The correct way to translate array in ConTeXt is
>
>  \startformula
>   \startmatrix[align={right,left}]
>    \NC h \NC \sim \mu M^{2/3}f^{2/3}/r \NR
>    \NC   \NC \sim M_{ch}^{5/3} f^{2/3}/r \NR
>  \stopmatrix
>  \stopformula
>
>  However, I think that the original input is wrong. The autor probably
> wanted to use split (or align), rather than array.
>
>
>
> > when I try to compile, I get
> >
> > ! Misplaced alignment tab character &.
> > l.484 h&
> >       \sim \mu M^{2/3}f^{2/3}/r\\
> >
> > Of course, when I use
> >
> > \startformula\eqalign{
> > h & \sim \mu M^{2/3}f^{2/3}/r   \cr
> >  & \sim M_{ch}^{5/3}f^{2/3}/r  \cr
> > }\stopformula
> >
> >
> > everything runs smoothly but I cannot convert all equations containing
> > a {array}{rl} or similar, because I would never end... I guess that
> > writing a script to convert them in eqlign would be feasible, but it's
> > a very... precarious way... I would prefer to fix the problem from
> > ConTeXt itself...
> >
> > how??
> >
>
>  Do you want ConTeXt to parse \begin{array}{...} ... \end{array} and typeset
> it? This is possible, but essentially involves rewritting array in ConTeXt,
> without any of the configuration options that ConTeXt provides.
>
>  The (now deprecated) amsl module provided something similar to LaTeX array.
> Have you tried using that part of the code?
>
>  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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-19 22:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-19 18:24 LaTeX maths with array Pau
2008-04-19 20:41 ` Aditya Mahajan
2008-04-19 22:26   ` Pau

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).