How to save space when writing equations with cases?
I am writing in IEEE double column environment. I have some equations with cases. For example, this equation seems to have too much space after the brace and also before and after the commas.

I was using the array environment which seems to cause those large spacing. I still prefer to have some independent control over the alignment of the three parts of the equation, since in some cases for each column, the length may be quite different, and I may choose to center, left, or right align for each column. What would be a good way to make those spacings smaller but still have control over the alignment?
The code I used for the equation is
begin{equation}
theta_{pk}=left{ begin{array}{ccc}
omega t+alpha+beta & , & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , & n=7,8,9,10,11,12,ldots
end{array}right.
end{equation}
math-mode spacing
add a comment |
I am writing in IEEE double column environment. I have some equations with cases. For example, this equation seems to have too much space after the brace and also before and after the commas.

I was using the array environment which seems to cause those large spacing. I still prefer to have some independent control over the alignment of the three parts of the equation, since in some cases for each column, the length may be quite different, and I may choose to center, left, or right align for each column. What would be a good way to make those spacings smaller but still have control over the alignment?
The code I used for the equation is
begin{equation}
theta_{pk}=left{ begin{array}{ccc}
omega t+alpha+beta & , & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , & n=7,8,9,10,11,12,ldots
end{array}right.
end{equation}
math-mode spacing
5
There exists an environment for that:cases.
– marmot
Apr 19 at 20:35
add a comment |
I am writing in IEEE double column environment. I have some equations with cases. For example, this equation seems to have too much space after the brace and also before and after the commas.

I was using the array environment which seems to cause those large spacing. I still prefer to have some independent control over the alignment of the three parts of the equation, since in some cases for each column, the length may be quite different, and I may choose to center, left, or right align for each column. What would be a good way to make those spacings smaller but still have control over the alignment?
The code I used for the equation is
begin{equation}
theta_{pk}=left{ begin{array}{ccc}
omega t+alpha+beta & , & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , & n=7,8,9,10,11,12,ldots
end{array}right.
end{equation}
math-mode spacing
I am writing in IEEE double column environment. I have some equations with cases. For example, this equation seems to have too much space after the brace and also before and after the commas.

I was using the array environment which seems to cause those large spacing. I still prefer to have some independent control over the alignment of the three parts of the equation, since in some cases for each column, the length may be quite different, and I may choose to center, left, or right align for each column. What would be a good way to make those spacings smaller but still have control over the alignment?
The code I used for the equation is
begin{equation}
theta_{pk}=left{ begin{array}{ccc}
omega t+alpha+beta & , & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , & n=7,8,9,10,11,12,ldots
end{array}right.
end{equation}
math-mode spacing
math-mode spacing
asked Apr 19 at 20:33
nanjunnanjun
15517
15517
5
There exists an environment for that:cases.
– marmot
Apr 19 at 20:35
add a comment |
5
There exists an environment for that:cases.
– marmot
Apr 19 at 20:35
5
5
There exists an environment for that:
cases.– marmot
Apr 19 at 20:35
There exists an environment for that:
cases.– marmot
Apr 19 at 20:35
add a comment |
2 Answers
2
active
oldest
votes
as mentioned @marmot in comment, cases from amsmath is right tool for your job. it care for right spacing between building block of your equation:

documentclass{IEEEtran}
usepackage{amsmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{equation}
theta_{pk} =
begin{cases}
omega t+alpha+beta & , n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
lipsum[2-4]
end{document}
addendum:
as mentioned @manooooh in his valued comment, AMS (American Mathematical Society) prefer style, where comas follows math expression, i.e:
begin{cases}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots.
end{cases}
which use gives

but some people prefer the following style:
begin{cases}
phantom{-}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots
end{cases}
giving:

however, documentation "amsldoc", as mentioned barbara beeton in her comment, is given the following example, how mathematicians usually use the cases math environment:
begin{cases}
omega t+alpha+beta & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta & n=7,8,9,10,11,12,cdots.
end{cases}
which gives:

Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
1
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.omega t+alpha+beta,and notomega t+alpha+beta&,, and at the end of the line should be a comma e.g.ldots,.
– manooooh
Apr 19 at 20:53
1
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the&. That is what is shown in the user guide (texdoc amsldoc).
– barbara beeton
Apr 20 at 2:55
add a comment |
A variant, with the fleqn environment from nccmath. I improvedged the alignment in the first column of the cases environment, using a phantom — sign in the first row.
You also can save some space – to a certain extent, with the mathrlap command from mathtools (which loads amsmath). I didn't need it here.
documentclass{IEEEtran}
usepackage{amsmath, nccmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{fleqn}
begin{equation}
theta_{pk} =
begin{cases}
phantom{-}omega t+alpha+beta, & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
end{fleqn}
lipsum[2-4]
end{document}

What's the purpose offleqn? I see no reason for it.
– egreg
Apr 19 at 21:32
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
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%2f485658%2fhow-to-save-space-when-writing-equations-with-cases%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
as mentioned @marmot in comment, cases from amsmath is right tool for your job. it care for right spacing between building block of your equation:

documentclass{IEEEtran}
usepackage{amsmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{equation}
theta_{pk} =
begin{cases}
omega t+alpha+beta & , n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
lipsum[2-4]
end{document}
addendum:
as mentioned @manooooh in his valued comment, AMS (American Mathematical Society) prefer style, where comas follows math expression, i.e:
begin{cases}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots.
end{cases}
which use gives

but some people prefer the following style:
begin{cases}
phantom{-}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots
end{cases}
giving:

however, documentation "amsldoc", as mentioned barbara beeton in her comment, is given the following example, how mathematicians usually use the cases math environment:
begin{cases}
omega t+alpha+beta & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta & n=7,8,9,10,11,12,cdots.
end{cases}
which gives:

Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
1
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.omega t+alpha+beta,and notomega t+alpha+beta&,, and at the end of the line should be a comma e.g.ldots,.
– manooooh
Apr 19 at 20:53
1
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the&. That is what is shown in the user guide (texdoc amsldoc).
– barbara beeton
Apr 20 at 2:55
add a comment |
as mentioned @marmot in comment, cases from amsmath is right tool for your job. it care for right spacing between building block of your equation:

documentclass{IEEEtran}
usepackage{amsmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{equation}
theta_{pk} =
begin{cases}
omega t+alpha+beta & , n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
lipsum[2-4]
end{document}
addendum:
as mentioned @manooooh in his valued comment, AMS (American Mathematical Society) prefer style, where comas follows math expression, i.e:
begin{cases}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots.
end{cases}
which use gives

but some people prefer the following style:
begin{cases}
phantom{-}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots
end{cases}
giving:

however, documentation "amsldoc", as mentioned barbara beeton in her comment, is given the following example, how mathematicians usually use the cases math environment:
begin{cases}
omega t+alpha+beta & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta & n=7,8,9,10,11,12,cdots.
end{cases}
which gives:

Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
1
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.omega t+alpha+beta,and notomega t+alpha+beta&,, and at the end of the line should be a comma e.g.ldots,.
– manooooh
Apr 19 at 20:53
1
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the&. That is what is shown in the user guide (texdoc amsldoc).
– barbara beeton
Apr 20 at 2:55
add a comment |
as mentioned @marmot in comment, cases from amsmath is right tool for your job. it care for right spacing between building block of your equation:

documentclass{IEEEtran}
usepackage{amsmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{equation}
theta_{pk} =
begin{cases}
omega t+alpha+beta & , n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
lipsum[2-4]
end{document}
addendum:
as mentioned @manooooh in his valued comment, AMS (American Mathematical Society) prefer style, where comas follows math expression, i.e:
begin{cases}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots.
end{cases}
which use gives

but some people prefer the following style:
begin{cases}
phantom{-}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots
end{cases}
giving:

however, documentation "amsldoc", as mentioned barbara beeton in her comment, is given the following example, how mathematicians usually use the cases math environment:
begin{cases}
omega t+alpha+beta & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta & n=7,8,9,10,11,12,cdots.
end{cases}
which gives:

as mentioned @marmot in comment, cases from amsmath is right tool for your job. it care for right spacing between building block of your equation:

documentclass{IEEEtran}
usepackage{amsmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{equation}
theta_{pk} =
begin{cases}
omega t+alpha+beta & , n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta & , n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
lipsum[2-4]
end{document}
addendum:
as mentioned @manooooh in his valued comment, AMS (American Mathematical Society) prefer style, where comas follows math expression, i.e:
begin{cases}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots.
end{cases}
which use gives

but some people prefer the following style:
begin{cases}
phantom{-}
omega t+alpha+beta, & n=1,2,3,4,5,6,cdots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,cdots
end{cases}
giving:

however, documentation "amsldoc", as mentioned barbara beeton in her comment, is given the following example, how mathematicians usually use the cases math environment:
begin{cases}
omega t+alpha+beta & n=1,2,3,4,5,6,cdots,\
-omega t-alpha-beta & n=7,8,9,10,11,12,cdots.
end{cases}
which gives:

edited Apr 20 at 4:57
answered Apr 19 at 20:48
ZarkoZarko
131k869170
131k869170
Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
1
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.omega t+alpha+beta,and notomega t+alpha+beta&,, and at the end of the line should be a comma e.g.ldots,.
– manooooh
Apr 19 at 20:53
1
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the&. That is what is shown in the user guide (texdoc amsldoc).
– barbara beeton
Apr 20 at 2:55
add a comment |
Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
1
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.omega t+alpha+beta,and notomega t+alpha+beta&,, and at the end of the line should be a comma e.g.ldots,.
– manooooh
Apr 19 at 20:53
1
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the&. That is what is shown in the user guide (texdoc amsldoc).
– barbara beeton
Apr 20 at 2:55
Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
Is it possible to reduce the space before the commas if I have slightly longer equations to fit in the column?
– nanjun
Apr 19 at 20:51
1
1
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.
omega t+alpha+beta, and not omega t+alpha+beta&,, and at the end of the line should be a comma e.g. ldots,.– manooooh
Apr 19 at 20:53
Great answer!! According to AMS, I think that the commas have to start just after the expression e.g.
omega t+alpha+beta, and not omega t+alpha+beta&,, and at the end of the line should be a comma e.g. ldots,.– manooooh
Apr 19 at 20:53
1
1
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the
&. That is what is shown in the user guide (texdoc amsldoc).– barbara beeton
Apr 20 at 2:55
@manooooh -- "According to AMS ... have to" is a bit of a stretch. The traditional location of the commas is indeed at the end of the initial segment of a line, not after the
&. That is what is shown in the user guide (texdoc amsldoc).– barbara beeton
Apr 20 at 2:55
add a comment |
A variant, with the fleqn environment from nccmath. I improvedged the alignment in the first column of the cases environment, using a phantom — sign in the first row.
You also can save some space – to a certain extent, with the mathrlap command from mathtools (which loads amsmath). I didn't need it here.
documentclass{IEEEtran}
usepackage{amsmath, nccmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{fleqn}
begin{equation}
theta_{pk} =
begin{cases}
phantom{-}omega t+alpha+beta, & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
end{fleqn}
lipsum[2-4]
end{document}

What's the purpose offleqn? I see no reason for it.
– egreg
Apr 19 at 21:32
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
add a comment |
A variant, with the fleqn environment from nccmath. I improvedged the alignment in the first column of the cases environment, using a phantom — sign in the first row.
You also can save some space – to a certain extent, with the mathrlap command from mathtools (which loads amsmath). I didn't need it here.
documentclass{IEEEtran}
usepackage{amsmath, nccmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{fleqn}
begin{equation}
theta_{pk} =
begin{cases}
phantom{-}omega t+alpha+beta, & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
end{fleqn}
lipsum[2-4]
end{document}

What's the purpose offleqn? I see no reason for it.
– egreg
Apr 19 at 21:32
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
add a comment |
A variant, with the fleqn environment from nccmath. I improvedged the alignment in the first column of the cases environment, using a phantom — sign in the first row.
You also can save some space – to a certain extent, with the mathrlap command from mathtools (which loads amsmath). I didn't need it here.
documentclass{IEEEtran}
usepackage{amsmath, nccmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{fleqn}
begin{equation}
theta_{pk} =
begin{cases}
phantom{-}omega t+alpha+beta, & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
end{fleqn}
lipsum[2-4]
end{document}

A variant, with the fleqn environment from nccmath. I improvedged the alignment in the first column of the cases environment, using a phantom — sign in the first row.
You also can save some space – to a certain extent, with the mathrlap command from mathtools (which loads amsmath). I didn't need it here.
documentclass{IEEEtran}
usepackage{amsmath, nccmath}
usepackage{lipsum} % for dummy text
begin{document}
lipsum[1]
begin{fleqn}
begin{equation}
theta_{pk} =
begin{cases}
phantom{-}omega t+alpha+beta, & n=1,2,3,4,5,6,ldots\
-omega t-alpha-beta, & n=7,8,9,10,11,12,ldots
end{cases}
end{equation}
end{fleqn}
lipsum[2-4]
end{document}

answered Apr 19 at 21:22
BernardBernard
177k779211
177k779211
What's the purpose offleqn? I see no reason for it.
– egreg
Apr 19 at 21:32
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
add a comment |
What's the purpose offleqn? I see no reason for it.
– egreg
Apr 19 at 21:32
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
What's the purpose of
fleqn? I see no reason for it.– egreg
Apr 19 at 21:32
What's the purpose of
fleqn? I see no reason for it.– egreg
Apr 19 at 21:32
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
@egreg: Inside this environment, the equations are flushleft, while being aligned, gathered, &c. This can save some space.
– Bernard
Apr 19 at 21:43
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%2f485658%2fhow-to-save-space-when-writing-equations-with-cases%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
5
There exists an environment for that:
cases.– marmot
Apr 19 at 20:35