How to apply Italic button to character style

I have created character style and name it “my_italic”.

I can assign Ctrl+I keyboard shortcut to “my_italic” using menu Tools | Customize | Keyboard tab | Category - Styles - Character; Function = “my_italic”; select Ctrl+I as Shortcut Keys and Assign button.

So now, I can select text and press Ctrl+I to apply current text “my_italic” style instead italic of direct editing.

This is great when I am typing, quick selection of word e.g. Ctrl+Shift+Left_Arrow and press Ctrl+i.

But sometimes I have a paragraph of text and I would just like to quickly select some portion of text and click on Italic button. But I don’t want to apply italic direct formatting, but instead to apply my character style “my_italic” to the Italic toolbar button. How to assign Italic toolbar button to assign my_italic character style?

I prefer to use character (and paragraph) styles on larger document, so if I want to change appearance of my_italic character style, I can quickly edit the style and whole large document is changes in second (instead of using direct formatting, when I would need few hours to manually change for example italic to italic+underline).

I advise you to use the Emphasis style supplied with LibreOffice.
This style is italic and you can change it as you wish.

  • You can customize your toolbars. and add a button of the style you want

4 Likes

Since you already have assigned Ctrl+I to your character style, why would you need a toolbar button? A toolbar button forces you to leave the keyboard to grasp the mouse and you come back to the keyboard after clicking. Since selection can also be done with the keyboard, you’ll be faster if you don’t leave it.

A method remark: don’t name your styles according to their visual effect. If you modify the style, the name may no longer be consistent. As an example, your my_italic may be changed to Roman+colour. Then is its name still relevant? Built-in styles are named after the intended significance. E.g. Emphasis is used to highlight an “important” word. From factory, this is italic but you are free to choose any other “decoration”.

2 Likes

This is already existing, IMO.


Display the toolbar Formatting (Styles) and you will find the EM button. For customizing the icon you can change it easily.
For selected texts: a single mouse click is enough effort.


For special needs you can format the user defined character style (named User Entry) for your purposes. I use it for character highlighting and changed the icon to a more significant one. In this case you also should alter your Default Document Template if you like to have the feature in new documents (based an Default Document Template).
To add other specific icons see @bantoniof’s significant answer.


For some reasons I set the Formatting (Styles) toolbar vertically to always have the choice of direct formatting and styles formatting (see screenshot).


2 Likes

@bantoniof, now I understand, steps should be:

  1. Select Styles
  2. Select my_italic style
  3. Move it to right side
  4. Click on Modify icon and change the icon to “I”
  5. Remove original “I” icon and problem solved.

Previously I thought I can click on “I” icon in right side and click Modify the actions from left side, but this was not working. Looks I misunderstood the UI workflow.

Thanks a lot.

I like to use my own styles for everything. I don’t want to battle the style inheritance etc. And if I create my own styles I can force myself to only use few of them, that makes large document pretty consistent. If on the other side I have plenty of styles to select, the document may look inconsistent (a lot more discipline involved).

In majority of time I have hands on keyboard and keyboard shortcuts are great, but some times I use mouse for e.g. selecting text e.g. multiple words and the words are not consecutive. Select first word in paragraph, press control and select fifth word itd and because I am already using mouse, it is just much quicker to click on toolbar icon vs. release mouse and start keyboard shortcut.

This is probably good practice, I agree, but I can always rename the style, afterwards.

I didn’t know toolbar could be added vertically to the UI. I never enabled this toolbar, because it would consume too much of my laptops space at the top of screen. Now I have added this toolbar to the left side (like in your picture).

Just an E button for me.
imagen

Version: 25.2.7.1

(X86_64) / LibreOffice Community
Build ID: 520(Build:1)
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: es-MX (en_US.UTF-8); UI: en-US
Calc: threaded