Quantcast
Viewing all articles
Browse latest Browse all 186

Remove expression with matched braces from string

I am writing a LaTeX document where the custom command \chg{...} highlights changes in some color. Here I am, with a document of about 50 of those. Sure, one could just remove "\chg" everywhere, but after a long history of collaborative editing blocks {...{like this}} keep piling up.

Here is an example:

str = "We extracted \\chg{geometrical statistics \\sout{summary geometric data}} using {Wolfram Mathematica}$^\\text{\\textregistered}$ 11.2."

Could it be automatically adapted so that the output is:

We extracted geometrical statistics \sout{summary geometric data} using {Wolfram Mathematica}$^\text{\textregistered}$ 11.2.

Is there a way to remove \chg{...} but keep its arguments in place? This question shows how to retrieve "\chg{correct!}" from "finally \chg{correct!}", but I couldn't quite work out how to retrieve "finally correct!".


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>