Search code examples
replaceattributeslibreoffice-writer

lilbreoffice writer: How to change underline to bold?


Sir:

I use libreoffice writer and am wondering if it is possible to change all italic to bold?

There are bird, dog and carrot.

to

There are bird, dog and carrot.

in a markup language rule, change all [B]text[/B] to [I]text[/I] throughout the document.

I also want to change other attributes (super/subscript). Editing rich text file is not as easy as I thought.

Does anybody know how?

thank you in advance


Solution

  • Using AltSearch, select to search for Bold from the Properties menu. In the replacement, specify \A{CharPosture=2}\A{CharWeight=0}, either by typing that in or by selecting those properties after pressing Pick Properties.

    It is possible to do this without AltSearch by using normal Search & Replace to find the attributes and then selecting all results. Then close the dialog and manually change the formatting, which will apply to all selections (hopefully there aren't too many or it may be slow!). Detailed steps are at https://ask.libreoffice.org/t/how-do-i-replace-underlined-text-with-italics/45195/2.

    It may also be worth using character styles instead of direct formatting so that you can instantly change to a different type of formatting instead of requiring search and replace. For bold and italics alone it may not be worth it, but it sounds like your document may have more complexity than that.