I have a file containing much TeX mark-up, like this:
The fish ate 20\percent more food than the bear.
The fish ate \the\number\percent more food than the bear.
I want to delete that text which is a TeX code, like \percent and replace it with a space.
- The mark-up always begins with a
\. - The mark-up always is followed by a space,
{, or another\. - The
\is never used in other situations in the file.
How can I delete the appearance of these items, which begin with \ and afterwards are followed by a space, {, or another \?
You can use this perl command:
OR using sed:
OR if -E is not supported then:
OUTPUT