Bug 165849 - Math equation editor: introduce control character, that *decreases* space between characters
Summary: Math equation editor: introduce control character, that *decreases* space bet...
Status: RESOLVED DUPLICATE of bug 114493
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
25.2.1.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formula-Editor
  Show dependency treegraph
 
Reported: 2025-03-21 12:11 UTC by Dominik Lenné
Modified: 2025-04-01 14:02 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 Dominik Lenné 2025-03-21 12:11:43 UTC
Description:
In a formula, not all characters should have the same distance.
Currently, we can set a minimum space for the whole equation and create variation by inserting "`"  or "~" between entities. 
In practice, only few characters in an equation will have the minimum distance, e.g. "%DELTA T" --> "ΔT", while the majority of pairings need a somewhat bigger distance. So we need a lot of distance characters to make it read-friendly, which makes the code hard to read. 

The suggestion is, to introduce a control character that reduce the spacing a bit from the standard spacing, e.g. "´". 

Another possible solution would be to introduce an editable list of characters, like %delta %DELTA, for which a separate standard spacing to the following entity can be defined, as to have a harmonious look and source good code readability at the same time.

thx for your brillant work!


Steps to Reproduce:
1. Write formula in writer math equation editor containing characters, that should have different spacings between them.

Actual Results:
Have to find a compromise for standard spacing or work with small standard spacing and a lot of space-*adding* control characters ( ` ~ ).

Expected Results:
Possibility to set a good standard spacing for most of the spaces and *reduce* spacing for the few items, which need a smaller spacing. 


Reproducible: Always


User Profile Reset: No

Additional Info:
see expected results
Comment 1 V Stuart Foote 2025-03-21 14:43:56 UTC
Hmm, might be useful.

But can't we already control the itra-variable 'Spacing' value for a node by reducing it from its default 10%? 

While the ( ` and ~ ) markups are there to increase spacing.
Comment 2 Dominik Lenné 2025-03-21 23:09:48 UTC
i know of no way to control single spacings.
Comment 3 Regina Henschel 2025-03-28 19:53:21 UTC
Please attach a file with some extreme examples of equations that would benefit from a better spacing.

Please save such an equation to MathML and open the saved file in a browser. Is the rendering in the browser better than in LibreOffice?


(In reply to Dominik Lenné from comment #2)
> i know of no way to control single spacings.

Besides the ` and ~ that you have already mentioned and the global rules in menu Format > Spacing.. V Stuart Foote has mentioned, you can use the keyword nospace that reduces spacing.
Example:
Compare
    nospace{%DELTA T}
with
    %DELTA T
Comment 4 Dominik Lenné 2025-03-30 18:49:24 UTC
Generally, all differential operators like %DELTA %delta nabla partial need a small spacing. 

I must admit that I did not know of the 'nospace{}' tag (my fault). Thx for the hint.

While a bit cumbersome to write, it allows to decrease the space between a set of entities without decreasing it for the whole formula, which is what I was asking for.

So I think, the desired look can be achieved with the means available.

From a code readability and typing speed point of view, a user definable list of entities/characters/operators with default space set like the one used by "nospace{}" might be desirable, but I understand that this is such a small improvement over current options, that programmer time might be better used for other goals.
Comment 5 Regina Henschel 2025-04-01 14:02:10 UTC
The ` and the ~ space is mapped to the <mspace width="0.5em"> element and <mspace width="2em" element of MathML 2.0, when the document is saved. It would be possible to implement that the user can determine the value of its width attribute.

We have already a request in bug 114493 about giving the user better ways to determine spacing. I'll set this as duplicate. Please add any comments to that bug report.

In addition, please keep in mind that the MathML2.0 standard warns authors about trying to tweak spacing. https://www.w3.org/TR/MathML2/chapter3.html#id.3.3.6.4

*** This bug has been marked as a duplicate of bug 114493 ***