0

I want to create a command which works like this:

Writing:

\w1o2

Should yield:

W^{1,2}o(I)

I am aware of the parameters use for \newcommand, that would work like this:

\newcommand{\wo}[2]{W^{#1,#2}(I)}

And this would be used by writing \wo12 (For example).

But I specifically want to intercalate letters between commands.

Thanks.

  • The problem is that \wo won't be recognized as \w{o} without much ado – user31729 Apr 9 '16 at 13:16
1

Not sure what you want.

\newcommand*\w[3]{W^{#1,#3}#2(I)}
\w1o2
  • That works for the example provided, but I do not get why it does not when I write, for example, \wo12. Also, it does not work if I leave blank one of the parameters, for example if I write \w12. – D1X Apr 9 '16 at 14:50
  • 1
    Rewrite and clarify in your question, please. It's not clear what you want. What should \wo12 output? And \w12? how does the command know when to stop? If you write $(\w12)$ how does \w know that ) is not its third argument? – Manuel Apr 9 '16 at 15:57
  • @D1X: Any news on this? – user31729 Apr 16 '16 at 16:08

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.