Re: Questions about indentshift

Neil:

Thanks for getting back to me on this, but I'm afraid I'm still confused.  I wasn't asking about how indentshift relates to indentalign, but on how indentshiftfirst relates to indentshift.  A simplified version of the test that I cited is

	<math indentshift="3em" display="block">
	   <mrow>
	      <mi>a</mi>
	      <mspace linebreak="newline" />
	      <mo>+</mo>
	      <mi>b</mi>
	  </mrow>
	</math>

Here, indentshift is 3em, so I understand that the plus sign will be 3em to the right of where it would have been if identshift were 0.  My question is where should the "a" be placed?  It should be controlled by the value of indentshiftfirst, but the default of indentshiftfirst is "inherited (indentshift)".  If I understand this right, the value of indentshiftfirst should be the value of indentshift, since there is no setting for indentshiftfirst.  So the first line should ALSO be 3em to the right of indentalign.  

So what I expect to see if BOTH the "a" and the "+" indented the SAME amount (3em).  But in the image for that test, the second line is 3em farther to the right of the position of the first line.  (Unless you mean that MathPlayer is using the <mrow> around the whole equation to say that the line break is nested, so needs to be indented further.  But that would mean that the first line would have to be considered as starting outside the <mrow>, which seems a bit of a stretch).

Here is the image from the test:
 
 

The indent shifts for the lines are set to be 3em for the second, 6em for the third, and 9em for the fourth.  There is no extra nesting between the 6em and the 9em, so the difference between those lines has to be 3em (not an adjustment due to nesting), and that means the first line here really is 0em.

I do not see why the first two lines are not at the same indentation.  Can you tell me what I am missing?

For the issue with negative indentshiftlast, I missed the indentalignlast="right" in the mstyle at the top of the equation.  Sorry.  Now it makes sense.

Davide


On Mar 28, 2014, at 3:06 AM, Neil Soiffer wrote:

> First off, I apologize for the very late response. I try to be responsive to requests for information, but between a machine crash, a conference, and spring break, it didn't happen this time.
> 
> The key to understanding the example is that indentshift is an *additional* shift to that specified by the indentalign attribute. That attribute defaults to auto, which for MathPlayer (which generated the images) indents based on how deeply nested the breakpoint is in the expression tree. This gives a visual indication of the grouping of expressions. Looking closely at the indentation, I see a bug in the algorithm that determines the nesting level, so that doesn't help understand the output. This example would have been a better example if it had indentalign="left" since it would have made the effect of indentoffset clearer.
> 
> The image is also confusing because no indentation is shown for the first line. That's likely my fault as I probably made a screenshot and just selected the rectangular area around what was drawn. Using a debugger, I can see MathPlayer really does indent the first line 3em.
> 
> A negative value for indentshift shifts the line to the left an *additional* amount to that specified by the indentalign attribute; in that second example, that means 20pts to the left of the right margin.
> 
> Note that MathPlayer (and MathJax?) center block equations, but that is not the same as indentalign="center". That attribute would center each line. That's not the same as centering the bounding box of the entire equation.
> 
> I hope that clarifies the examples,
> 
> Neil Soiffer
> Senior Scientist
> Design Science, Inc.
> www.dessci.com
> ~ Makers of MathType, MathFlow, MathPlayer, MathDaisy, Equation Editor ~
> 
> 
> 
> 
> 
> On Fri, Mar 14, 2014 at 10:29 PM, Davide P. Cervone <dpvc@union.edu> wrote:
> I was looking at some of the linebreak tests in the MathML3 test suite, and some of them confuse me.  For example,
> 
> 	http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking011-indentamount-full.xhtml
> 
> starts with 
> 
> 	<math xmlns="http://www.w3.org/1998/Math/MathML" indentshift="3em" display="block">
> 
> and has some <mi> and <mo> elements then 
> 
> 	<mspace linebreak="newline"/>
> 
> According to 
> 
> 	http://www.w3.org/TR/MathML3/chapter3.html#presm.lbindent.attrs
> 
> the default for indentshiftfirst is indentshift, and since indentshift is set to 3em, it seems to me that the first and second lines both should be indented to 3em.  But the image of the correct rendering shows the first line not indented, while the second line is indented 3em.  What am I missing, here?
> 
> A second confusion for me is in 
> 
> 	http://www.w3.org/Math/testsuite/build/main/Topics/LineBreak/linebreaking010-indentshift-full.xhtml
> 
> where indenshiftlast is set to -20pt.  The image shows the last line right-aligned (with what appears to be about 20pt of space at the right, so it seems that a negative indentshift is supposed to mean indenting from the opposite side from what indentalign specifies?  There is no mention of this in the spec that I can find.  Can someone clarify the intended meaning of negative indents?
> 
> Finally, the tests seem to assume a default indentalign of left, but the spec indicates that the default is up to the renderer.  MathJax uses centering by default, so the tests "fail".  it might be good if the tests set indent align explicitly.
> 
> Davide
> 

Received on Saturday, 5 April 2014 19:41:45 UTC