Since LO Writer is meant to be a style-based word processor, we should be able to use <emphasis> and <strong> as easily as italic and bold. But italic and bold are easier to use because the keys to invoke them toggle whereas keys assigned for styles do not. Suppose, for example, I assign Ctrl-I to "<emphasis>." If while typing I type Ctrl-I, the following text will be emphasized, as expected. But, contrary to expectations, typing Ctrl-I will not return me to non-emphasized text. The same with selected text: Ctrl-I will emphasize it, but a second Ctrl-I will not remove the emphasis. I suggest that the keys assigned to these styles should toggle, so that (using the same example) Ctrl-I works with <emphasis> the same way it works with italic.
Applied char styles don't really toggle, rather we have .uno:DefaultCharStyle "No Character Style" to remove an applied Style from an active selection. You can see this in use on the alternate View -> Toolbars 'Formatting (Styles)' toolbar, the "A" icon with tooltip "Remove applied character style". Likewise on the Styles menu. It can also be assigned by Tools -> Customize... dialog as a Keyboard or Context menu shortcut. Just note that it is held with other 'Style' -> 'Character' category functions. Guess there could be benefit to implementing a style toggle (apply|remove) for the current TB buttons for users of the 'Formatting (Styles)' and if that provided a hook for keyboard, menu customization even better. Throwing it in the UX-advise pool.
The approach of using "remove applied character style," if not ideal, seems like at least something. But "remove applied character style" has no effect on <emphasis> and <strong>. (When I made a word emphatic or strong and then clicked the "A" icon, nothing happened.) And as I said, even if this approach would work it would be less than ideal. For italic I can toggle with Ctrl-I and Ctrl+!. For <emphasis> I'd need something like, say, Ctrl-I, Ctrl-R. Uninuitive. Let's see what the UX people say.
Turning the .uno:StyleApply?<styles> command into toggle functions sounds reasonable. Any blocker, Maxim?
I wonder what came of this.
(In reply to Heiko Tietze from comment #3) > Turning the .uno:StyleApply?<styles> command into toggle functions sounds > reasonable. Not so sure anymore. The current implementation (toolbar 'Formatting (Styles)') works as a toggle between No CS, Emphasis, Strong Emphasis, and Source Text. We usually do not apply any attributes but overwrite or add on top of a stack, see for example the recently discussed bug 169135.
Okay, I see that “no character style” is an available command to assign to a key. So, yes, that does allow me to use, say, Alt-I for “emphasis,” Alt-B for “strong,” and Alt-N for “no character style.” And when I do assign such keyboard shortcuts, the tooltips for the“A,” “E,” and “S” icons on the styles toolbar will show me the keys assigned. That’s helpful. So that does solve my personal need: I can use the keyboard to apply a style or remove it. And I can do this in a way that’s easy enough to remember. This isn’t the way most users would be familiar with. It doesn’t work the same way as applying and removing the common attributes “italic” and “bold.” It does take a small bit of setup. But it works, and works well. V. Stuart Foote told me as much in Comment 1, and I don’t know why at the time it didn’t seem to work for me. But it does. So my thanks to all. Since LO Writer is meant to be a style-based word processor, we might want to make more obvious to the user how he or she can employ <emphasis> and <strong> as easily as italic and bold. Perhaps a note in the documentation. Perhaps assigning default keyboard shortcuts for <emphasis> and <strong>. But in any case: My problem is solved, and again my thanks to you all. ------------------- Interestingly—and I don’t know whether it’s a problem: Suppose I’ve used the Styles toolbar to assign, say, <emphasis> to a word. When I highlight the word and look under the menu “Format→Text,” I will see that the box for “Italic” is ticked. And unticking that box will visually restore the text to roman. Clicking the “I” icon on the formatting toolbar (or using the Ctrl-I keyboard shortcut) will have the same effect. Nonetheless, the “E” icon on the toolbar will still be grey, and the Styles dialogue will show that the text still bears the <emphasis> style. Or suppose I’ve used Ctrl-I to make a word italic. Clicking the “S” styles icon will apply <strong emphasis> and make the word bold italic. Clicking “A” will remove the style and make the world normal italic again, and clicking “A” again will have no further effect. But clicking “E” and then “A” will restore the word to roman, removing both the style and the italic. Okay, I see that “no character style” is an available command to assign to a key. So, yes, that does allow me to use, say, Alt-I for “emphasis,” Alt-B for “strong,” and Alt-N for “no character style.” And when I do assign such keyboard shortcuts, the tooltips for the“A,” “E,” and “S” icons on the styles toolbar will show me the keys assigned. That’s helpful. So that does solve my personal need: I can use the keyboard to apply a style or remove it. And I can do this in a way that’s easy enough to remember. This isn’t the way most users would be familiar with. It doesn’t work the same way as applying and removing the common attributes “italic” and “bold.” It does take a small bit of setup. But it works, and works well. V. Stuart Foote told me as much in Comment 1, and I don’t know why at the time it didn’t seem to work for me. But it does. So my thanks to all. Since LO Writer is meant to be a style-based word processor, we might want to make more obvious to the user how he or she can employ <emphasis> and <strong> as easily as italic and bold. Perhaps a note in the documentation. Perhaps assigning default keyboard shortcuts for <emphasis> and <strong>. But in any case: My problem is solved, and again my thanks to you all. ------------------- Interestingly—and I don’t know whether it’s a problem: Suppose I’ve used the Styles toolbar to assign, say, <emphasis> to a word. When I highlight the word and look under the menu “Format→Text,” I will see that the box for “Italic” is ticked. And unticking that box will visually restore the text to roman. Clicking the “I” icon on the formatting toolbar (or using the Ctrl-I keyboard shortcut) will have the same effect. Nonetheless, the “E” icon on the toolbar will still be grey, and the Styles dialogue will show that the text still bears the <emphasis> style. Or suppose I’ve used Ctrl-I to make a word italic. Clicking the “S” styles icon will apply <strong emphasis> and make the word bold italic. Clicking “A” will remove the style and make the world normal italic again, and clicking “A” again will have no further effect. But clicking “E” and then “A” will restore the word to roman, removing both the style and the italic. I don’t know what effect these actions have on the underlying coding of the document. But if the underlying coding is inconsistent, giving us a style where we don’t expect it, or vice versa, this could cause issues, especially when a document is transferred to, say, a page-layout program. No? Thank you again.
My apologies for the duplicated text in the above comment. If I were to see a way to delete it and start over I would. But. . . my apologies.
(In reply to j.a.swami from comment #6) > Clicking the “I” icon ... Nonetheless, the “E” icon on the toolbar > will still be grey, and the Styles dialogue will show that the > text still bears the <emphasis> style. Text is formatted with a hierarchy: PS > PDF > CS > DF. Meaning if the paragraph style (PS) defines the font weight as bold you can apply regular via direct paragraph formatting (PDF), and/or character style (CS) or direct formatting (DF). If you some text is CS'ed Emphasis your click on Italic DF overwrites it as regular. The Styles Inspector at the sidebar is supposed to provide insights into the actual setting. Let's resolve the request as WF. CS is not DF, CS options do not combine (I + B <> E & S), to reset CS we provide a default with no alterations to the default (resp. the paragraph properties).
Yes, rightly resolved, I think. Thank you, Heiko.