Latex does not go to next line
I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.
$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$
I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:

I have tried disabling packages but this offers no solution.
When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.
Any help is very much appreciated.
math-mode indentation
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.
$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$
I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:

I have tried disabling packages but this offers no solution.
When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.
Any help is very much appreciated.
math-mode indentation
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
6
$$should never be used in LaTeX. In your case, substitute them withbegin{align*}andend{align*}respectively.
– egreg
7 hours ago
add a comment |
I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.
$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$
I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:

I have tried disabling packages but this offers no solution.
When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.
Any help is very much appreciated.
math-mode indentation
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am working on a document for school, trying to make some equations lines. However, the double dollar command for making equations omits the next line command.
$$
S(k+1) &= sum(a[i]cdot a[j] mid i,j : 0leq ileq j < k + 1)\
&=
$$
I would expect the equation to go to the next line and continue indentation from the = character, however the document shows me this:

I have tried disabling packages but this offers no solution.
When I started working in this document there were no issues, a few hours later it suddenly stopped working correctly.
Any help is very much appreciated.
math-mode indentation
math-mode indentation
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 6 hours ago
Werner
447k699891695
447k699891695
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 7 hours ago
CapitalMattersCapitalMatters
111
111
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
CapitalMatters is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
6
$$should never be used in LaTeX. In your case, substitute them withbegin{align*}andend{align*}respectively.
– egreg
7 hours ago
add a comment |
6
$$should never be used in LaTeX. In your case, substitute them withbegin{align*}andend{align*}respectively.
– egreg
7 hours ago
6
6
$$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.– egreg
7 hours ago
$$ should never be used in LaTeX. In your case, substitute them with begin{align*} and end{align*} respectively.– egreg
7 hours ago
add a comment |
2 Answers
2
active
oldest
votes
This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.
For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.
add a comment |
For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?
Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.
While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.

documentclass{article}
usepackage{amsmath} % for 'align*' environment
begin{document}
begin{align*}
S(k+1)
&= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
&= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
end{align*}
end{document}
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
});
}
});
CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.
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%2f478948%2flatex-does-not-go-to-next-line%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
This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.
For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.
add a comment |
This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.
For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.
add a comment |
This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.
For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.
This cannot work: the construct $$ ····· $$ (which anyway is a plain TeX construction and should be replaced in LaTeX with [ ····· ]) is for a one-line centred equation.
For what you want you should use the amsmath align (lines numbered) or align*(unnumbered), with the alignment point specified with an ampersand. For other types of multiline equations, please take a look at the documentation of amsmath, or its extension mathtools.
answered 7 hours ago
BernardBernard
173k776204
173k776204
add a comment |
add a comment |
For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?
Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.
While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.

documentclass{article}
usepackage{amsmath} % for 'align*' environment
begin{document}
begin{align*}
S(k+1)
&= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
&= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
end{align*}
end{document}
add a comment |
For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?
Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.
While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.

documentclass{article}
usepackage{amsmath} % for 'align*' environment
begin{document}
begin{align*}
S(k+1)
&= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
&= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
end{align*}
end{document}
add a comment |
For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?
Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.
While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.

documentclass{article}
usepackage{amsmath} % for 'align*' environment
begin{document}
begin{align*}
S(k+1)
&= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
&= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
end{align*}
end{document}
For reasons not to use $$ to start and stop an unnumbered displayed equation in a LaTeX document, see Why is [ ... ] preferable to $$ ... $$? For still more information on this subject, see What are the differences between $$, [, align, equation and displaymath?
Anyway, all you need to do to salvage your code is to replace the first instance of $$ with begin{align*} and the second instance of $$ with end{align*}.
While you're at it, though, you may want to enlarge the (, |, and ) delimiters, and you may want to either replace : with colon or use double-sum notation. Both options are pursued in the following example.

documentclass{article}
usepackage{amsmath} % for 'align*' environment
begin{document}
begin{align*}
S(k+1)
&= sum bigl( a[i] cdot a[j] bigm| i,j colon 0 leq i leq j < k + 1 bigr) \
&= sum_{i = 0}^j sum_{j = 0}^{k + 1} bigl( a[i] cdot a[j] bigr)
end{align*}
end{document}
edited 6 hours ago
Werner
447k699891695
447k699891695
answered 6 hours ago
MicoMico
282k31386774
282k31386774
add a comment |
add a comment |
CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.
CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.
CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.
CapitalMatters is a new contributor. Be nice, and check out our Code of Conduct.
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%2f478948%2flatex-does-not-go-to-next-line%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
6
$$should never be used in LaTeX. In your case, substitute them withbegin{align*}andend{align*}respectively.– egreg
7 hours ago