Trying to understand how math font selection works

@ajlittoz . Sorry for my english. My question is only about LO math.
I use LO math as the symbol and equation inside Writer.
I don’t have issue with writer, but thank you.

Let’s just talk about LO math only from now on.
So responding to your paragraph “Going back to Math…”.
This rudimentary dialog box offers to use any font in my system and i can deliberately set the italic or bold, without the software (and me) knowing if that variant is available or not?
If that the case, LO math returns… a replacement font? based on which font? could you elaborate more “italic is also designed by oblique” → does it mean the LO make a character become italic and not taking from what’s inside the font?
In hypothetical case, let say i set a font (in LO math) which don’t have a symbol/character that will be used inside an LO math. This is hypothetical example, a font doesn’t have a greek character, but i accidentally use it as the LO math font, but i write an equation using a greek character. What will happen? I try to understand this…
is it the same process as you said “two-tiered” process?

Actually, i found this “rudimentary setting” can be very useful, there’s freedom to set the font, if one understand what happen.
For example: google docs math formula doesn’t allow change of font as per now. In MS word, it works differently. So… although LO math has not been evolve for long time… it still have some advantages. Of course i hope for improvement.

I don’t have issue with LO math as image…
Thank you.

The font name you select is necessarily present on your computer because the menu is built from the installed font list. But Math does not check if bold, italic or bold+italic variants are present. It blindly requests the font+variant you chose. What happens next is the responsibility of the OS font renderer. This is done silently and I suppose Math doesn’t even get a notification a substitution occurred.

This is a different issue. Presently Unicode can potentially contain 16×64k characters, out of which ~150k are allocated. It is obvious that no single font offers all these glyphs. When the font renderer discovers that a font has not the requested character, it looks for a font providing it. It will first choose from the same “family” (serif, sans, monospace, …) before looking for an unrelated face.

The main issue here is the returned character could have a totally different metrics (taller or thinner, wider or narrower, space around) than your desired font resulting in jagged line.

This is exactly the discussion (and information) that i needed. Thank you.
If i may draw first conclusions:
Font selection in LO math may mislead us, because they (LO) don’t check if a variant available or not.
One has to check by themselves or has the priory knowledge of the font being used, which is not an easy task for beginner.
I think this is one thing that LO math has to improve.
Although i’m not sure the developer will get this message.
I accidentally notice this in LO, because in other software either they don’t allow this to happen (Inkscape) or they allow but give something that we can notice there’s a mixing font/replacement (word, latex in python-Matplotlib).

About the Unicode, is this the reason we have math-font set such as Cambria Math, STIX two math, TeX Gyre DejaVu Math?

Math is quite outdated in its founding principles. I believe the general service predates Unicode and certainly the gigantic overhaul on font management which happened in the last two decades. Unfortunately, a formula editor is considered a minor secondary feature. If you look at questions on AskLO, you see that major concern is with Calc, then Writer, finally Impress. Draw maintains itself at some constant “background” activity. Base is gaining interest. But Math is considered as an accessory for specialised “academic papers” and don’t get much attention. However, for developers’ defence, I’d say that a good crystal-clear relevant specification for renewal is not available. And most academics will turn to LaTeX which offers premium quality.

The “preferred” math-font is OpenSymbol. Math implictly relies on it for drawing operators. Consequently, this font is implicitly installed with LO. This doesn’t preclude you from chosing another font for variables, function names, … but integral sign, product or summation will always be drawn in OpenSymbol.

If you can produce a good specification for next-generation Math, feel free to do so. I’d be personally interested in reading in and I’d back up and support it eventually. Several of us, e.g. @Lupp, long for some evolution of Math. But we’re growing really old to participate in development.

Yes, I think it is true for most physicist/mathematician (or closer to that).
For academic who is more to experimentalist & engineers, WYSIWYG is still the norm, and especially who uses Linux. It really depends on the community/group/lab where he/she works.

I will open a new question about this, because it turns out i don’t understand it enough, the docs doesn’t explain it enough.

How to do this? is there a guide/example to prapare such thing?
I think that LO writer is good, LO math needs improvement of course.
If it can help, i will try.

Due to age and long retired from my profession as a teacher, I’m no longer a frequent user of the Math component of “our software”. I’m still interested, however, in a sense.
A few (only 8) years ago I even posted a related question with the intention to “answer” it myself making an offer: There was a bait trying to initiate development. See How to get better scalable bracket?, tdf#32362, and tdf#39750.
As far as I can tell, the only recent improvement (announced for 2024-02-DD) to Math was to enable it to create formulas shown in RTL mode, and using Arabic sripts.

Let’s hope the author will also start a revival of Math regarding the old bugs.

BTW: Do you know the TexMaths extension. I’m not any longer eager to study LaTeX for the purpose, but I’m interested in examples.

See also: tdf#101174 (it will be possible to choose fonts other than OpenSymbol in v24.2).

Thanks to Khaled Hosny.

Eager to learn if there will also be an OpenSymbol font then allowing a smart scaling of square and curly brackets.

yes, i know. I don’t prefer to use this. I used a lot of inline-equation in my text and the LO math provides ‘faster’ approach for me.

So these operators, how to set the font? is it in function/variable/ custom fonts in the LO math font selection? It seems not yet implemented in the current version…

If you not yet read it this ask thread may be of interst for you. My contribution there also contains some links to different related threads.

I’m afraid any really sustainable layouter for mathematical formulas will need to do a lot in a similar way as TexMath does it. If this can also offer support for existing Math formula syntax or what automatic conversions can be implemented, I can’t tell.
… …
Taking the risk again to open the horizon, I would suggest thinking about whether we (the worlds math users of today) should make a visual representation of mathematics developed centuries ago the standard for the millennia to come. For example: We are still suffering from an approximately 3500 year old decision to divide by the sexagesimal system. Let’s learn from it. …

1 Like

Hi all,

Mr. Lupp, Thank you for pointing those informations.

I will summarize this information and give some pointer for future development.
LO writer is really good, I am now writing my PhD thesis using Writer (+ a lot of LO math within it).

It is a pity LO math is not actively updated as Writer did.
But I really hope.

If i have ability as developer, i would help, but i don’t have (i know python only).
Perhaps i can help with manual and giving some guidelines.

The work of Khaled Hosny looks promising.

best regards,

You could then also consider writing your thesis in Jupyter notebook format!

LaTEX | Mathjax equations
you may also use matplotlib, numpy and sympy in that »Environment«

Math isn’t bad, however. It just isn’t quite “state of the art” currently.

If your concept of “inline formula” is as I would understand it, you may be interested in the attached example demonstrating the automatic conversion (rendering) of inline formulas to Math OLE objects.

(No. The example is not written in Python. It’s too provisional for that noble language.)
nextExampleMathInlineFormulas.odt (38.7 KB)

Thank you.
Currently, I’m not considering making any extreme switch.

I completely agree.

I think I have read your post previously perhaps more than once, thank you for the sharing the file.
To be honest, I have not tried it myself because i still don’t know Macro and has not got the time to learn it. But definitely one thing that I will try in my spare time.

@ajlittoz @Lupp @mikekaganski
Thank you very much for all the inputs.

I try to sum up our discussion. Here is what I got:

  1. Font issue as in this post: LO should be able to detect if a variant of a font is not available. At least let the user know about it. Although I prefer LO math does not allow selection of unavailable variant.
    Reason: it is misleading, especially for beginners. Not allowing will also “educate” the user, such as myself in this case.

  2. It is convenient to use math-object for all math-variable in the text (as inline eqn) because it provides consistency everywhere in the text and not affected by style of the paragraph. For example a variable %alpha_1, i will use LO-math throughout the text, even tough it is possible to use symbol alpha and subscript 1.
    I think it is the norm nowadays, as the other authors do the same.

So the ability to change all LO-math font & font size in the text at the same time should be there, without the need of extension or macro. A basic need.

Note: Word-math also has issue with this. In theory was easy, but when there’s a lot of equations it is not easy to change font all together, and I have to check and change one by one. The LO math extension actually works better in this case.

Below are more “imaginary” and probably more work to it. It is related to what @Lupp post.

  1. LO math is outdated compared to Word’s and Google Docs’s math because it returns an image and was designed as a separate app.

One advantage of LO math is that we can always edit the code, which is impossible in Word and Gdocs after the equation is printed. You can only write math in using code once in the beginning.

I imagine to return non-image formula would be a very far future project.
But to be able to go back on forth to the formula editor is the key here.
How to make it more straightforward, would be useful for text using plenty of formulas.

Instead of opening LO-math each time we write/edit a formula in writer, why not keep the formula-editor there inside the writer, for example in a special mode “math-mode”. Every time the text cursor is next to the math object (image), we can see the code appear in the formula-editor, then we can press something to be automatically in the formula-editor or back to text.

I don’t have enough knowledge on this matter.
The auto-scaling of inline-formula in Latex (as far as i remember) and Word works pretty well, for example when you write a fraction in inline-formula. I guess this is not possible when LO math still returns an image.
But we should go to this direction.

If you think, I should post a request/bug in the bugZilla. (if one of those ideas is good enough). Please let me know.

Let me dream aloud (I am not a developer).

Designing formulas in a separate app is certainly a good thing. That this separate app looks integrated in Writer (and other LO components) is only a matter of implementation and user interaction procedure (designed in the GUI).

I do agree that it would be nice to control visual/typographic aspects from within Writer. This is where I begin to dream awake. The basic tool for this in Writer is styles. So, the right track would be to implement a new style category for Math, as feature-rich and versatile as those in Writer. To make things easy, this new style should be configured in Math (so that it is also available in the other components Calc, Impress, Draw, …). When the Math object is imported into Writer, its styles are also imported. Then Writer should be extended to be able to interpret the Math styles.

In this scheme, you still need to go to Math to modify your styles (because it is easier than modifying all components to interact with Math styles, unless of course developers can find a way to share the Math styles code).

There is also another needed feature: referencing Math objects. As an example, take your %alpha_1 single-variable formula. If it is interspersed in text in multiple locations, I’d like it to be a reference to a single object, so that if I need to change it to %beta_n I do it only once and all occurrences are changed simultaneously.

To make this dream come true, we need a solid rigorous specification coexisting peacefully with ODF.

1 Like

This again makes me doubt if we are talking of the same thing using the words “scaling” or “inline-formula” or “image” in the given context.
As I remember it (currently no ‘Word’ available here) Word's included version of MathType always showed an image by default , and this image was exported to different applications (Writer, web browsers) when opening a Word document with equations. (At least I had to set anew hundreds of formulas when I abandoned Word and moved to StarOffice in about 1999.)
Concerning the term inline-formula: To my understanding this must be plaint text coming with any kind of markup telling the editor (probably/wishable) and an extension/macros (surely) the fact “This is intended to finally be shown graphically as a formula if it goes to a printed version”. The examples contained in the document “nextExampleMathInlineFormulas.odt” already attached to a previous comment of mine were of this kind using the shorthand markup-parentheses $. (left) and .$ (right). That attachment also contains an actually working very short (30-liner) macro from my toolbox for the conversion from “inline” to “rendered”. (A revese macro would be very simple, but ´was not provided there.)
Anyway: A typesetting application using inline markup for mathematical formulas needs to be “free” in its ways to position (and anchor and align and…) the resulting graphical elements when creating a printable view of the document or must be told explicitly in what way the author wants to get it done in the given case. An example demonstrating this problem and a very raw first approach to its solution is the “large” formula contained in a TextFrame.

I don’t think developers are blind concerning the Math component (which is “independent” anyway as far as components of a monolithic application can be), and one of the well known ones (@mikekaganski) already posted a comment to this thread. Two reasons may be relevant for the lack of development:

  • Missing human resources.
  • Doubts in the probably outdated concept of Math (specifically concening the ‘OpenSymbol’ approach.
    An actual specification, however, should be based on very profound knowlege.

Hi Lupp, thank you. I am sure we are talking the same thing: In-line formula.
The current version of word doesn’t use math type anymore, and it does return text instead of an image.
If you don’t have word, try it in google-docs, it is similar but less developed.
There you can type with using latex command, press space/enter you get the equation printed as text.
But there is no way to edit the latex command, only edit manually (a caveat).

I’ll respond to other comment later…