Writer: How to align a fraction with text

OK. That will give me some more time to organize.

Have you tried using a Math formula? You can control precisely the placement of all elements, eventhough it is a bit tedious.

OK.
Added the Alternative Fractions info to the solution above.
If this helps, please click the up arrow and the checkmark.

OK I have removed all of LO and then reinstalled just 5.4. That went well, I then added the Verajja font. If I add the ‘:afrc’ to the end of the font name I still do not get any fractions as I would like them. I am using Verajja Serif 18pt. I even tried creating a style called fractions and set the font there to Verajja Serif:afrc, still with no response. When typing is the fraction supposed to auto adjust or do I have to select it and then do something else?

If I add the ‘:afrc’

You should try :frac. If none of the options work, the font don’t support it.

I am not quite certain what you are trying to do, but I think this may be a possibility. Excuse me if I have misunderstood.

Are you trying to create superscript or subscript fractions? You can do this by defining a Character style and the FONT EFFECT tab allows you specify normal / subscript / superscript. You could define a character style called SUPERSCRIPT, for example.

You can also change the normal font to superscript (CTRL/SHIFT + p) or subscript (CTRL/SHIFT + b). (CTRL/SHIFT +X) resets the line.

Autocorrect also allows you to choose these characters (TOOLS > AUTOCORRECT > AUTOCORRECT OPTIONS) on my system to show the choice.
There are also a limited number of fractions available on some fonts. See INSERT > SPECIAL CHARACTER to find them.

Hi Peter. I am trying to create labels for mechanical tools. I am aware of the insert special character but that only has quarters etc. I need to write things like 17/64 in a more presentable manner. Which brings me back to where I started. I can create these fractions but cannot align them with the other text. Thus 1 1/8 finishes up with the one and the eighth on apparent different bases according to the line. To do this I am using two different font sizes, which is annoying and slow.

I’m not sure but OpenType fonts could be a solution. See here the following link’s thread:

Using the formula editor

As an alternative, you can use the formula editor (Math component of LO suite) to format your fraction. It does not require OpenType features and works with any font. And, not least, placement of all elements are under your control.

Insert>Object>Formula, then type the required formula, e.g.

image description

(made with Liberation Serif)

“Standard” font size is 12pt, consequently I shrinked the fraction 50% leading to size 6 which is applied to the bracketed block containing the fraction as 7 over 8. Since I found the fraction had not enough weight I added bold which applies to everything at its right.

I used grave accent and tilde spacing elements to experiment with separation between whole part and fraction. You can also use a string of space characters surrounded by quotation marks (a space character is slightly shorter than a tilde space).

Adapt to your case. You can even make it a “template” instead of copy/paste model if you have many labels to create.

EDIT 2018-03-13

Making your custom formula is quite easy. The procedure is described in the Math Guide at end of Chapte 1, Formula library section. Short summary:

  1. Create your formula in your current document as:

    <?> " " bold size 21 { <?> over <?> }

  2. Return to the Writer document, your formula is displayed with empty square placeholders. Right-click on it and choose Save a copy as from the contectual menu.

  3. Navigate to a convenient directory, give it a name and select .odf (LO Math formula) or .mml (MathML) format and Save.

You can now erase the formula or customize it for your needs.

Using this new model is straightforward:

  1. Put the cursor where you want to insert another similar formula.
  2. Insert>OLE Object (not Formula)
  3. In the dialog, check Create from file and click Browse (or similar label – I’m not presently under the English UI and I translate “logically”) to navigate to the directory where you stored your formula, select the formula file and push Open.
  4. Push OK, the formula is inserted.
  5. Double-click on the formula and use F4 to quickly jump from <?> placeholder to the next one.

You know the rest of the story.

If this answer helped you, please accept it by clicking the check mark :heavy_check_mark: to the left and, karma permitting, upvote it. If this resolves your problem, close the question, that will help other people with the same question.

Making this a template sounds to be onb the right lines, however I cannot find any help that shows how to do that without creating a new document. Suggestions please?
I have experimented and found to keep the fractions on the same line position as any text I need to include a whole number next to it. If none were present anyway then a dummy number as seen in this example works.
size 60 " " bold size 21 { 17 over 64}
I still need to figure out how to get this into a template though.

Hi LibreTraining
I am new here and still finding my way around the site.
I have installed that verajja font on my maching but it does not make any difference.
I have tried adding the ‘:afrc’ to the end of the font but again it makes no difference. my fractions still look like this 17/64.

What version of LibreOffice are you using?
The OpenType features were added in LO v5.3.
In one of your other threads you were going to try LO v5.1 - that will not work.

I tried adding 5.4 and installed it but did not get rid of 4.3 first. I now seem to have a mixture of both but which leans toward defaulting to 4.3. I am on Linux centos 6.9. How do I get rid of the older version. Do I have to erase both and then download 5.4 again and if so what happens to my documents etc?
When I look at the applications → office menu I get all the LO apps showing the 5.4 next to them and also the apps without the 5.4. I thought if I selected the 5.4 app I would get that one

OK I have removed all of LO and then reinstalled just 5.4. That went well, I then added the Verajja font. If I add the ‘:afrc’ to the end of the font name I still do not get any fractions as I would like them. I am using Verajja Serif 18pt. I even tried creating a style called fractions and set the font there to Verajja Serif:afrc, still with no response. When typing is the fraction supposed to auto adjust or do I have to select it and then do something else?

Just saw this - I get no noticed from this thing.

Yes, it should happen automatically as you type.

Hi Libre Training
Thanks for the reply. I have a screen shot of the results on my machine but cannot see how to put it on here. Please let me know. I have the font installed and added the ‘:afrc’ but nothing happens when i type the numbers which should result in a fraction. Is there another way you can assist with this please? As a matter of interest the usual 1/2, 1/4 do convert to the old type fractions.

The common ones like 1/2, 1/3, 1/4, 1/8, 2/3, 3/4, 3/8, etc. are actually replaced by AutoCorrect.
Those can get in the way if you are trying to create OpenType stacked fractions (afrc).
You may want to delete those out of AutoCorrect (or turn off).
Tools > AutoCorrect > AutoCorrect Options

You cannot attach screenshots to comments, but you can to your original Q or A above.
That is once you have enough Karma - you may not.
But you can post a link to an image on Imgur.com or ?

Hi Libre Training
I have now registered on Imgur and added the screen shot there.

You can see I have the font set correctly and also I have added that afrc to the end of the font.
What you see is what happened as I typed it.
I also added the about pop up to let you see the version I am running.
All help apprectiated

OK. I am downloading v5.4.6.2 now to test.
I will test that and see if I have any issues.
If it works for me, I will upload a document which I have tested as working properly.
May not be back before Monday (my time US West coast).

Tested OK on LO 5.4.6.2.
Attached a working document which I created in LO 5.4.6.2.
See: OpenType Test - Alternative Fractions.odt
At bottom of my answer post.