# How to italicise text so the style is preserved when copied between docs?

In https://ask.libreoffice.org/en/questi... I describe the problem I suffer when I try to make variant editions of my books.

I suspect the source of the problem is that using Italic/Bold/Underline to change a style is not a toggling of that style, even though that's the apparentresult to the user. Perhaps as described here (in the context of headings only): https://bugs.documentfoundation.org/s...

I suspect that's what's happening to me, as the text that fails to keep its formatting seems to a small but random percentage. If it's just the text where I had ever changed the style more than once (via what looked to me like toggling), then that would be a plausible explanation of what I'm experiencing.

Given this issue, is there a recommended way to apply emphasis to text so it is preserved when you copy paragraphs (in my case, an entire manuscript) between documents with the same set of paragraph style names but different properties (in my case, a different font size)?

My guess is there may be two ways, both with bad usability:

1. Define an Emphasis character style, and then instead of a single keystroke (Ctrl-I) or button click (Italic), bring up the Manage styles window, choose Character Styles, then scroll until you find Emphasis, then Apply it to the selected text.
2. Use imperfect human memory to always remember to use Ctrl-M on any text you're about to format, before applying the desired format (e.g. Italics).

Anyway, I'm hoping my guesses are wrong, and there's a solution with good usability that I'm simply unaware of.

edit retag close merge delete

Sort by » oldest newest most voted

Keyboard shortcuts (Ctrl+I, B, U, …) and toolbar buttons (including those for list or alignment) belong in the direct formatting category. Understand direct formatting as any action trying to modify text outside styles.

LO Writer has a layered style model:

• at the lowest level, you have settings in Tools>Options various records; they can be considered as "user built-ins")
• then paragraph styles
• then character styles
• at the highest level, direct formatting

The higher level settings override the lower level settings.

Each layer can be changed with tools of the level, e.g. character style (re)application replaces character style but leaves the other layer attributes unchanged respectively for paragrap style and direct formatting).

Direct formatting has no name, meaning it is not related to any character style. Worse, every independent sequence of characters with a defined set of attributes constitutes another anonymous character style. Thus, two distant Ctrl+I'ed words correspond to 2 different direct formatting styles.

When you copy text from a location to another location or from a document to another document, the hierarchy is preserved. No problem with paragraph and character styles: they have a name and the definition in the target document will be used. However, direct formatting, having no name, goes with its definition and the source formatting is retained.

Being in the top layer, direct formatting if overlooked may lead to the conclusion that style update is bugged.

The only solution is to avoid direct formatting and exclusively work with styles. Since direct formatting is anonymous, it is very difficult to detect it. The only way is to select an area and Ctrl+M (clear direct formatting) and see if something changes, but this does not give 100% evidence (in case direct formatting was equal to style formatting). The wise behaviour is get rid of it with the mentioned command and restyle with character styles.

This creates inconvenience while typing unless you reconfigure LO Writer to transfer the keyboard shortcuts from direct formatting to character styles. I agree with you usability is not optimal. However your no. 1. point can be mitigated:

• either use Hierarchical view in the style sidepane, though Writer auto-expands or shrinks the tree (this is convenient for paragraph style, less for character styles which are more rarely hierarchically organised)
• or display only Used Styles: any document relies on a restricted number of styles; after some typing volume, this list of styles tends to settle to a rather short set

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

more

Hi Luke,

Given this issue, is there a recommended way to apply emphasis to text so it is preserved when you copy paragraphs (in my case, an entire manuscript) between documents with the same set of paragraph style names but different properties (in my case, a different font size)?

• If a style is already used in document A, then copied content from document B with that style, takes the formatting from document A.
• If you want to apply the formatting from document B: use the function to import styles. That works for Writer in any case.
• Still problems? Then it's - I expect - due to direct formatting.
1. Define an Emphasis character style, and then instead of a single keystroke (Ctrl-I) or button click (Italic), bring up the Manage styles window, choose Character Styles, then scroll until you find Emphasis, then Apply it to the selected text.
• I would assign a key stroke to a style.
1. Use imperfect human memory to always remember to use Ctrl-M on any text you're about to format, before applying the desired format (e.g. Italics).
• Train your memory to make it less imperfect ;)

Does that help? Ciao - Cor

more