Bug 104753 - Missing option to have a symbol with a subscript and a prime symbol in LibO Math
Summary: Missing option to have a symbol with a subscript and a prime symbol in LibO Math
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
5.2.4.1 rc
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 14:20 UTC by Callegar
Modified: 2019-03-22 07:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Use of mpadded in MathML (1.60 KB, application/x-zip-compressed)
2016-12-19 17:30 UTC, Regina Henschel
Details
Demo file, with visual answer to question. (16.43 KB, application/vnd.oasis.opendocument.graphics)
2017-10-31 22:07 UTC, Callegar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Callegar 2016-12-18 14:20:23 UTC
Looks like there is no proper way to have a symbol with both a subscript and a prime sign in LibO Math.

I.e. if you try to have something equivalent to LaTeX "x'_1" you can either do

x_1^'

but in this way the prime sign ends up way too small and too high; or

x'_1

but in this way the subscript gets too much on the right; or

x_1'

but in this way the prime sign gets too much on the right
Comment 1 Regina Henschel 2016-12-18 21:51:06 UTC
You can workaround it by using x_1^{size*1.6 ′} and setting the spacing for superscript to 0%.

In what mathematical context and meaning do you need such a type setting?
Comment 2 Callegar 2016-12-19 12:39:51 UTC
Thanks, but this too is not very satisfactory. Seems to be hackish, because it hardwires a 1.6 that should actually depend on the relative font size that you selected. Furthermore, the ' goes way too high.

> In what mathematical context and meaning do you need such a type setting?

I work in electronic engineering. But basically, I think that this can be useful in many contexts. Basically, whenever one has a quantity with a subscript and needs a prime sign to differentiate a "companion" quantity.
Comment 3 Callegar 2016-12-19 12:44:13 UTC
Note that the issue can be solved in different ways:

1) Assuring that ' is treated as a proper superscript, so that a subscript is placed below it and not also to the side of it;

2) providing the concept of "negative space" to LibO Math, so that one can remove the horizontal space taken by the prime sign.

3) providing the concept of "object taking no space" to LibO Math, so that the prime sign can be inserted without it taking any horizontal space.

Note that 1) is what LaTeX does seamlessly. And I must admit that I am spoiled by LaTeX.
Comment 4 Regina Henschel 2016-12-19 17:30:16 UTC
Created attachment 129786 [details]
Use of mpadded in MathML

(In reply to sergio.callegari from comment #3)
> Note that the issue can be solved in different ways:
> 
> 1) Assuring that ' is treated as a proper superscript, so that a subscript
> is placed below it and not also to the side of it;

There is no problem using an apostrophe (' U+0027) or a prime (′ U+2032) as superscript and stacking of superscript and subscript works too. But for these two characters the tick is rendered high in itself, so it looks as if it is placed very high, in case the character is set to superscript in addition.

To get a better looking solution, you need an option to get influence on the position, and that would be way "2". The currently possible setting in Format > Spacing > Category: Indexes is a global setting. A setting per character or group is needed. 

> 
> 2) providing the concept of "negative space" to LibO Math, so that one can
> remove the horizontal space taken by the prime sign.

I would go with this proposal, because the normative language is not StarMath but MathML. And MathML has already the attributes lspace and voffset in its <mpadded> element and allows negative values for them. The request here would be to extend StarMath to support this element and its attributes.

I have attached MathML examples, where you can see, how <mpadded> works. Look at it in a browser like SeaMonkey (or perhaps Firefox; I have not tried). You can open the examples in an editor and alter the attribute values.

Would this solve your request? If yes, then I suggest, to alter the subject accordingly.


> 
> 3) providing the concept of "object taking no space" to LibO Math, so that
> the prime sign can be inserted without it taking any horizontal space.

I do not see the difference to way "2".
 
> 
> Note that 1) is what LaTeX does seamlessly. And I must admit that I am
> spoiled by LaTeX.

What does LaTeX, if you do not use a prime but a different character, for example a "T"? Would you please attach an image, how LaTeX renders these examples, in a large zoom?
Comment 5 Xisco Faulí 2017-10-31 19:14:16 UTC
> What does LaTeX, if you do not use a prime but a different character, for
> example a "T"? Would you please attach an image, how LaTeX renders these
> examples, in a large zoom?

Dear Reporter,
Could you please answer the question above?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the question is answered
Comment 6 Callegar 2017-10-31 22:05:56 UTC
Sorry for having missed your questions before. Please check the attached file.
Comment 7 Callegar 2017-10-31 22:07:47 UTC
Created attachment 137410 [details]
Demo file, with visual answer to question.

This is odg and contains both "LaTeX" rendering (rendered as svg via the texmaths extension) and the corresponding LibO Math rendering.
Comment 8 Jean-Baptiste Faure 2018-06-19 17:17:01 UTC
(In reply to sergio.callegari from comment #7)
> Created attachment 137410 [details]
> Demo file, with visual answer to question.
> 
> This is odg and contains both "LaTeX" rendering (rendered as svg via the
> texmaths extension) and the corresponding LibO Math rendering.

You did not answer the first question in comment #4 (Would this solve your request?). So status set back to NEEDINFO, please set it back to UNCONFIRMED once requested informations are provided.

Best regards. JBF
Comment 9 Callegar 2018-06-19 22:21:35 UTC
Sorry, you are right, I missed that.

I think that the "normal_padded_prime" example looks like a significant improvement with respect to the current situation. I would definitely go for it!
Comment 10 Xisco Faulí 2018-07-25 08:14:03 UTC
(In reply to sergio.callegari from comment #9)
> Sorry, you are right, I missed that.
> 
> I think that the "normal_padded_prime" example looks like a significant
> improvement with respect to the current situation. I would definitely go for
> it!

@Sergio, should this bug then be closed as RESOLVED WORKSFORME ?
Comment 11 QA Administrators 2019-03-21 11:11:56 UTC Comment hidden (obsolete)
Comment 12 Jean-Baptiste Faure 2019-03-22 07:50:22 UTC
Answered in comment #9. Closing as WorksForMe from the given answer.

Please, feel free to reopen if you disagree.

Best regards. JBF