How to make { and } automatically have left and rightIs it ever bad to use left and right?Automatic left and...
How is character development a major role in the plot of a story
Is it ok to put a subplot to a story that is never meant to contribute to the development of the main plot?
What does "Marchentalender" on the front of a postcard mean?
Leading and Suffering Numbers
Is it possible to change original filename of an exe?
Terminology about G- simplicial complexes
What are these (utility?) boxes at the side of the house?
What is a subpixel in Super Mario Bros, and how does it relate to wall clipping?
How does an ARM MCU run faster than the external crystal?
What are the problems in teaching guitar via Skype?
Should I use n only, b only, bg, bgn, or gn?
SQL Server (JOIN) all from first with NULLs from 2nd
1960s sci-fi novella with a character who is treated as invisible by being ignored
How were these pictures of spacecraft wind tunnel testing taken?
What are the benefits of cryosleep?
What is the difference between nullifying your vote and not going to vote at all?
Mother abusing my finances
Is there an explanation for Austria's Freedom Party virtually retaining its vote share despite recent scandal?
Is floating in space similar to falling under gravity?
Restoring order in a deck of playing cards
Apparent Ring of Craters on the Moon
Can a Beholder use rays in melee range?
Compact Mechanical Energy Source
How do Russian speakers idiomatically express the idea of "Ce n’est pas donné à tout le monde de ..." in French?
How to make { and } automatically have left and right
Is it ever bad to use left and right?Automatic left and right commandsHow to make left<overrightarrow{b}right> look good?acm template left and right gives errorCan I make LyX automatically use 'smart' parentheses [left( right)] in math mode?Where are left and right defined?Automatically size the brackets by left and rightleft and right brackets way too huge!How to correctly set functions with `left(` and `right)`?Blank space with left[ and right]Environment left| right| and left( right) not working properly with fourier package
Desired behavior
{
and }
should turn into left{
and right{
.
Attempt 1
edef{{left{}
edef}{right}}
Error message
TeX capacity exceeded, sorry [input stack size=5000].
font@name ->
OT1/cmr/m/n/10
l.16 edef{{left{
}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Attempt 2
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Result
Error message
Missing delimiter (. inserted).
<to be read again>
{
l.7 ${
}$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
! Missing delimiter (. inserted).
<to be read again>
}
l.7 ${}
$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
Attempt 3
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Output
Related, working solutions
Doing this for langle
and rangle
works just fine:
edeflangle{leftlangle}
edefrangle{rightrangle}
Even doing this for (
and )
is a bit more complicated, but works:
begingroup
catcode`(active
xdef({leftstring(}
catcode`)active
xdef){rightstring)}
endgroup
mathcode`(="8000
mathcode`)="8000
macros brackets
add a comment |
Desired behavior
{
and }
should turn into left{
and right{
.
Attempt 1
edef{{left{}
edef}{right}}
Error message
TeX capacity exceeded, sorry [input stack size=5000].
font@name ->
OT1/cmr/m/n/10
l.16 edef{{left{
}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Attempt 2
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Result
Error message
Missing delimiter (. inserted).
<to be read again>
{
l.7 ${
}$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
! Missing delimiter (. inserted).
<to be read again>
}
l.7 ${}
$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
Attempt 3
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Output
Related, working solutions
Doing this for langle
and rangle
works just fine:
edeflangle{leftlangle}
edefrangle{rightrangle}
Even doing this for (
and )
is a bit more complicated, but works:
begingroup
catcode`(active
xdef({leftstring(}
catcode`)active
xdef){rightstring)}
endgroup
mathcode`(="8000
mathcode`)="8000
macros brackets
1
Of course this can be done, but it's not really a good idea. See Is it ever bad to use left and right?.
– barbara beeton
8 hours ago
1
You could useDeclarePairedDelimiter
frommathtools
to definebraced{{x_i}^2}
.
– Davislor
5 hours ago
@Davislor True. It's still messier than just{x_i^2}
, IMO.
– Solomon Ucko
4 hours ago
1
@SolomonUcko I would strongly advise against redefining standard TeX syntax to mean something different. First, it makes the code impossible to read because the syntax means something different from what anyone reading it thinks it does. Second, any code you copy-and-paste to a new document or a new template will silently break. Third, you disable the ability to control the sizing of your braces if you want to.
– Davislor
3 hours ago
add a comment |
Desired behavior
{
and }
should turn into left{
and right{
.
Attempt 1
edef{{left{}
edef}{right}}
Error message
TeX capacity exceeded, sorry [input stack size=5000].
font@name ->
OT1/cmr/m/n/10
l.16 edef{{left{
}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Attempt 2
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Result
Error message
Missing delimiter (. inserted).
<to be read again>
{
l.7 ${
}$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
! Missing delimiter (. inserted).
<to be read again>
}
l.7 ${}
$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
Attempt 3
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Output
Related, working solutions
Doing this for langle
and rangle
works just fine:
edeflangle{leftlangle}
edefrangle{rightrangle}
Even doing this for (
and )
is a bit more complicated, but works:
begingroup
catcode`(active
xdef({leftstring(}
catcode`)active
xdef){rightstring)}
endgroup
mathcode`(="8000
mathcode`)="8000
macros brackets
Desired behavior
{
and }
should turn into left{
and right{
.
Attempt 1
edef{{left{}
edef}{right}}
Error message
TeX capacity exceeded, sorry [input stack size=5000].
font@name ->
OT1/cmr/m/n/10
l.16 edef{{left{
}
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Attempt 2
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Result
Error message
Missing delimiter (. inserted).
<to be read again>
{
l.7 ${
}$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
! Missing delimiter (. inserted).
<to be read again>
}
l.7 ${}
$
I was expecting to see something like `(' or `{' or
`}' here. If you typed, e.g., `{' instead of `{', you
should probably delete the `{' by typing `1' now, so that
braces don't get unbalanced. Otherwise just proceed.
Acceptable delimiters are characters whose delcode is
nonnegative, or you can use `delimiter <delimiter code>'.
Attempt 3
documentclass{standalone}
edef{{leftstring{}
edef}{rightstring}}
begin{document}
${}$
end{document}
Output
Related, working solutions
Doing this for langle
and rangle
works just fine:
edeflangle{leftlangle}
edefrangle{rightrangle}
Even doing this for (
and )
is a bit more complicated, but works:
begingroup
catcode`(active
xdef({leftstring(}
catcode`)active
xdef){rightstring)}
endgroup
mathcode`(="8000
mathcode`)="8000
macros brackets
macros brackets
asked 8 hours ago
Solomon UckoSolomon Ucko
125111
125111
1
Of course this can be done, but it's not really a good idea. See Is it ever bad to use left and right?.
– barbara beeton
8 hours ago
1
You could useDeclarePairedDelimiter
frommathtools
to definebraced{{x_i}^2}
.
– Davislor
5 hours ago
@Davislor True. It's still messier than just{x_i^2}
, IMO.
– Solomon Ucko
4 hours ago
1
@SolomonUcko I would strongly advise against redefining standard TeX syntax to mean something different. First, it makes the code impossible to read because the syntax means something different from what anyone reading it thinks it does. Second, any code you copy-and-paste to a new document or a new template will silently break. Third, you disable the ability to control the sizing of your braces if you want to.
– Davislor
3 hours ago
add a comment |
1
Of course this can be done, but it's not really a good idea. See Is it ever bad to use left and right?.
– barbara beeton
8 hours ago
1
You could useDeclarePairedDelimiter
frommathtools
to definebraced{{x_i}^2}
.
– Davislor
5 hours ago
@Davislor True. It's still messier than just{x_i^2}
, IMO.
– Solomon Ucko
4 hours ago
1
@SolomonUcko I would strongly advise against redefining standard TeX syntax to mean something different. First, it makes the code impossible to read because the syntax means something different from what anyone reading it thinks it does. Second, any code you copy-and-paste to a new document or a new template will silently break. Third, you disable the ability to control the sizing of your braces if you want to.
– Davislor
3 hours ago
1
1
Of course this can be done, but it's not really a good idea. See Is it ever bad to use left and right?.
– barbara beeton
8 hours ago
Of course this can be done, but it's not really a good idea. See Is it ever bad to use left and right?.
– barbara beeton
8 hours ago
1
1
You could use
DeclarePairedDelimiter
from mathtools
to define braced{{x_i}^2}
.– Davislor
5 hours ago
You could use
DeclarePairedDelimiter
from mathtools
to define braced{{x_i}^2}
.– Davislor
5 hours ago
@Davislor True. It's still messier than just
{x_i^2}
, IMO.– Solomon Ucko
4 hours ago
@Davislor True. It's still messier than just
{x_i^2}
, IMO.– Solomon Ucko
4 hours ago
1
1
@SolomonUcko I would strongly advise against redefining standard TeX syntax to mean something different. First, it makes the code impossible to read because the syntax means something different from what anyone reading it thinks it does. Second, any code you copy-and-paste to a new document or a new template will silently break. Third, you disable the ability to control the sizing of your braces if you want to.
– Davislor
3 hours ago
@SolomonUcko I would strongly advise against redefining standard TeX syntax to mean something different. First, it makes the code impossible to read because the syntax means something different from what anyone reading it thinks it does. Second, any code you copy-and-paste to a new document or a new template will silently break. Third, you disable the ability to control the sizing of your braces if you want to.
– Davislor
3 hours ago
add a comment |
1 Answer
1
active
oldest
votes
The usual trick is to let
the old command to an "orig" version and use it in the definition of a changed command:
letleftbraceOrig={
letrightbraceOrig=}
def{{leftleftbraceOrig}
def}{rightrightbraceOrig}
Result:
begin{equation}
{int_{-infty}^infty frac{e^{-x^2}}{2} dx }
end{equation}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f492904%2fhow-to-make-and-automatically-have-left-and-right%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The usual trick is to let
the old command to an "orig" version and use it in the definition of a changed command:
letleftbraceOrig={
letrightbraceOrig=}
def{{leftleftbraceOrig}
def}{rightrightbraceOrig}
Result:
begin{equation}
{int_{-infty}^infty frac{e^{-x^2}}{2} dx }
end{equation}
add a comment |
The usual trick is to let
the old command to an "orig" version and use it in the definition of a changed command:
letleftbraceOrig={
letrightbraceOrig=}
def{{leftleftbraceOrig}
def}{rightrightbraceOrig}
Result:
begin{equation}
{int_{-infty}^infty frac{e^{-x^2}}{2} dx }
end{equation}
add a comment |
The usual trick is to let
the old command to an "orig" version and use it in the definition of a changed command:
letleftbraceOrig={
letrightbraceOrig=}
def{{leftleftbraceOrig}
def}{rightrightbraceOrig}
Result:
begin{equation}
{int_{-infty}^infty frac{e^{-x^2}}{2} dx }
end{equation}
The usual trick is to let
the old command to an "orig" version and use it in the definition of a changed command:
letleftbraceOrig={
letrightbraceOrig=}
def{{leftleftbraceOrig}
def}{rightrightbraceOrig}
Result:
begin{equation}
{int_{-infty}^infty frac{e^{-x^2}}{2} dx }
end{equation}
edited 8 hours ago
Artificial Odorless Armpit
5,84911345
5,84911345
answered 8 hours ago
BorisBoris
30.9k265107
30.9k265107
add a comment |
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.
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%2f492904%2fhow-to-make-and-automatically-have-left-and-right%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
1
Of course this can be done, but it's not really a good idea. See Is it ever bad to use left and right?.
– barbara beeton
8 hours ago
1
You could use
DeclarePairedDelimiter
frommathtools
to definebraced{{x_i}^2}
.– Davislor
5 hours ago
@Davislor True. It's still messier than just
{x_i^2}
, IMO.– Solomon Ucko
4 hours ago
1
@SolomonUcko I would strongly advise against redefining standard TeX syntax to mean something different. First, it makes the code impossible to read because the syntax means something different from what anyone reading it thinks it does. Second, any code you copy-and-paste to a new document or a new template will silently break. Third, you disable the ability to control the sizing of your braces if you want to.
– Davislor
3 hours ago