Ask Your Question

How do I reduce the amount of space on the left and right of a formula? [closed]

asked 2014-02-25 14:10:54 +0200

Kaz gravatar image

updated 2015-09-12 01:34:29 +0200

Alex Kemp gravatar image

LibreOffice, Writer + Math Windows XP

I've created formulas which are inline within the text. However, the presence of space on the left and right of the formula mean the appearance of the text + formulas just does not look right.

There are two places where space to the left and right of a formula can be reduced. The first is in the in the Formula Frame Style which I've been able to reduce.

The second is the spacing within the formula within the Borders category. I have not been able to reduce this. See the attached screen shot. It shows the default values which I could not alter.

image description

Any help appreciated. Or is this a bug?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Kaz
close date 2015-04-21 11:35:33.600831

1 Answer

Sort by » oldest newest most voted

answered 2014-02-25 15:06:34 +0200

Regina gravatar image

updated 2014-02-26 14:50:39 +0200

What do you mean with "could not alter"? From comments: The dialog is currently broken, see

When you click into the field, you should be able to delete the values and enter the number 0. But be aware, that the setting is only applied to the current formula. If you click on the button "Default", the default is changed, so that all new formulas will get the zero border too. But there exist no kind of style, so that existing formulas will change automatically. You have to change each existing formula manually. To make this more easy, I use a macro to reduce the borders of all formulas in a document. Of cause, you have to adapt the macro, when you only want to reduce left and right border, the macro reduces top and bottom border too.

sub SetBorderMarginToZero dim oCurrentController as variant: oCurrentController = ThisComponent.getCurrentController() dim oDoc as variant: oDoc=ThisComponent if not(oCurrentController.supportsService("")) then msgbox("Macro works only in text documents.") exit sub end if dim oModelTextDocument as variant: oModelTextDocument = oCurrentController.Model dim oEmbeddedObjects as variant: oEmbeddedObjects = oModelTextDocument.EmbeddedObjects dim nIndex as long dim nEndIndex as long: nEndIndex = oEmbeddedObjects.Count-1 dim oEmbeddedObject as variant: rem like green handle status dim oModel as variant: rem like edit status dim oXCOEO as variant: rem oExtendedControlOverEmbeddedObject for nIndex=0 to nEndIndex oEmbeddedObject = oEmbeddedObjects.getByIndex(nIndex) oModel = oEmbeddedObject.Model: rem might be empty; css.comp.math.FormulaDocument if Not(isEmpty(oModel)) then if oModel.supportsService("") then rem It is a formula object. oModel.LeftMargin = 0 oModel.RightMargin = 0 oModel.TopMargin = 0 oModel.BottomMargin = 0 oXCOEO = oEmbeddedObject.ExtendedControlOverEmbeddedObject oXCOEO.update() end if end if next nIndex end sub

edit flag offensive delete link more



Thanks for your response.

When you ask above "What do you mean with "could not alter"?", I mean exactly that.

I would put the cursor into the 'Left' field and change it to 0. When I moved the cursor to the 'Right' field to change that value to 0, the value in the 'Left' field would revert to what is shown on the screen shot above. I could not make the values in the 'Left' and 'Right' fields stay 0.

Thanks for macro.

Kaz gravatar imageKaz ( 2014-02-26 00:39:41 +0200 )edit

You found a bug. I can confirm the wrong behavior for LO4.3(dev) and LO4.2.1.1. It was OK in LO4.1. Please report the bug. [The macro still works, so it is a workaround for you.]

Regina gravatar imageRegina ( 2014-02-26 08:52:59 +0200 )edit

Question Tools

1 follower


Asked: 2014-02-25 14:10:54 +0200

Seen: 667 times

Last updated: Feb 26 '14