For Programmers: Free Programming Magazines  


Home > Archive > AWK > October 2004 > remove several \textit{...} (LaTeX)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author remove several \textit{...} (LaTeX)
D.Stender

2004-10-15, 3:55 am

Hello!

I would like to remove several \textit{...} in a LaTeX-document but want
to keep what's in the brackets every time.

Thanks for help,
D.Stender (Germany)
Ulrich M. Schwarz

2004-10-15, 8:55 am

uzstzm@uni-bonn.de (D.Stender) writes:

> Hello!
>
> I would like to remove several \textit{...} in a LaTeX-document but want
> to keep what's in the brackets every time.


search for: "\textit", replace with ""?
(OffT: sed -e 's/\textit//g' or somesuch, or any editor)

I can't think of a situation where \textit can/should be used and
extra {} would be harmful.

Ulrich
--
"I, personally, like multiple mouse buttons, but
want only one of them on my mouse." -- Jed Davis
William James

2004-10-15, 3:55 pm

BEGIN { target = "\\\\textit{[^}]*}" }

{ while ( match($0, target) ) {
replacement = substr($0,RSTART,RLENGTH)
gsub(/.*{|}/, "", replacement)
sub( target, replacement )
}
print
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com