===
Converted from a “comment” to a “suggested solution”.
(I actually read the already given information. I widely ignored the pieces of code, however.)
I wouldn’t write highly specialised code to apply one or two attributes to existing formulas. As I already told, there are about 70, and another user may want to change/harmonise the relative spacing - or whatever,.
Explaining my point of view
Direct (hard) formatting is generally discouraged for good reasons, and the extensive support of styles is an important advantage of the LibreOffice family over commercial competitors. If you want to insert an additional style into the hierarchy in Writer
or Calc,
you will often use the option of deriving it from an example (a template).
Unfortunately, however, styles are not supported in Draw
.
But you can create formulas as templates for other formulas, which then shall use the same settings.
A remaining problem is that you need user code to retroactively set the attributes of such a template for existing formulas. Another one is how to get all the formulas even if nested in groups
===
General example (may need LibreOffice V7 or higher):
harmonizeFormulaShapesInDrawingsDiving.odg (75.1 KB)
Similar example for older versions of LibO and for OO.o, AOO:
harmonizeFormulaShapesInDrawingsDivingLegacy.odg (63.9 KB)
My example documents show how this can be done for all formulas in a Draw
document, even for deeply nested ones.
The question of how best to select a subset of existing formulas for reformatting is not covered.
Very unrealistic (joking example):
harmonizeFormulaShapesInDrawingsDivingEE.odg (115.6 KB)