Bug 65808 - Formula editor treats too many characters as Variables and makes them all italic with incorrect formula renderings
Summary: Formula editor treats too many characters as Variables and makes them all ita...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
3.6.5.2 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formula-Editor
  Show dependency treegraph
 
Reported: 2013-06-16 07:08 UTC by Yury
Modified: 2019-03-18 21:23 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
two views of a formula default with Variables italic, and with Varaibles modified non-italic (428.61 KB, image/png)
2016-08-02 18:13 UTC, V Stuart Foote
Details
two views of a formula default with Variables italic, and with Varaibles modified non-italic (441.91 KB, image/png)
2016-08-02 18:18 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yury 2013-06-16 07:08:11 UTC
Just as the digits are always set uniformly (usually in 'regular' letters), the punctuation ought to be set uniformly, too. E.g., commas are processed differently if placed after blank and after digit.

The demo is simple. Make a formula of this:
0, ..., 

Commas are set in regular (after 0) and in italic (after ...). In some font faces (Charter, for example) this is fairly noticeable and gives formula a sloppy look.

The workaround is of course to put a blank (space) before comma/dot not denoting a decimal sign. However, this is not an obvious thing to do, and is not documented (at least, I couldn't quickly find anything in official LO Math book)

I understand commas and dots are guessed to be a part of numbers, so can't be (easily) auto-isolated.

HOWEVER, is there a must to treat punctuation IN FORMULAS as a part of the 'numbers' or as a part of the 'text'? IDEALLY, punctuation (and math signs, for that matter) should be excluded from variability in style and set always either in 'like in digits' style or in their own style.

In fact, ANYTHING not in 'digits' / 'definitely variables' categories should be treated uniformly.

It's quite a pain to insert, say, a ∞ or a 〉 (u+232A; rangle) [there are more] in a formula [to save time and effort, I often create formula from text selection -- BTW, is it documented?], and then to have it in skewed (effectively, distorted).

Bowing to TeX is a banality, but I've never before had noticed two styles of punctuation / math signs in TeX-processed formulas.

CONCLUDING, to fix this I suggest changing the categorisation of glyphs in Formula Editor to 'Variables may start only with letters' and 'Digits are digits' and 'Text is anything else'.

P.S. At the very least, the workaround should be authoritatively documented (wiki section on useful tips on formulas writing?). I'd write a quickie myself, but where is the systematic place for such page? The wiki seems to be for the developers, effectively. Buried under several tiers of links (not available readily on main LO page), too.
Comment 1 Robinson Tryon (qubit) 2014-12-22 04:33:36 UTC
UX: I bet you can formulate a good response to this enhancement request!
Comment 2 Heiko Tietze 2016-08-02 15:04:37 UTC
I don't see any cursive chars for {0, ...0} over {1 ,...1 } over {2 , ...2}. Is the issue still valid?

Version: 5.2.0.4
Build ID: 066b007f5ebcc236395c7d282ba488bca6720265
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
Locale: de-DE (de_DE)
Comment 3 Heiko Tietze 2016-08-02 15:45:34 UTC
(In reply to Heiko Tietze from comment #2)
> ...cursive 
Should be "italic" of course, sorry.
Comment 4 Yury 2016-08-02 16:08:35 UTC
The newest LO I have installed here is 5.1.3. In it, the issue is there.
Possibly this is so in your 5.2.0, too -- for my example you'd have to use the fontface with well visible distinction in regular and italic commas, like Charter.
Comment 5 V Stuart Foote 2016-08-02 18:10:10 UTC
Confirming.

On Windows 8.1 Ent 64-bit en-US with
Version: 5.1.4.2 (x64)
Build ID: f99d75f39f1c57ebdd7ffc5f42867c12031db97a
CPU Threads: 8; OS Version: Windows 6.29; UI Render: GL; 
Locale: en-US (en_US)

and on 
Version: 5.3.0.0.alpha0+
Build ID: 4a6329badc9c8679945d1a1ec225e26e15d7bfd2
CPU Threads: 8; OS Version: Windows 6.2; UI Render: GL; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-07-30_10:25:39
Locale: en-US (en_US); Calc: CL

In the Math formula editor it seems the range of Unicode codepoints that are treated as "variables" and so receiving default "italic" styling is *too* broad.

For a simple demonstration enter the following in the formula editor:

U+2039...U+203a U+2329...U+232a U+00ab...U+00bb U+221e U+2225
newline
U+27e6 { 2cdot %ipi r } over { %DELTA %imu } U+27e7

Then convert each Unicode point to its glyph (i.e. position at end of each and <alt>+x)

The default "Liberation Serif, Italic" assigned to variables renders the entire string except the Greek characters as variables and so receives an italic styling.

Modifying the Math menu value for Format -> Fonts: "Variables" dialog and unchecking Italic renders the strings more reasonably--showing the left and right angle brackets vertical, and the parallel without a slant.

Suspect the Unicode points classified as variables need to be more constrained.
Comment 6 V Stuart Foote 2016-08-02 18:13:02 UTC
Created attachment 126523 [details]
two views of a formula default with Variables italic, and with Varaibles modified non-italic

Note that glyphs for a lot of symbols (various brackets here) are being treated as variables and italicized incorrectly.
Comment 7 V Stuart Foote 2016-08-02 18:18:40 UTC
Created attachment 126524 [details]
two views of a formula default with Variables italic, and with Varaibles modified non-italic
Comment 8 Heiko Tietze 2016-08-02 20:58:59 UTC
(In reply to V Stuart Foote from comment #5)
> For a simple demonstration...

lol, but confirmed (even without Charter being installed)

And you changed the component back to Formula Editor from ux-advise, which is good. No need to bother the UX people with bugs (removing the list from CC).