newcommand with intercalated arguments
up vote
0
down vote
favorite
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.
macros
add a comment |
up vote
0
down vote
favorite
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.
macros
The problem is thatwo
won't be recognized asw{o}
without much ado
– Christian Hupfer
Apr 9 '16 at 13:16
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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.
macros
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.
macros
macros
edited 12 mins ago
siracusa
4,68511128
4,68511128
asked Apr 9 '16 at 12:56
D1X
1748
1748
The problem is thatwo
won't be recognized asw{o}
without much ado
– Christian Hupfer
Apr 9 '16 at 13:16
add a comment |
The problem is thatwo
won't be recognized asw{o}
without much ado
– Christian Hupfer
Apr 9 '16 at 13:16
The problem is that
wo
won't be recognized as w{o}
without much ado– Christian Hupfer
Apr 9 '16 at 13:16
The problem is that
wo
won't be recognized as w{o}
without much ado– Christian Hupfer
Apr 9 '16 at 13:16
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
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 writew12
.
– D1X
Apr 9 '16 at 14:50
1
Rewrite and clarify in your question, please. It's not clear what you want. What shouldwo12
output? Andw12
? how does the command know when to stop? If you write$(w12)$
how doesw
know that)
is not its third argument?
– Manuel
Apr 9 '16 at 15:57
@D1X: Any news on this?
– Christian Hupfer
Apr 16 '16 at 16:08
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
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 writew12
.
– D1X
Apr 9 '16 at 14:50
1
Rewrite and clarify in your question, please. It's not clear what you want. What shouldwo12
output? Andw12
? how does the command know when to stop? If you write$(w12)$
how doesw
know that)
is not its third argument?
– Manuel
Apr 9 '16 at 15:57
@D1X: Any news on this?
– Christian Hupfer
Apr 16 '16 at 16:08
add a comment |
up vote
1
down vote
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 writew12
.
– D1X
Apr 9 '16 at 14:50
1
Rewrite and clarify in your question, please. It's not clear what you want. What shouldwo12
output? Andw12
? how does the command know when to stop? If you write$(w12)$
how doesw
know that)
is not its third argument?
– Manuel
Apr 9 '16 at 15:57
@D1X: Any news on this?
– Christian Hupfer
Apr 16 '16 at 16:08
add a comment |
up vote
1
down vote
up vote
1
down vote
Not sure what you want.
newcommand*w[3]{W^{#1,#3}#2(I)}
w1o2
Not sure what you want.
newcommand*w[3]{W^{#1,#3}#2(I)}
w1o2
answered Apr 9 '16 at 13:33
Manuel
21.1k845105
21.1k845105
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 writew12
.
– D1X
Apr 9 '16 at 14:50
1
Rewrite and clarify in your question, please. It's not clear what you want. What shouldwo12
output? Andw12
? how does the command know when to stop? If you write$(w12)$
how doesw
know that)
is not its third argument?
– Manuel
Apr 9 '16 at 15:57
@D1X: Any news on this?
– Christian Hupfer
Apr 16 '16 at 16:08
add a comment |
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 writew12
.
– D1X
Apr 9 '16 at 14:50
1
Rewrite and clarify in your question, please. It's not clear what you want. What shouldwo12
output? Andw12
? how does the command know when to stop? If you write$(w12)$
how doesw
know that)
is not its third argument?
– Manuel
Apr 9 '16 at 15:57
@D1X: Any news on this?
– Christian Hupfer
Apr 16 '16 at 16:08
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
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
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
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?
– Christian Hupfer
Apr 16 '16 at 16:08
@D1X: Any news on this?
– Christian Hupfer
Apr 16 '16 at 16:08
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f303356%2fnewcommand-with-intercalated-arguments%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The problem is that
wo
won't be recognized asw{o}
without much ado– Christian Hupfer
Apr 9 '16 at 13:16