0

I'm writing a text where the variable I_{a,b,c}^{d,e,f} occurs a lot. It occurs as well in plain text as in mathematical environments. I would like ONE command, that can be used in both cases, something like

\newcommand{\Ioften}{$I_{a,b,c}^{d,e,f}$}

However this will only work, when I use it in plain text, not in the mathematical environment. That is I could use it now \Ioften, but not in the equation $3\cdot \Ioften$

  • 3
    If you must, you can use \ensuremath. Personally, I'd just define \Ioften without $ and insert them manually when writing inline math. – campa Dec 21 '17 at 16:15
  • @campa can you explain why it's not a good idea to use \ensuremath? To me this looks like a good idea – Jürg W. Spaak Dec 21 '17 at 16:20
  • 1
    In some (rare) circumstances it could break down. And the idea of markup is to clearly separate text and math contents. This question (and answers therein) discuss esthe issue a little bit. This being said, it is not bad per se: if it makes your life easier, use it. – campa Dec 21 '17 at 16:24

0 Answers0