Ask Your Question

How to use Math Variables amidst text in Writer?

asked 2016-01-12 13:15:26 +0100

Zeca gravatar image

updated 2016-09-06 23:42:17 +0100

Hi everyone,

I have been struggling to find a way of inserting small math objects (Inset>Object>Formula) in the middle of the text. I can do it, but a large space appears after and before the math object that ruins the document.

For example, when I present a new equation I have to explain in the text what the variables, and I want them to be the exact same format as they appear in the Equation box above. The problem is that they have a massive gap before and after the math object. How do I remove this gap?

Many thanks, Zeca

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted

answered 2016-09-06 23:06:26 +0100

ajlittoz gravatar image

updated 2016-09-07 08:16:39 +0100

I answer only now because the question crept to the top active questions due to an update.

Don't know if you are still interested in a simple solution, but I had exactly the same concern and this is how I solved it (without dmath extension). Remember that an equation is just an object like any others.

  1. Insert your variable (or any equation) as a formula.
  2. Once you return to your main stream (in Writer after leaving Math), right-click the variable (or equation) and select Object... from the pop-up menu.
  3. Click on the Wrap tab. You can now set the spacing around the object. Since the variable is considered a character in the paragrah, you can adjust only the left and right spacings. Set them to 0 to get the effect of a "standard" glyph so that appended punctuations will have the traditional appearance.
  4. Click OK.

You are done.

If you find this answer useful, please tick its check mark at left and, why not, upvote it.

EDIT: Answer to @Zeca 's question in the comment below

Yes, this spacing can be made default. Formulas live in a frame with a style of their own: Formula. You can access this frame style in the Format->Styles and Formatting panel (or F11). Click on the middle (third) icon in the toolbar (frame styles). One of the styles is Formula. Right-click on it and select Modify....

If you need several different "styles" for your formulas (spacing, background colour, borders, ...), create them with a right-click and New.... To style the formula, select it and double click on the required frame style name.

Doing so (multiple formula styles), you can take advantage of the "hierarchical styles" feature: modification of a property in the "master" style automatically propagates down in the hierarchy if it is not overridden in a lower style.

edit flag offensive delete link more


Thank you so much! It works like a charm. Is there a way of setting this Wrap settings to all Math objects subsequently created?

Zeca gravatar imageZeca ( 2016-09-06 23:55:53 +0100 )edit

Once again, thanks for your edit. This solves the problem for inline equations.

Maybe a good feature request would be to set the Formula wrap spacing to zero by default? This would make the life of most users much easier

Zeca gravatar imageZeca ( 2016-09-07 11:14:59 +0100 )edit

answered 2016-01-12 18:04:56 +0100

Lupp gravatar image

updated 2016-01-12 18:06:15 +0100

Attach an example demonstrating the issue, please. ( I will see for sufficient "karma".)

If you want "to explain in the text ... and I want them to be the exact same format as they appear in the Equation box" this will not work, I am afraid. The formula editor is using its chosen fonts, sizes, character styles ... and will not communicate with the surrounding text about appearance.

edit flag offensive delete link more

answered 2016-01-13 11:59:45 +0100

Zeca gravatar image

updated 2016-09-06 19:52:02 +0100


Over time I found out that the only way to do it so far (version 5.2) is to install the dmath extension, then type the equation you want then select it and choose InsertFormula. After this process, you will be able to remove the extra space before and after the inline equation.

edit flag offensive delete link more


I did not actually expect to be able to help. Just wanted to make sure understanding you correctly. I do not know remedy in your case. I simply do not find the gaps huge and ugly in the same way as you obviously do. My own discontent with 'Math' under one major aspect you find described under this topic..No progress to date. Math seems orphaned.

Lupp gravatar imageLupp ( 2016-01-13 15:07:42 +0100 )edit

My first perception of your question was you wanted to get the identical look when using a variable (e.g.) as part of the explaining text. This was what I called "impossible" first. (It may not be in a copmpletely strict sense).

Lupp gravatar imageLupp ( 2016-01-13 15:14:17 +0100 )edit

'' I simply do not find the gaps huge and ugly in the same way as you obviously do. '' Really? What about the gap between the t=9 and the fullstop? Is this acceptable in any book/article publication? This is s an issue that clearly needs sorting out!
Also I have seen your issue about the scalable brackets and I must agree with you, they don't look good. t's a shame that math does not see any measurable improvements over the years. When money is donated to the Document Foundation, the doners

Zeca gravatar imageZeca ( 2016-01-18 17:33:20 +0100 )edit

should be able to choose which Libreoffice package they want to improve!

Zeca gravatar imageZeca ( 2016-01-18 17:38:18 +0100 )edit

I did not feel obliged to excuse the bad spacing. It will not be acceptable under "high quality layout" standards. My use of 'Math' was mainly in teaching context. Requirements with this respect not extremely high.
Your dedicated donations will not work, I am afraid. My offer was not even commented by anybody.

Lupp gravatar imageLupp ( 2016-01-18 22:55:22 +0100 )edit

''Your dedicated donations will not work, I am afraid. My offer was not even commented by anybody.'' Which offer have you made?

Zeca gravatar imageZeca ( 2016-01-19 11:57:27 +0100 )edit

@Zeca : I thought you had visited this topic. My "answer" there is containing the offer.

Lupp gravatar imageLupp ( 2016-01-19 12:49:02 +0100 )edit

Sorry I cannot find it

Zeca gravatar imageZeca ( 2016-01-19 15:06:38 +0100 )edit

My answer is at the bottom of the mentioned topic presently. The announcement I am talking of starts with "Since I am still interested in promoting free software, ..." (seventh line, third paragraph of the post).

Lupp gravatar imageLupp ( 2016-01-19 15:50:23 +0100 )edit

Hey Lupp,

check out dmath addon for LO:

It was suggested by petermau (

This adds a lot of functionality to 'Math' and also seems to solve the problem with the inline equations we have discussed here

Zeca gravatar imageZeca ( 2016-06-20 12:47:19 +0100 )edit

answered 2016-09-06 22:44:49 +0100

RGB-es gravatar image

There are two things you need to change in order to reduce or even eliminate the space before and after a Math object.

  • Inside a Math object, go to Format → Spacing and select Border from the drop down menu Category. Now reduce the Left and Right values → press the Default button so any new Math object will use these values as default. NOTE: old objects will not be affected!
  • Open the Style and formatting editor and select Frame styles → right click on Formula → Modify → Wrap tab → reduce the Left and Right values. Now save that document as your default template.


edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-01-12 13:15:26 +0100

Seen: 1,187 times

Last updated: Sep 07 '16