Make paired delimiter with prefix for Re and Im
up vote
2
down vote
favorite
I'm trying to make a new command for something like this:
operatorname{Re}leftlbracenum{1+2i}rightrbrace
Because I'm using the mathtools
package already I tried to do something like this:
(And I have to undefine the previous Re
and Im
commands, because they are ugly and this command should be obviously called Re
and Im
.)
letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}
This will work, but will also spit put many errors. Like: Missing { inserted. end{align}
and so on.
Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace
and rbrace
. And I tried something like this:
letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}
But this will produce:
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
Inserting ensuremath
or something like that doesn't help much.
Last try:
letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #
It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.
math-mode macros mathtools
add a comment |
up vote
2
down vote
favorite
I'm trying to make a new command for something like this:
operatorname{Re}leftlbracenum{1+2i}rightrbrace
Because I'm using the mathtools
package already I tried to do something like this:
(And I have to undefine the previous Re
and Im
commands, because they are ugly and this command should be obviously called Re
and Im
.)
letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}
This will work, but will also spit put many errors. Like: Missing { inserted. end{align}
and so on.
Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace
and rbrace
. And I tried something like this:
letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}
But this will produce:
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
Inserting ensuremath
or something like that doesn't help much.
Last try:
letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #
It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.
math-mode macros mathtools
why do you wantleft
andright
with 1+2i? you would get better spacing with(1+2i)
than withleft(1+2iright)
– David Carlisle
Nov 28 at 22:04
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm trying to make a new command for something like this:
operatorname{Re}leftlbracenum{1+2i}rightrbrace
Because I'm using the mathtools
package already I tried to do something like this:
(And I have to undefine the previous Re
and Im
commands, because they are ugly and this command should be obviously called Re
and Im
.)
letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}
This will work, but will also spit put many errors. Like: Missing { inserted. end{align}
and so on.
Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace
and rbrace
. And I tried something like this:
letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}
But this will produce:
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
Inserting ensuremath
or something like that doesn't help much.
Last try:
letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #
It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.
math-mode macros mathtools
I'm trying to make a new command for something like this:
operatorname{Re}leftlbracenum{1+2i}rightrbrace
Because I'm using the mathtools
package already I tried to do something like this:
(And I have to undefine the previous Re
and Im
commands, because they are ugly and this command should be obviously called Re
and Im
.)
letReundefined
letImundefined
DeclarePairedDelimiterRe{operatorname{Re}lbrace}{rbrace}
DeclarePairedDelimiterIm{operatorname{Im}lbrace}{rbrace}
This will work, but will also spit put many errors. Like: Missing { inserted. end{align}
and so on.
Then I thought: Yes, this is probably, because the font can not scale (and shouldn't), like the lbrace
and rbrace
. And I tried something like this:
letReundefined
letImundefined
DeclarePairedDelimiterbraces{lbrace}{rbrace}
newcommand{Re}{1}{operatorname{Re}braces*{#1}}
newcommand{Im}{1}{operatorname{Im}braces*{#1}}
But this will produce:
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
Inserting ensuremath
or something like that doesn't help much.
Last try:
letReundefined
letImundefined
newcommand{Re}{1}{operatorname{Re}leftlbrace #1 rightrbrace}
newcommand{Im}{1}{operatorname{Im}leftlbrace #1 rightrbrace}
Missing $ inserted. newcommand{Re}{1}{operatorname{Re}
Missing begin{document}. newcommand{Re}{1}{operatorname{Re}
You can't use `macro parameter character #' in math mode. ...nd{Re}{1}{operatorname{Re}leftlbrace #
It can't be this hard to make something like this work, or can it? I really don't know what I should try next, or what am I even doing wrong.
math-mode macros mathtools
math-mode macros mathtools
asked Nov 28 at 22:00
Darkproduct
184
184
why do you wantleft
andright
with 1+2i? you would get better spacing with(1+2i)
than withleft(1+2iright)
– David Carlisle
Nov 28 at 22:04
add a comment |
why do you wantleft
andright
with 1+2i? you would get better spacing with(1+2i)
than withleft(1+2iright)
– David Carlisle
Nov 28 at 22:04
why do you want
left
and right
with 1+2i? you would get better spacing with (1+2i)
than with left(1+2iright)
– David Carlisle
Nov 28 at 22:04
why do you want
left
and right
with 1+2i? you would get better spacing with (1+2i)
than with left(1+2iright)
– David Carlisle
Nov 28 at 22:04
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
You have the incorrect syntax for newcommand
.
newcommand{Re}{1}
should be
newcommand{Re}[1]
add a comment |
up vote
5
down vote
You can use the DeclarePairedDelimiterXPP
from mathtools
. It will define Re
and Im
commands, which have a star version (adds a pair of implicit left
right
in front of the delimiters), but they also accept an optional argument among big
, Big
, bigg
and Bigg
, which adds a pair oof implicit bigl
bigr
, &c.
documentclass[10pt]{article}
usepackage{mathtools} %
letReundefined
letImundefined
DeclarePairedDelimiterXPPRe[1]{operatorname{Re}}{lbrace}{rbrace}{}{#1}
DeclarePairedDelimiterXPPIm[1]{operatorname{Im}}{lbrace}{rbrace}{}{#1}
begin{document}
[ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%
end{document}
Wouldn't operator name be better for Re and Im, then2Re
looks right again. Re and Im are math operators after all
– daleif
Nov 29 at 8:32
1
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
You have the incorrect syntax for newcommand
.
newcommand{Re}{1}
should be
newcommand{Re}[1]
add a comment |
up vote
5
down vote
accepted
You have the incorrect syntax for newcommand
.
newcommand{Re}{1}
should be
newcommand{Re}[1]
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
You have the incorrect syntax for newcommand
.
newcommand{Re}{1}
should be
newcommand{Re}[1]
You have the incorrect syntax for newcommand
.
newcommand{Re}{1}
should be
newcommand{Re}[1]
answered Nov 28 at 22:08
David Carlisle
479k3811121847
479k3811121847
add a comment |
add a comment |
up vote
5
down vote
You can use the DeclarePairedDelimiterXPP
from mathtools
. It will define Re
and Im
commands, which have a star version (adds a pair of implicit left
right
in front of the delimiters), but they also accept an optional argument among big
, Big
, bigg
and Bigg
, which adds a pair oof implicit bigl
bigr
, &c.
documentclass[10pt]{article}
usepackage{mathtools} %
letReundefined
letImundefined
DeclarePairedDelimiterXPPRe[1]{operatorname{Re}}{lbrace}{rbrace}{}{#1}
DeclarePairedDelimiterXPPIm[1]{operatorname{Im}}{lbrace}{rbrace}{}{#1}
begin{document}
[ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%
end{document}
Wouldn't operator name be better for Re and Im, then2Re
looks right again. Re and Im are math operators after all
– daleif
Nov 29 at 8:32
1
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
add a comment |
up vote
5
down vote
You can use the DeclarePairedDelimiterXPP
from mathtools
. It will define Re
and Im
commands, which have a star version (adds a pair of implicit left
right
in front of the delimiters), but they also accept an optional argument among big
, Big
, bigg
and Bigg
, which adds a pair oof implicit bigl
bigr
, &c.
documentclass[10pt]{article}
usepackage{mathtools} %
letReundefined
letImundefined
DeclarePairedDelimiterXPPRe[1]{operatorname{Re}}{lbrace}{rbrace}{}{#1}
DeclarePairedDelimiterXPPIm[1]{operatorname{Im}}{lbrace}{rbrace}{}{#1}
begin{document}
[ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%
end{document}
Wouldn't operator name be better for Re and Im, then2Re
looks right again. Re and Im are math operators after all
– daleif
Nov 29 at 8:32
1
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
add a comment |
up vote
5
down vote
up vote
5
down vote
You can use the DeclarePairedDelimiterXPP
from mathtools
. It will define Re
and Im
commands, which have a star version (adds a pair of implicit left
right
in front of the delimiters), but they also accept an optional argument among big
, Big
, bigg
and Bigg
, which adds a pair oof implicit bigl
bigr
, &c.
documentclass[10pt]{article}
usepackage{mathtools} %
letReundefined
letImundefined
DeclarePairedDelimiterXPPRe[1]{operatorname{Re}}{lbrace}{rbrace}{}{#1}
DeclarePairedDelimiterXPPIm[1]{operatorname{Im}}{lbrace}{rbrace}{}{#1}
begin{document}
[ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%
end{document}
You can use the DeclarePairedDelimiterXPP
from mathtools
. It will define Re
and Im
commands, which have a star version (adds a pair of implicit left
right
in front of the delimiters), but they also accept an optional argument among big
, Big
, bigg
and Bigg
, which adds a pair oof implicit bigl
bigr
, &c.
documentclass[10pt]{article}
usepackage{mathtools} %
letReundefined
letImundefined
DeclarePairedDelimiterXPPRe[1]{operatorname{Re}}{lbrace}{rbrace}{}{#1}
DeclarePairedDelimiterXPPIm[1]{operatorname{Im}}{lbrace}{rbrace}{}{#1}
begin{document}
[ Re*{frac{z-1}{z + 1}}qquad Im[Big]{frac{z-1}{z + 1}} ]%
end{document}
edited Nov 29 at 9:07
answered Nov 28 at 22:36
Bernard
164k769192
164k769192
Wouldn't operator name be better for Re and Im, then2Re
looks right again. Re and Im are math operators after all
– daleif
Nov 29 at 8:32
1
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
add a comment |
Wouldn't operator name be better for Re and Im, then2Re
looks right again. Re and Im are math operators after all
– daleif
Nov 29 at 8:32
1
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
Wouldn't operator name be better for Re and Im, then
2Re
looks right again. Re and Im are math operators after all– daleif
Nov 29 at 8:32
Wouldn't operator name be better for Re and Im, then
2Re
looks right again. Re and Im are math operators after all– daleif
Nov 29 at 8:32
1
1
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
@daleif: You're right. I didn't think of testing this. I've fixed the code. Thanks!
– Bernard
Nov 29 at 9:10
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%2f462264%2fmake-paired-delimiter-with-prefix-for-re-and-im%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
why do you want
left
andright
with 1+2i? you would get better spacing with(1+2i)
than withleft(1+2iright)
– David Carlisle
Nov 28 at 22:04