Styles in OnlyOffice other than paragraphs

Good afternoon,

I’m a long-time user of LibreOffice (since StarOffice actually) and am learning OnlyOffice.

Today I was trying to define a new style, “definition”, to be applied only to a sequence of selected characters and not an entire paragraph (in my example, the characters selected would be bolded, italicized and the colour changed).

However, I only seem to be able to create paragraph styles, and searching both generally and in these forums has not yielded a solution.

Can anyone help, please? Thanks in advance.

1 Like

Hello @Bonzini
Please provide us with details. Do I understand it right that you are looking for a way to set different style (from style selection tab) to selected characters only? If it’s possible please provide us with screenshots or videofile where you are describing the desired scenario.
Also, if it’s possible, please point us to similar feature in other editor.

Hello @Alexandre,

You understand me correctly. For example, I might want to create a style for including program code fragments within regular paragraph text.

I’ve demonstrated how to do this with the screen shot below, from LibreOffice:

update 2022-08-02

Looking at my response above I feel it needs a bit more explaining… the panel on the right is the “styles” panel. You can see I’ve selected the second tab from the left, the first being paragraph styling, the second being character styling. I right-clicked on the Source Text style and selected modify, which brought up the Character Style: Source Text subwindow. There I’ve changed the font from Liberation Mono to Courier New, the font colour to a darkish green and the highlighting to a pale green.

I really like to use character styles when possible as they are 1) semantic and 2) easily changeable throughout the document just by modifying the style.

One thing in your question - “from style selection tab” - I guess this is where one should change it; maybe it’s necessary to have something similar to the tabs on the LIbreOffice styles pane to look at paragraph, character, page etc styles?

Anyway, thanks for your attention to this! The more I use OnlyOffice the more I like it.

Sorry for bothering you. I’m trying to reproduce your desired scenario step-by-step in LibreOffice to understand the feature. Could you please record a videofile where you are reproducing desired situation?

Good day Alexandre,

I replied to this message from my email but I don’t see that reply here, so I’m responding again in case for some reason it did not go through. I’m guessing that video files are rejected?

Attached is a link to a video showing how I go about applying character-level styling in LibreOffice.

My apologies in advance if you’ve seen this twice, and also if you haven’t seen it at all!

LibreOffice Writer video demonstrating character level styling

Hello @Bonzini
Thank you for provided video. As I see LibreOffice separates these 2 types of styles (for text and for paragraphs). Our editor has different behavior, you can use styles for both types at the same time.
I have prepared a short demonstration, please take a look at it: Monosnap

@Alexandre thanks for looking into this. Unfortunately it doesn’t seem to work that way on my OnlyOffice desktop install on Ubuntu 22.04.

Let’s say I decide I want a new character (not paragraph) style, call it “Definition”. I want it to be dark blue letters on a cyan background.

So first I highlight the text (in the middle of a paragraph), change letters to dark blue and background to cyan.

Then I right-click on the modified text which pops up a context menu, at the bottom of which is “Formatting as Style >”. I click that, which pops up a window titled “Create New Style”.

THe first field in that window is “Title”. I enter “Definition” there.

THe next field is “Next paragraph style”. But wait, I don’t want this to affect the styling of the next paragraph! Maybe I pick “Normal”?

Then I click on OK and the entire paragraph is changed to blue text, but not on a cyan background.

Something seems wrong here…

Then I click on OK and the entire paragraph is changed to blue text, but not on a cyan background.

We are checking the situation, I will notify you when we have something to share.

Thanks @Alexandre . If there is anything I can do (demo with video for example) please let me know.

We are checking the situation at the moment. I will contact you if we need a help from your side, thank you!

Hello @Alexandre, any news on this problem?

Thanks in advance!

Hello @Bonzini
We are still working on it, I will update this thread when we get any news.

We have checked described scenario, this is expected behavior. The same behavior persists in MS Office. I’m not sure that we are going to change it.

Hello. The behavior described by @Bonzini is reproduced when editing documents in OnlyOffice, which have been previously created in MS Office.

By contrast, when editing a file created in OnlyOffice, the formatting of the text is applied correctly, without changing the formatting of the entire paragraph.

Currently the same problem described in this thread happens to me, when trying to edit a document previously created and managed in MS Office. I already verified that in documents created in the OnlyOffice suite the behavior of the format is fine.

@crazydocs thank you for figuring that out! I tried following the approach with a new doc and found it “fixed”… nice to know I wasn’t off the mark entirely.

Hello @crazydocs and @Bonzini
Would you mind providing us with a test file and detailed steps to reproduce the situation? Additionally, please clarify the exact version of MS Word where test file was created. We are going to check if there is any difference in behavior between editors.


In my case at least, I think there may be a communication error rather than a bug.

What I am looking for is what MS Word calls “character style”. For example, this article How to Create Character-Specific Styles in Microsoft Word | Webucator shows how this was managed in some earlier version of MS Word.

The specific need is to create a style that applies only to selected text, not to the paragraph.

As far as I can tell, styles in OnlyOffice only apply to paragraphs. At least, I cannot find a way to create a new “character style”.

An example: I might choose to apply a particular style to code snippets that occur in text (like variable names for example). I would prefer to define a style “Snippet” that would let me change the characteristics of all snippets in my text to match some other look and feel, just by updating the “Snippet” character style.

Am I being clear?

For emphasis, the only styling I can find in OnlyOffice applies at the paragraph level ONLY.

Hello @Bonzini

Thanks for the info. We’ll check it and I’ll let you know the result.

Unfortunately, we do not have similar feature implemented yet since this is quite complicated mechanism. Your request on this feature was added to the existing enhancement suggestion to add such ‘style manager’ per se.

You will be notified once it is implemented and introduces publicly.

Ok, thanks @Constantine. It’s a really cool feature to have, as it allows easy restyling of inline text (for example, code snippets). But I really appreciate all the work your team does for us all and I’m more than happy to keep going without it in the meantime.