Sample Header Ad - 728x90

Remove a specific latex command from the text AND closing bracket behind it

3 votes
3 answers
728 views
How to remove a specific latex command from the text AND close bracket behind it, but keep the text inside the brackets? The command in the following example to remove is \edit{}. \edit{ and } should be removed, whereas `` should be left unchanged. Please fill free to suggest SED, AWK, Perl or whatever will do the job senseless example: We \edit{Introduce a} model for analyzing \emph{data} from various experimental designs, \edit{such as paired or \url{http://www/} longitudinal; as was done 1984 by NN \cite{mycitation} and by NNN \cite{mycitation2}}. Note that there might be one or more latex commands in the form \command{smth} inside \edit{} statements. \command{smth} should be left as it was Output: We Introduce a model for analyzing \emph{data} from various experimental designs, such as paired or \url{http://www/} longitudinal; as was done 1984 by NN \cite{mycitation} and by NNN \cite{mycitation2}. PS. I am introducing a lot of small edits to my text file. I want those edits to be highlighted, so my collaborator can see them. But afterward, I would like to remove all highlights and send the text to a reviewer. The question was originally asked at https://unix.stackexchange.com/questions/373662/awk-sed-remove-a-specific-latex-command-from-the-text-and-closing-bracket-behind . But for example there was too soft
Asked by den2042 (351 rep)
Jun 27, 2017, 09:42 PM
Last activity: Feb 7, 2023, 06:13 PM