Apply custom character format with toolbar button

LOWriter v7.2.5.2 on LInux

To automate, I created a custom character format but failed trying to create a toolbar button for it. My goal is to combine a frequently-used font and highlight colour combination without ploughing through the format options in four clicks or switching colour palettes.

I found the following in documentation:
How to apply a Character style to a selected text:

  • Select the text.
  • Double-click the desired character style in the Styles window.

I couldn’t find anything under Menu/Tools/Customize that lets me select a custom character format to apply a keyboard shortcut or toolbar button for it; the lists appear to be only default controls.

As a workaround I added the “Show the Styles Sidebar (F11)” control to the Formatting toolbar and renamed the custom format so it appears at the top of the styles list, but only F11 will toggle the sidebar view. View/Styles and the button I made for it do nothing if the sidebar is already in view.

Aside: I realize I can type the first two characters and punch return to apply the searched character format, but that requires switching to keyboard and yet another select if the last used list isn’t character styles; my goal is to create a mouse-driven one-click interface for a single format application.

I’m assuming user error but I’ll be surprised if toggling the styles window is the only way to reach a custom character format. Am I misunderstanding how the customize interface works or perhaps the scope of what it can do?

Related: I thought docked window “AutoHide” sounded interesting to test, but I couldn’t find an interface for if and it doesn’t appear in help documents beyond a mention in showing and docking. I can dock manually and toggle the view with F11, but I couldn’t find a way for it to automatically go away when I return focus to the document.

If I look at Customise Toolbar for Formatting (styles) toolbar, I see there is an non-visible icon for character style User Entry. If you aren’t planning on using this character style in your document, you could modify it to your desired formatting and tick the box to make it visible.

Regarding the entries in the Style pane, if you change the view to Applied Styles then there will be only the ones used in the document visible.

If you want to have more than one readily accessible character style icon then I suspect that you might have to attach others to a macro and assign an icon to each macro. That is outside my experience in LO.

Interesting, thank you for pointing out that important detail I was ignorant of.

Your approach makes sense, not worrying about all styles because I would rarely choose off-the-shelf, then my applied choices appear in the Applied list. Unfortunately, the document doesn’t save the last-used list up front. If fussy I’d leave up multiple floating side bars; none of this is ideal and I want to avoid sidebars altogether, and you’ve shown me the way. I haven’t reached the macro desire level yet.


  1. The Customize search field searches only the visible level of Available Commands list so I’d need to know where I’m going and dig down manually, making a search tool moot even if I know the name of what I’m looking for. The User Entry item is found at Styles/Character/User Entry and can be added to any Target listed, then modified within the Target list. In the end, I put my button beside the font/highlight colour buttons in the Formatting toolbar.

  2. Styles is the last item on the Category list and freaks out my pull-down display when I mouse to it, and window resize cursors don’t function to work around that. I should probably search bug reports for that; outside the scope of my question. It’s notable that the keyboard customization dialogue dispenses with the pull-down while a simlar process, as recommended by ajlittoz below.

  3. Oddities inside Customize/Target list mean no undo, can’t remove icon after application, can’t stow modified User Entry to another location, multiple User Entry items all react the same. Adding one icon applies to every User Entry item, and custom User Entry names aren’t reflected in the character format list. An example pictured; Both my Thing 1/Thing 2 buttons apply only one format as modified for User Entry, showing only a single “User Entry” style. I didn’t pursue this further. style6

  4. The User Entry button stays with the application but the format attached to it does not, like any manually created style. I’m sure it’s possible to put a style into application defaults but it requires a test to see if the button is still associated; outside this scope, for now.

  5. A once-associated format can’t be removed from a document. I can apply a User Entry style then undo but that style remains on the list even though none is in use; also, style manual delete is grey. Might be useful for a template but annoying and confusing.

  6. Icing on the cake is that I can’t search for only manual formatting of choice. Not this issue but it was part of my process; the search dialogue is the most broken and convoluted interface I’ve ever used and the failings are far too laborious to go into details, far outside this scope.

In the end, I can put up one character format button and use it in one oft-edited document–not part of my original question–so this is a solution. All the borked stuff along the way and the design decisions that went into the way things work are lamentable.

I missed Styles in the Category selection although I was looking for it. I would say that LeroyG’s answer is correct for this too. You can have your own distinctively named character styles on the toolbar and, if you create the icons, you can have your own icon for each style. You would want to use a template to re-use the styles.

EarnestAl! I have missed or misunderstood a critical detail and I’m seeing the intended approach with fresh eyes. Your solution and my summary are still correct, just unimaginative. I just want to flesh out what you wrote:

Unlike the spirit of the questioner or LeroyG in 43721, I don’t wish to remove defaults or overwrite them.

I can select any style in the docked style list, right-select “New…” from it, then rename, inherit, or modify details at will, even delete it. Then my new custom style appears in the Customize styles available list, then it can be pushed over to the target. Logically, I make a custom format then put it somewhere, but heading for the Customize menu item first mistakenly leads down an unnecessary path of creating something handicapped then trying to modify it. This means “User Entry” is irrelevant, while possible. I’m more comfortable with the button name matching the style name so I don’t confuse things in the future. I even made a custom icon this time around, a 24x24 PNG.
Please let me know if you understand how to idenfify an unused format and delete it because I still can’t get “User Entry” off the list.

I typically work with the Style list set to Applied Styles (not Hierarchical) so that in the Styles pane I don’t see built-in styles that are not used in my document. User Entry is a built-in style, probably for forms.
You can change the the User Entry style back to original, Liberation Mono Regular. If you want to remove the style from a word you can click the word then apply No Character Style (also on Formatting toolbar)

If you want to remove the User icon from the toolbar, just right-click on the toolbar and click Visible Buttons > User to untick it. Or go through the Customise menu and untick it there.

Unless there is a character style that you wish to have a variant of, you are probably best to to just create a word and give it the attributes you want then click the Styles Actions icon and select New style from selection, then just give your style a name, it will inherit from No Character Style, i.e. take all other aspects of its style from the paragraph style settings.

This deserves more feedback:

  • "User Entry" style is gone now, evidently because not in use, but I never found the trigger that made it stay in the list, in hindsight maybe a hidden formatting mark finally overwritten and unnoticed because of the live update state
  • styles sidebar doesn’t update live properly, intermittently, so anything I test is unreliable and “User Entry” was probably selectable while non-functional, confusingly
  • searching formats intermittent, format details not found in back-to-back tests
  • “Styles Actions” menu items seem available only in the sidebar, so not in “Format/Character…” nor context-select Character/Character…" nor in the Customize lists, all three of which seem like obvious places to have those items
  • incredibly, paragraph “New Style from Selection” is in the format bar, has a confusingly similar icon to “Styles Actions,” and responds to character selections as if a paragraph selection
  • also incredibly, the Styles button pops up the sidebar but it doesn’t toggle it back, so it’s easier to mouse-target the window shade than switch to the keyboard for F11

So, frustration notwithstanding, I got what I wanted: the custom format, the button, and the matching style list. Will try the “Load Styles from Template” function when the need arises.

IMHO the best you can do is to attach a keyboard shortcut to your character style. This results in maximum typing speed because you don’t need to grab the mouse to press a button then come back to the keyboard.

You create a new keyboard shortcut for a character style as:

  • Tools>Customize, Keyboard tab
  • In Category list, scroll down to Styles item and expand it
  • Click on Character
  • Function now lists all available character styles; select the desired one
  • Choose an available key combination in Shortcut keys
  • Press Modify
  • OK when you’re done with all shortcuts

Thank you, understood, but not what I’m after, good here for future readers I suppose.

User Entry is in there but with all the same shortcomings like truncated search, function not transferable to new documents, window width but not height, etc.

Another weird interface, showing everything and disregarding utliity in a shotgun approach, but probably expedient for programmers on a first pass. At least it’s more presentable.