Bug 63610 - EDITING: Enhancement request: for Auto-Correction to convert typed Math language into objects and invoke Math formula editor
Summary: EDITING: Enhancement request: for Auto-Correction to convert typed Math langu...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
4.0.2.2 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formula-Editor AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2013-04-16 16:14 UTC by webofht-libreofficebugs002
Modified: 2019-01-14 23:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description webofht-libreofficebugs002 2013-04-16 16:14:42 UTC
Problem description: No AutoCorrect option allows the user to type a fraction with a horizontal line, e.g.
3
__
4


Steps to reproduce: 

Typing 1/2 gives ½ only.

I need to type a number of fractions quickly. A _standard_ way is: 
Insert -> Object -> Formula -> {<?>} over {<?>} .

By fractions, I mean
1
__
2
with the _horizontal_ line (not in the form of 1 / 2 , not using subscript, not using superscript)

I would be grateful to see an AutoCorrect feature which lets me turn it on:

1. Type (digit) / (digit) (space)
2. Writer converts the fraction into the object (with the _horizontal_ line)
3. If the user does not like it, Ctrl + Z returns the previous form (i.e. (digit) / (digit) (space))
4. Some users may be typing a date (not a fraction). This AutoCorrect feature can be turned off easily.

Alternatively, if this feature is turned off by default. The user can turn it on:
1. Tools -> AutoCorrect Options 
2. -> Options -> Treat fractions as objects with horizontal lines 


Current behavior: No AutoCorrect option allows the user to type a fraction with a horizontal line.

Expected behavior: An AutoCorrect option could be added to allow the user to type this fraction.

Related: http://nabble.documentfoundation.org/Fractions-in-Maths-td4047979.html

Regards,

C. H. D.
LibreOffice User
Comment 1 V Stuart Foote 2013-04-16 16:37:47 UTC
Thank you for submitting I followed the thread discussion. Setting status to NEW as a medium enhancement.

Please spend a bit more time and refine your suggested enhancement.

Other than a horizontal line (reverting auto correct handling, reduction of fractions) are you suggesting insertion of a Math object? As in Johnny Rosenburg's posting to the thread:

"...wants Writer (or even Calc) to be able to create a
LibreOffice Math object with the auto correction feature.

...types 355/113 and after hitting space, it will be replaced by a
LibreOffice Math object that you normally create by opening
LibreOffice Math and type ”355 over 113”...
at least LibreOffice Calc to be able to use it for calculations,
making the 355 over 113 object approximately equal to 3.14159292."
Comment 2 V Stuart Foote 2013-04-16 18:51:51 UTC
So folks are clear. 

For Writer -- you would like an enhancement to Auto-Correct functions providing a selectable option. An option that, when selected, would detect math symbol entry while inputting text and invoke the Math editor presenting the formula as entered, available to complete or accept. This enhancement could optionally be set to auto accept the resulting formula--by passing the Math editor screen.

This enhanced Auto-Correct feature would be in addition to existing Alt<Insert><Object><Formula> that creates an empty math object at cursor position, and opens the Math editor screen in the Write session. 

Final formula input in both cases is with LibreOffice Math language symbology, with some possible need for Auto-Correct to cast typed text into correct LibreOffice Math language binary operator values.
Comment 3 webofht-libreofficebugs002 2013-04-17 01:26:18 UTC
(In reply to comment #1)
> "...wants Writer (or even Calc) to be able to create a
> LibreOffice Math object with the auto correction feature.
> 
> ...types 355/113 and after hitting space, it will be replaced by a
> LibreOffice Math object that you normally create by opening
> LibreOffice Math and type ”355 over 113”...
> at least LibreOffice Calc to be able to use it for calculations,
> making the 355 over 113 object approximately equal to 3.14159292."

Certainly, here are two things:

1. AutoCorrect option
2. Treat the Math object as a number, e.g. =1/2+1/2 will give me 1

Just to organize things, do I need to submit _another_ enhancement request related to calculating Math objects in Calc?
Comment 4 V Stuart Foote 2013-04-17 14:49:57 UTC
(In reply to comment #3)

> 2. Treat the Math object as a number, e.g. =1/2+1/2 will give me 1
> 
> Just to organize things, do I need to submit _another_ enhancement request
> related to calculating Math objects in Calc?

Sorry, the Math formula editor, Math language, and Math objects are for markup of formulas ONLY. There is no implementation of symbolic computation in the UNO framework. 

You might find enough interest in a Python based extension that could parse openoffice Math language into computer algebra--SymPy based perhaps--and deliver results into cells on Calc worksheet. But it would be an extension, unlikely TDF or the ESC would have any interest in expanding LibreOffice to include Computer Algebra. Especially when there are so many commercial and FOSS projects already active.

But IMHO, more useful would be direct LibreOffice support of MathML 3.0, as well as full LaTex typsetting--but those are different enhancements.  

And, this issue should be limited to the AutoCorrect enhancement for Math language entry.
Comment 5 webofht-libreofficebugs002 2013-04-17 16:09:04 UTC
(In reply to comment #4)

> And, this issue should be limited to the AutoCorrect enhancement for Math
> language entry.

Good point. Focus on the AutoCorrect function.

The enhancement could help to AutoCorrect in these cases:
{5 over 6} -> 5 (forward slash) 6 (space)
3{5 over 6} -> 3 (space) 5 (forward slash) 6 (space)
{5a over 6} -> 5a (forward slash) 6 (space)
{5.2 over 6} -> 5.2 (forward slash) 6 (space)
Comment 6 V Stuart Foote 2013-04-17 16:37:47 UTC
Did you mean to reverse that notation?

Looks like on left is the resulting Math language, on right is input text that you'd like an AutoCorrect function to detect and convert.
Comment 7 webofht-libreofficebugs002 2013-04-18 01:58:09 UTC
(In reply to comment #6)
> Did you mean to reverse that notation?
> 
Yes.

The lists of proposed AutoCorrect samples:
5 (forward slash) 6 (space)-> {5 over 6} 
3 (space) 5 (forward slash) 6 (space)-> 3{5 over 6} 
5a (forward slash) 6 (space)-> {5a over 6} 
5 (forward slash) 6d (space)-> {5 over 6d} 
5.2 (forward slash) 6 (space)-> {5.2 over 6} 
5 (forward slash) 6 (space) b (space)-> {5 over 6}b 

Just added two more cases.
Comment 8 Regina Henschel 2018-05-23 22:57:17 UTC
I think, that it is not possible to insert an OLE object by AutoCorrect. AutoCorrect always exchanges some characters with other characters. Even if it were possible, you would need an entry for every possible fraction.

Type
    a over b
mark it and click on the formula-icon.
It generates the formula directly without opening the editor.

Another way is to write a macro, that exchanges the / with word 'over' and then inserts the Math OLE object at cursor position.