Results 1 to 3 of 3
Hi all,
I have a latex file and I want to replace all occurences of \eng{<utf8 characters>} with <utf8 characters>, that is remove the tex command with its delimiters \eng{} ...
- 11-13-2009 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 3
Removing latex command delimiters with sed
Hi all,
I have a latex file and I want to replace all occurences of \eng{<utf8 characters>} with <utf8 characters>, that is remove the tex command with its delimiters \eng{} which is around some text. I tried
sed 's/\eng{[:alpha:]*}/&/g' input.tex > output.tex
but does not work at all while
sed 's/\eng//g' input.tex > output.tex
does only remove the \eng{, leaving the trailing } after the text. Any help would be appreciated!
filimon
- 11-13-2009 #2Linux Newbie
- Join Date
- Mar 2009
- Posts
- 228
sed 's/\\eng{\(.*\)}/\1/'
- 11-13-2009 #3Just Joined!
- Join Date
- Nov 2009
- Posts
- 3
Almost there, I need to change this so that it stops at the first } and does this for multiple \eng{...} in a line. My first change was
sed 's/\\eng{\(.*\)}/\1/g'
but this doesn't do it completely either. How to make sed get the first } instead of the last one in the line? Thanks,
filimon


Reply With Quote