Bug 73593 - add more formula items to Elements pane, provide LibreOffice with more complete coverage of MathML and LaTex symbol definitions
Summary: add more formula items to Elements pane, provide LibreOffice with more comple...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 125274 (view as bug list)
Depends on: 134214
Blocks: Formula-Editor Elements-Pane
  Show dependency treegraph
 
Reported: 2014-01-14 08:22 UTC by Christoph Thielecke
Modified: 2020-11-12 22:40 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
extent of Latex symbol support (255.35 KB, application/force-download)
2016-10-29 22:01 UTC, V Stuart Foote
Details
rich extent of LaTex symbol coverage (255.35 KB, application/force-download)
2016-10-29 22:11 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Thielecke 2014-01-14 08:22:59 UTC
It would be nice, to have more formula items in toolbox.

For examples see:
Microsoft Office toolbars (page 6, 7):
http://www.uni-giessen.de/~g021/PDF/wd2010_mathematische_formeln.pdf

Latex symbols:
http://estudijas.lu.lv/pluginfile.php/14809/mod_page/content/4/instrukcijas/matematika_moodle/LaTeX_Symbols.pdf
Comment 1 sophie 2014-01-14 14:45:25 UTC
Set as New - Sophie
Comment 2 V Stuart Foote 2016-10-29 22:01:47 UTC
Created attachment 128347 [details]
extent of Latex symbol support

LibreOffice's StarMath and our limited support of MathML symbol is underwhelming.

With much better support for Unicode in general and better font management with HarfBuzz, seems we can do more.  

Should be able to provide support of additional defined symbols (SM\MathML\LaTex) on the Elements pane, but also in composing nodes using a broader range of symbols.

=-ref-=
https://www.w3.org/TR/MathML2/byalpha.html
Comment 3 V Stuart Foote 2016-10-29 22:11:26 UTC
Created attachment 128348 [details]
rich extent of LaTex symbol coverage

LibreOffice's StarMath and our current limited support of MathML symbol is underwhelming.

With much better support for Unicode in general and better font management with HarfBuzz, seems we can do a lot more with the Formula editor.  

As here, we should be able to provide support of additional defined symbols (SM\MathML\LaTex) on the Elements pane, but also in composing nodes using a broader range of symbols.

Believe UI support of StarMath should be extended to cover some set of MathML and LaTex--not all of either, but more complete.

=-ref-=
https://www.w3.org/TR/MathML2/byalpha.html
Comment 4 Volga 2017-09-10 16:19:12 UTC
We can also create a comparison table of defined symbols between SM, MathML and LaTeX, everyone would get help.
Comment 5 Volga 2017-09-13 06:16:48 UTC
(In reply to Volga from comment #4)
> We can also create a comparison table of defined symbols between SM, MathML
> and LaTeX, everyone would get help.
This can be available at our Wiki.
Comment 6 V Stuart Foote 2018-08-24 01:15:49 UTC
*** Bug 119449 has been marked as a duplicate of this bug. ***
Comment 7 brian.bj.parker99 2018-08-26 09:05:29 UTC
(In reply to V Stuart Foote from comment #6)
> *** Bug 119449 has been marked as a duplicate of this bug. ***

My bug report 119449 is marked as a duplicate but it differs in detail from the issues discussed in this thread. In particular, it suggests extending the *input language* to include Latex notation, and not simply to increase the number of formula items available from the menu or toolbars.
  
For easy reference, I include the full text of bug report 119449 here:

The syntax used to enter math equations in LO formula is apparently based on the largely obsolete troff eqn preprocessor. 
For example:
 x sup y sub z

Latex syntax is the standard format used to enter equations in modern applications, including Microsoft Word, Apple Keynote, wikipedia, mathjax etc.
Surprisingly, LO syntax also allows some latex notation, for example:
x^y_z  
which gives the same superscript and subscript as the above example. 
However, most other latex constructs fail e.g. \Lambda  as the latex equivalent of %LAMBDA.

As an enhancement request, the LO Formula editor math syntax should be expanded to include all standard Latex forms (including AMS-Latex) as synonyms. I can't see any fundamental ambiguities that would prevent this from being almost fully backwards compatible.
This would allow published latex formulae to be cut and pasted directly in LO presentations etc. and would increase compatibility with Microsoft Word and Apple Keynote.


Actual Results:
For example \Lambda is not accepted in the formula editor.

Expected Results:
Expected the same result as %LAMBDA
Comment 8 V Stuart Foote 2018-08-26 14:52:26 UTC
Indeed, my apologies. Bug 119449 would be better set a duplicate of bug 96208 -- done.

Issue in general with support Tex and LaTex syntax is that our "native" format to control node composition is StarMath--but our storage media is ODF. As ODF requires use of MathML, we strive to support MathML for import and export. We annotate the XML of each MathML ODF Formula object with its StarMath composition--and reparse that StarMath on reimport.

There is no specification for using TeX with ODF, so while we could probably filter import the LaTeX syntax formula entries and could also hold them as annotations--the same as the StarMath for reimport--we would never adopt TeX for canvas layout.  TeX is treated to PostScript.

Filter based import of LaTex, and expanding the GUI to support LaTex syntax entry is feasible. The first step for both is to ensure the MathML/StarMath can correctly describe the additional symbology when recorded to ODF XML.
Comment 9 V Stuart Foote 2018-08-26 17:06:06 UTC
(In reply to V Stuart Foote from comment #8)
> for canvas layout.  TeX is treated to PostScript.

s/TeX is treated to PostScript./TeX is treated the same as PostScript./

That is no filter support for PS. Just filter based EPS import and export and no native support.
Comment 10 brian.bj.parker99 2018-08-27 00:24:21 UTC
Just to clarify, what I am suggesting here is much simpler than what you are describing- I am not suggesting using the tex engine for layout or allowing full blown import of arbitrary latex files.

All I am suggesting is a minor extension of the StarMath syntax. StarMath syntax *already* supports latex synonyms for superscript and subscript. If it also supported e.g. \Lambda as a synonym for %LAMBDA, and \cdot as a synonym for cdot etc, then the majority of latex formula examples could be cut and pasted directly into Impress presentations.  
This could be done in an almost entirely backward compatible way, and would not require *any* changes to the layout code, or any changes to the storage formats- the changes would be localized to the starmath parser, and would be an extension to the syntax and so would be backwardly compatible (except for contrived examples). 

Also, it wouldn't need to include 100% of latex math notation- just covering the common cases would allow the majority of published latex examples to be cut and pasted.


(In reply to V Stuart Foote from comment #8)
> Indeed, my apologies. Bug 119449 would be better set a duplicate of bug
> 96208 -- done.
> 
> Issue in general with support Tex and LaTex syntax is that our "native"
> format to control node composition is StarMath--but our storage media is
> ODF. As ODF requires use of MathML, we strive to support MathML for import
> and export. We annotate the XML of each MathML ODF Formula object with its
> StarMath composition--and reparse that StarMath on reimport.
> 
> There is no specification for using TeX with ODF, so while we could probably
> filter import the LaTeX syntax formula entries and could also hold them as
> annotations--the same as the StarMath for reimport--we would never adopt TeX
> for canvas layout.  TeX is treated to PostScript.
> 
> Filter based import of LaTex, and expanding the GUI to support LaTex syntax
> entry is feasible. The first step for both is to ensure the MathML/StarMath
> can correctly describe the additional symbology when recorded to ODF XML.
Comment 11 Xisco Faulí 2019-06-10 16:13:48 UTC
*** Bug 125274 has been marked as a duplicate of this bug. ***
Comment 12 mirko.pieropan 2019-09-09 12:13:11 UTC
Could anyone comment giving updates on the situation concerning this enhancement? I'd be interested in allowing for LaTeX syntax too.
Comment 13 mirko.pieropan 2020-01-01 11:01:57 UTC
Hello, I'd like to add a few points that require some thought in my opinion, even if some of them are different issues than those outlined so far:
1) It'd be nice that formulas could start where one places the cursor on the slide or document
2) Could making TexMaths native to LibreOffice a good idea? We might try to contact and involve the developer who made the extension.
3) Formulas are very painful to write at the moment and it's difficult to displace them to the right place (would be cool if they could be written "in line" with the text). It's not currently possible to group formulas and text into one single object.
4) bad rendering in some cases (e.g. "underline y") and no "mathcal" command available
5) The transition between "normal" mode and "formula" mode and viceversa is quite painful in terms of user experience.
Comment 14 mirko.pieropan 2020-01-01 11:03:18 UTC
I also copy here a comment from https://bugs.documentfoundation.org/show_bug.cgi?id=96208:

It'd be nice if formulas were inserted at the current position of the cursor, rather than at the center of the page (in LO Impress) and if the box containing the formula was able to adaptively change its size according to the content, as after a few characters it's impossible to see what is inside the box, and trying to enlarge the box manually does not work.
Comment 15 mirko.pieropan 2020-01-01 11:11:15 UTC
Finally when I say that writing formulas is painful I mean that e.g. I need to do "{bar{bold{h}}}^{ (k) }" in order to get what in Latex would simply be "\bar{\boldsymbol{h}}^{(k)}"