I have a Tex file that I need to edit while somehow keeping the original words and sentences highlighted. To do this, I am going to cross out the part of the original text that I replace with my own words. The command \st{TEXT}
in the package soul
seems to do the job. I'm looking for a way to define a macro in TeXstudio such that by selecting the text, the cross out command encapsulate the text, i.e. \st{THE_SELECTED_TEXT}
. I am not familiar with macro programming in TeXstudio.
2 Answers
I have found another quite simple solution.
Say, if you have just typed $AB$
, and then you want to surround AB
by \overline{}
. You can select the text AB
and then directly type "ov"(you may, of course, find that the word AB is deleted, but don't worry!) and press
"Tab", then you can get what you want.
The macro:
\st
is known for it. If you select text and then type\st
and auto-complete it TeXstudio automatically places the selected text as an argument to\st
. The only problem is that\st
may not properly recognized by TeXstudio. Thesoul.cwl
(the auto-complete configuration file) lists it as a parameter-less macro so you might either change that or use your ownsoul-custom.cwl
file or actually simply ad\st{arg}
as a macro. Also, TeXstudio scans\newcommand
and `\providecommand´ (dummy) entries.soul.cwl
in the configuration of TeXstudio, but it didn't help me. Thanks for your comment. It solved my problem