I used \st{} with soul package. Now, what is the best way to delete the text inside all occurrences of \st{}?
Asked
Active
Viewed 2,915 times
1
user199
- 37
- 1
- 5
1 Answers
1
You can simply redefine \st to consume its argument
\renewcommand\st[1]{}
And there are two additional details that could be covered.
Depending on your rigor with striking out spaces, the above definition can leave two consecutive spaces between words (so irregular spacing). The more advanced definition is
\makeatletter
\renewcommand\st[1]{\@bsphack\@esphack}
\makeatother
That's not a guarantee of fixed spacing though. If you have test \st{this}. you will get a space before the period.
The other detail is that this is single-shot revision control. If you are going to go through cycles of revision you may want different strike-through commands, as with
\usepackage{soul}
\makeatletter
\let\stC=\textst
\newcommand\stB[1]{\@bsphack\@esphack}
\renewcommand\st[1]{\@bsphack\@esphack}
\makeatother
so that \stC will do strike-through for revision C, but \stB and \st will disappear. Note that \textst is the underlying command name for \st.
Donald Arseneau
- 6,079
\stcommand? I.e.,\renewcommand\st[1]{}. – Donald Arseneau May 23 '20 at 09:15