Dear MathML group,
I’m just wandering how to align formulas given a symbol. For example, __y=x+1 x+1=y (where the _ are spaces)
Reading the MathML specification, I came up with <mtable> <mtd> <mi>y</mi> <malignmark/> <mo> = </mo> <mi>x</mi> <mo>+</mo> <mn>1</mn> </mtd> <mtd> <mi>x</mi> <mo>+</mo> <mn>1</mn> <malignmark/> <mo> = </mo> <mi>y</mi> </mtd> </mtable>
Do you think that this is the best way to express that?
Another question is whether the malignmark must appear always inside a table (mtable) or can be used also combined with <mspace linebreak="newline"/>. For example, is the following a valid alternative? <mrow> <mi>y</mi> <malignmark/> <mo> = </mo> <mi>x</mi> <mo>+</mo> <mn>1</mn> <mspace linebreak="newline"/> <mi>x</mi> <mo>+</mo> <mn>1</mn> <malignmark/> <mo> = </mo> <mi>y</mi> </mrow>
Dani 
On 18/12/2015 16:56, Daniel Marques wrote:
> Dear MathML group, > > I’m just wandering how to align formulas given a symbol. For example, > > __y=x+1 > > x+1=y > > (where the _ are spaces) > > Reading the MathML specification, I came up with > > <mtable> > > <mtd> > > <mi>y</mi> > > <malignmark/> > > <mo> = </mo> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > </mtd> > > <mtd> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > <malignmark/> > > <mo> = </mo> > > <mi>y</mi> > > </mtd> > > </mtable> > > Do you think that this is the best way to express that? Apart from a missing mtr (was optional in mathml 1 but not since) yes but..... malignmark is one of the trickier areas of mathml and not supported in all mathml renderers so if you are targetting a specific system and it works then fine, otherwise I'd split it as two columns right aligned for the left hand side and left aligned for the rest. Of course that suffers from the problem that malignmark was trying to address of breaking up the expression structure. > > Another question is whether the malignmark must appear always inside a > table (mtable) as specified yes. or can be used also combined with <mspace > linebreak="newline"/>. For example, is the following a valid alternative? > > <mrow> > > <mi>y</mi> > > <malignmark/> > > <mo> = </mo> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > <mspace linebreak="newline"/> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > <malignmark/> > > <mo> = </mo> > > <mi>y</mi> > > </mrow> > > Dani > I was going to show that that was invalid but it turns out that it is invalid according to the prose but the constraint that malignmark only appears in tables isn't checked by the schema. (In principle it could do but it would greatly complicate the relax schema as you'd have to carry the fact that you were inside a table through arbitrary pattern rules. I suppose the XSD schema could have had an xpath assertion saying explicitly that all malignmark are within a table. David ________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This email has been scanned for all viruses by Microsoft Office 365. ________________________________ 
Thank you very much David for the response and very fast in answering. As
always you do!!! Original Message From: David Carlisle [mailto:[hidden email]] Sent: viernes, 18 de diciembre de 2015 18:21 To: [hidden email] Subject: Re: Formula alignment On 18/12/2015 16:56, Daniel Marques wrote: > Dear MathML group, > > I’m just wandering how to align formulas given a symbol. For example, > > __y=x+1 > > x+1=y > > (where the _ are spaces) > > Reading the MathML specification, I came up with > > <mtable> > > <mtd> > > <mi>y</mi> > > <malignmark/> > > <mo> = </mo> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > </mtd> > > <mtd> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > <malignmark/> > > <mo> = </mo> > > <mi>y</mi> > > </mtd> > > </mtable> > > Do you think that this is the best way to express that? Apart from a missing mtr (was optional in mathml 1 but not since) yes but..... malignmark is one of the trickier areas of mathml and not supported in all mathml renderers so if you are targetting a specific system and it works then fine, otherwise I'd split it as two columns right aligned for the left hand side and left aligned for the rest. Of course that suffers from the problem that malignmark was trying to address of breaking up the expression structure. > > Another question is whether the malignmark must appear always inside a > table (mtable) as specified yes. or can be used also combined with <mspace > linebreak="newline"/>. For example, is the following a valid alternative? > > <mrow> > > <mi>y</mi> > > <malignmark/> > > <mo> = </mo> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > <mspace linebreak="newline"/> > > <mi>x</mi> > > <mo>+</mo> > > <mn>1</mn> > > <malignmark/> > > <mo> = </mo> > > <mi>y</mi> > > </mrow> > > Dani > I was going to show that that was invalid but it turns out that it is invalid according to the prose but the constraint that malignmark only appears in tables isn't checked by the schema. (In principle it could do but it would greatly complicate the relax schema as you'd have to carry the fact that you were inside a table through arbitrary pattern rules. I suppose the XSD schema could have had an xpath assertion saying explicitly that all malignmark are within a table. David ________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This email has been scanned for all viruses by Microsoft Office 365. ________________________________ 
In reply to this post by David Carlisle
David's solution is widely used and is what people do in TeX. You do need add some spacing around the '=' though (probably by overriding columnspacing). There are also options to use with indenttarget, although that still isn't well implemented even though it isn't that hard to implement. It works well if the first equation is the left of the second. I.e., if you hadAnother option that is widely supported in renderers is to use <mphantom> to get alignment. That's pretty hacky though. x+1=y Neil Soiffer Senior Scientist Design Science, Inc. www.dessci.com ~ Makers of MathType, MathFlow, MathPlayer, MathDaisy, Equation Editor ~ On Fri, Dec 18, 2015 at 9:20 AM, David Carlisle <[hidden email]> wrote:

Free forum by Nabble  Edit this page 