0

For example I want to retain only the content inside \text so that

\[
\text{v} = \text{w}
\]

becomes

\[
v = w
\]

How does one do this if there are hundreds of instances of \text{..} and I want them all removed?

  • 1
    Many editors support this. In sublime text for example, you can select all instances of \text easily and remove them, next you can easily select what is in-between the curly braces and cut it, remove braces and paste it again. – AboAmmar May 1 '18 at 16:24
  • "..next you select what is in-between the curly braces and cut it, remove braces and paste it again". This is out of the question. Suppose there are hundreds of instances of \text...? – Quasar Supernova May 1 '18 at 16:25
  • Welcome to TeX.SX! – Bobyandbob May 1 '18 at 16:27
  • 1
    What is inside the \text? Only simple chars? Then some regex should work. – Ulrike Fischer May 1 '18 at 16:29
  • @QuasarSupernova - I mean what I said, be it tens or hundreds, it doesn't matter. Just ctrl+shift+m will select what is in-between the curly braces automatically. – AboAmmar May 1 '18 at 16:29
2

If you have such "bad" document where all instances of \text sequence would be removed then you can re-define \text macro simply:

\def\text#1{#1}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.