[Solved] Search italic and replace with \textit{}

Discuss the word processor

[Solved] Search italic and replace with \textit{}

Postby bruno321 » Tue Mar 29, 2011 4:18 pm

Hi. I'm trying to do the following: replace any italic text hello with \textit{hello}.

I went through the help of search and replace but can't seem to get it working.

Thank you for any help and sorry for the newbie question.
Last edited by bruno321 on Tue Mar 29, 2011 11:50 pm, edited 1 time in total.
OOo 3.3.0 on Arch Linux
bruno321
 
Posts: 2
Joined: Tue Mar 29, 2011 4:14 pm

Re: Search italic and replace with \textit{}

Postby andyroberts1234 » Tue Mar 29, 2011 5:09 pm

Try Ctrl-F, type hello in the find box, click more options, select format, go to font tab choose italic. Click OK. Type \textit{hello} in the replace box.
Click replace or replace all. Worked for me.
Andy

OOO 3.3.0 / Windows 7 64-bit
andyroberts1234
 
Posts: 75
Joined: Fri Feb 11, 2011 2:29 pm

Re: Search italic and replace with \textit{}

Postby bruno321 » Tue Mar 29, 2011 5:16 pm

Sorry, I did not explain myself correctly. I meant replace *any* italic text with \textit{} around it (for example, hello with \textit{hello}).

I managed to do it with http://extensions.services.openoffice.org/node/525 but it would be nice to find a solution which doesn't need external stuff.
OOo 3.3.0 on Arch Linux
bruno321
 
Posts: 2
Joined: Tue Mar 29, 2011 4:14 pm

Re: Search italic and replace with \textit{}

Postby MrProgrammer » Tue Mar 29, 2011 6:24 pm

Hi, and welcome to the forum.

Edit > Find & Replace, More options, Regular expressions, Search for .+, Format, Font, Typeface, Italic, OK, Replace with \\textit{&}, (optionally Format, Font, Typeface, Regular), Replace All, clear Regular Expressions, Close. Note two \ before textit.

There are no doubt procedures that you can perform with the extension which are difficult or impossible with the standard find/replace dialog even if this isn't one of them. A great many people have found it invaluable.

If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3860
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Search italic and replace with \textit{}

Postby RoryOF » Tue Mar 29, 2011 7:24 pm

MrProgrammer wrote:There are no doubt procedures that you can perform with the extension which are difficult or impossible with the standard find/replace dialog even if this isn't one of them. A great many people have found it invaluable.


This extension, to save people looking it up, is Alternative dialog Find & Replace for Writer, often referred to as AltSearch. Very strongly recommended for fancy searching and replacing!
Apache OpenOffice 4.1.8 on Xubuntu 20.04.1 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32006
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Search italic and replace with \textit{}

Postby Yuri_Futanari » Mon Nov 16, 2015 4:43 am

Okay 2 questions here everybody,

1, do you need to write " .+ Format [whevever value equals 'format'], Font 'Times New Roman', Typeface '12pt', 'Italic'," ....?

And 2, if so, what is/are my 'format' option(s)?
Openoffice 4.1.2 on Windows 7 Ulitmate
Yuri_Futanari
 
Posts: 18
Joined: Thu Nov 12, 2015 7:39 am

Re: [Solved] Search italic and replace with \textit{}

Postby FJCC » Mon Nov 16, 2015 5:34 am

In the Search For box just enter .+. In the More Options section of the dialog, select Regular Expressions and then click the Format button and on the Font tab set the typeface to Italic.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7879
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: [Solved] Search italic and replace with \textit{}

Postby Yuri_Futanari » Mon Nov 16, 2015 8:12 pm

I installed the extension you listed above because it was easier for me because it allowed me to just input specifically what I needed to input without my needing to add excess parameters.

Thank you for listing the extension! (^_^)/
Openoffice 4.1.2 on Windows 7 Ulitmate
Yuri_Futanari
 
Posts: 18
Joined: Thu Nov 12, 2015 7:39 am


Return to Writer

Who is online

Users browsing this forum: Bill and 29 guests