What am I doing wrong in this use of split?Left aligning equations without align characterCan't generate png...
How to transport 10,000 terrestrial trolls across ocean fast?
bash aliases do not expand even with shopt expand_aliases
Taking an academic pseudonym?
Graphical modeler calculator missing in QGIS3
Is it possible to detect 100% of SQLi with a simple regex?
How do I purchase a drop bar bike that will be converted to flat bar?
What does an unprocessed RAW file look like?
Sed-Grep-Awk operations
How to compute the dynamic of stock using Geometric Brownian Motion?
Can someone explain European graduate programs in STEM fields?
Minimum Viable Product for RTS game?
Is Screenshot Time-tracking Common?
Why don't programs completely uninstall (remove all their files) when I remove them?
How can I handle players killing my NPC outside of combat?
Sets which are both Sum-free and Product-free.
Why don't you get burned by the wood benches in a sauna?
What really causes series inductance of capacitors?
How to deal with an underperforming subordinate?
Multiple null checks in Java 8
Are positive and negative energy from their respective planes inherently good and evil?
Are one-line email responses considered disrespectful?
How do I narratively explain how in-game circumstances do not mechanically allow a PC to instantly kill an NPC?
What does @ mean in a hostname in DNS configuration?
How many organs can be harvest without killing prisoners?
What am I doing wrong in this use of split?
Left aligning equations without align characterCan't generate png with Error: Erroneous nesting of equation structuresUnable to use tag in split equationProblem to left align within a splitHow to split a long constraint in this optimization problem?How to align left and indent all but the first line in a mult-line equation?How to prettyprint a large equation with multiple split points?How can I align this equation in the center?Align equations within one lineHow to split an equation through text?
I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:

The last equation continues on the right for some reason. Can you spot what is the problem?
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
end{document}
align split
add a comment |
I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:

The last equation continues on the right for some reason. Can you spot what is the problem?
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
end{document}
align split
2
I'm not quite sure what you're aiming for, but have you tried commenting out thebegin{split}andend{split}, and leaving the inner two lines alone?
– Teepeemm
5 hours ago
Wow. Why am I using split in the first place? I thought this wouldn't work at all.
– Joep Awinita
5 hours ago
Needless to say, @Teepeemm, you're answered the question completely.
– Joep Awinita
5 hours ago
But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.
– Teepeemm
4 hours ago
add a comment |
I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:

The last equation continues on the right for some reason. Can you spot what is the problem?
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
end{document}
align split
I'm doing something wrong in the code below that makes the last equation not be written on a line by itself. What I'm trying to do is to split the penultimate equation into two lines. But this happens:

The last equation continues on the right for some reason. Can you spot what is the problem?
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0\
end{split}
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
end{document}
align split
align split
asked 5 hours ago
Joep AwinitaJoep Awinita
1256
1256
2
I'm not quite sure what you're aiming for, but have you tried commenting out thebegin{split}andend{split}, and leaving the inner two lines alone?
– Teepeemm
5 hours ago
Wow. Why am I using split in the first place? I thought this wouldn't work at all.
– Joep Awinita
5 hours ago
Needless to say, @Teepeemm, you're answered the question completely.
– Joep Awinita
5 hours ago
But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.
– Teepeemm
4 hours ago
add a comment |
2
I'm not quite sure what you're aiming for, but have you tried commenting out thebegin{split}andend{split}, and leaving the inner two lines alone?
– Teepeemm
5 hours ago
Wow. Why am I using split in the first place? I thought this wouldn't work at all.
– Joep Awinita
5 hours ago
Needless to say, @Teepeemm, you're answered the question completely.
– Joep Awinita
5 hours ago
But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.
– Teepeemm
4 hours ago
2
2
I'm not quite sure what you're aiming for, but have you tried commenting out the
begin{split} and end{split}, and leaving the inner two lines alone?– Teepeemm
5 hours ago
I'm not quite sure what you're aiming for, but have you tried commenting out the
begin{split} and end{split}, and leaving the inner two lines alone?– Teepeemm
5 hours ago
Wow. Why am I using split in the first place? I thought this wouldn't work at all.
– Joep Awinita
5 hours ago
Wow. Why am I using split in the first place? I thought this wouldn't work at all.
– Joep Awinita
5 hours ago
Needless to say, @Teepeemm, you're answered the question completely.
– Joep Awinita
5 hours ago
Needless to say, @Teepeemm, you're answered the question completely.
– Joep Awinita
5 hours ago
But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.
– Teepeemm
4 hours ago
But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.
– Teepeemm
4 hours ago
add a comment |
3 Answers
3
active
oldest
votes
In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.

documentclass{article}
usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
DeclarePairedDelimiterqrlvertrangle
newcommand{Uf}{U_{!f}}
begin{document}
begin{align*}
qr{psi_2}
&= Uf qr{psi_1}\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0 + qr1 + qr2+qr3 +qr4
+qr5 +qr6 + qr7bigr] qr0 qr0\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
+qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
&qquadqquad
+ Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
+ Ufqr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[qr0qr2 + qr1qr4 + dots
+ qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
end{align*}
end{document}
add a comment |
I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXq[2]{langle}{rangle}%
{#1,delimsizevert,mathopen{}#2}
DeclarePairedDelimiter{qr}vertrangle
DeclarePairedDelimiter{ql}langle rvert
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
&= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
end{align*}
end{document}

Theleftandrightdirectives don't succeed in making "big" square brackets -- better to usebigl[andbigr], right? :-)
– Mico
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
add a comment |
I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{split}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:
documentclass{article}
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{equation*}
begin{split}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
&=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{split}
end{equation*}
end{document}
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
But how to align the equal signs withinequation?alignis appropriate here.
– Sigur
4 hours ago
I forgot to add that I'd recomend using thesplitenvironment to align the equal signs and the multlined environment to break one the lines into two.
– Vinicius M. G. Silveira
4 hours ago
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%2f476218%2fwhat-am-i-doing-wrong-in-this-use-of-split%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.

documentclass{article}
usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
DeclarePairedDelimiterqrlvertrangle
newcommand{Uf}{U_{!f}}
begin{document}
begin{align*}
qr{psi_2}
&= Uf qr{psi_1}\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0 + qr1 + qr2+qr3 +qr4
+qr5 +qr6 + qr7bigr] qr0 qr0\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
+qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
&qquadqquad
+ Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
+ Ufqr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[qr0qr2 + qr1qr4 + dots
+ qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
end{align*}
end{document}
add a comment |
In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.

documentclass{article}
usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
DeclarePairedDelimiterqrlvertrangle
newcommand{Uf}{U_{!f}}
begin{document}
begin{align*}
qr{psi_2}
&= Uf qr{psi_1}\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0 + qr1 + qr2+qr3 +qr4
+qr5 +qr6 + qr7bigr] qr0 qr0\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
+qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
&qquadqquad
+ Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
+ Ufqr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[qr0qr2 + qr1qr4 + dots
+ qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
end{align*}
end{document}
add a comment |
In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.

documentclass{article}
usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
DeclarePairedDelimiterqrlvertrangle
newcommand{Uf}{U_{!f}}
begin{document}
begin{align*}
qr{psi_2}
&= Uf qr{psi_1}\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0 + qr1 + qr2+qr3 +qr4
+qr5 +qr6 + qr7bigr] qr0 qr0\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
+qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
&qquadqquad
+ Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
+ Ufqr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[qr0qr2 + qr1qr4 + dots
+ qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
end{align*}
end{document}
In addition to getting rid of the unneeded split environment, you may want to (a) typeset the U_f terms more compactly, i.e., as U_{!f}, (b) replace various left[ and right] directives with bigl[ and bigr], and (c) replace ... with dots.

documentclass{article}
usepackage{mathtools} % for 'DeclarePairedDelimiter' macro
DeclarePairedDelimiterqrlvertrangle
newcommand{Uf}{U_{!f}}
begin{document}
begin{align*}
qr{psi_2}
&= Uf qr{psi_1}\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0 + qr1 + qr2+qr3 +qr4
+qr5 +qr6 + qr7bigr] qr0 qr0\
&= Uf frac{1}{sqrt{2^4}}
bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0
+qr4qr0+qr5qr0+qr6qr0 + qr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[Ufqr0qr0 + Ufqr1qr0 + Ufqr2qr0+Ufqr3qr0 \
&qquadqquad
+ Ufqr4qr0+Ufqr5qr0+Ufqr6qr0
+ Ufqr7qr0bigr] qr0\
&= frac{1}{sqrt{2^4}}
bigl[qr0qr2 + qr1qr4 + dots
+ qr{i}qr{f(i)} + dots + qr7qr1bigr] qr0,
end{align*}
end{document}
answered 4 hours ago
MicoMico
280k31381770
280k31381770
add a comment |
add a comment |
I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXq[2]{langle}{rangle}%
{#1,delimsizevert,mathopen{}#2}
DeclarePairedDelimiter{qr}vertrangle
DeclarePairedDelimiter{ql}langle rvert
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
&= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
end{align*}
end{document}

Theleftandrightdirectives don't succeed in making "big" square brackets -- better to usebigl[andbigr], right? :-)
– Mico
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
add a comment |
I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXq[2]{langle}{rangle}%
{#1,delimsizevert,mathopen{}#2}
DeclarePairedDelimiter{qr}vertrangle
DeclarePairedDelimiter{ql}langle rvert
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
&= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
end{align*}
end{document}

Theleftandrightdirectives don't succeed in making "big" square brackets -- better to usebigl[andbigr], right? :-)
– Mico
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
add a comment |
I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXq[2]{langle}{rangle}%
{#1,delimsizevert,mathopen{}#2}
DeclarePairedDelimiter{qr}vertrangle
DeclarePairedDelimiter{ql}langle rvert
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
&= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
end{align*}
end{document}

I suggest using the multlined environment from mathtools, and the DeclarePairedDelimiter command from the same package, which will produce scaling , qr and ql:
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiterXnorm[1]lVertrVert{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXPP{twonorm }[1]{}{lVert}{rVert}{_{2}}{ifblank{#1}{: · :}{#1}}
DeclarePairedDelimiterXq[2]{langle}{rangle}%
{#1,delimsizevert,mathopen{}#2}
DeclarePairedDelimiter{qr}vertrangle
DeclarePairedDelimiter{ql}langle rvert
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} bigl[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}bigr] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}}bigl[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0bigr] qr0\
&= begin{multlined}[t] frac{1}{sqrt{2^4}} bigl[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0bigr] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}}bigl[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1bigr] qr0,
end{align*}
end{document}

edited 4 hours ago
answered 4 hours ago
BernardBernard
171k775202
171k775202
Theleftandrightdirectives don't succeed in making "big" square brackets -- better to usebigl[andbigr], right? :-)
– Mico
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
add a comment |
Theleftandrightdirectives don't succeed in making "big" square brackets -- better to usebigl[andbigr], right? :-)
– Mico
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
The
left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)– Mico
4 hours ago
The
left and right directives don't succeed in making "big" square brackets -- better to use bigl[ and bigr], right? :-)– Mico
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
That's right. Actually, I didn't think about this problem, but I see I should have, to make the formula a little less unpleasant to read. I'll fix that. Thanks!
– Bernard
4 hours ago
add a comment |
I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{split}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:
documentclass{article}
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{equation*}
begin{split}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
&=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{split}
end{equation*}
end{document}
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
But how to align the equal signs withinequation?alignis appropriate here.
– Sigur
4 hours ago
I forgot to add that I'd recomend using thesplitenvironment to align the equal signs and the multlined environment to break one the lines into two.
– Vinicius M. G. Silveira
4 hours ago
add a comment |
I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{split}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:
documentclass{article}
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{equation*}
begin{split}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
&=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{split}
end{equation*}
end{document}
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
But how to align the equal signs withinequation?alignis appropriate here.
– Sigur
4 hours ago
I forgot to add that I'd recomend using thesplitenvironment to align the equal signs and the multlined environment to break one the lines into two.
– Vinicius M. G. Silveira
4 hours ago
add a comment |
I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{split}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:
documentclass{article}
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{equation*}
begin{split}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
&=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{split}
end{equation*}
end{document}
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I think the reason you are getting this result is that the second linebreak inside the split environment should be outside, like this:
begin{align*}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
begin{split}
&= frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \
&qquadqquad + U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{split}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{align*}
Besides the recomendations given in Bernard's answer, I'd also suggest using the split environment inside equation* instead of align*, since it seems you're trying to typeset just one (albeit multi-line) equation:
documentclass{article}
usepackage{amsmath}
newcommand{q}[2]{langle #1 | #2 rangle}
newcommand{qr}[1]{|#1rangle}
newcommand{ql}[1]{langle #1|}
DeclareMathOperator{mdc}{mdc}
begin{document}
begin{equation*}
begin{split}
qr{psi_2} &= U_f qr{psi_1}\
&= U_f frac{1}{sqrt{2^4}} left[qr0 + qr1 + qr2+qr3+qr4+qr5+qr6 + qr{7}right] qr0 qr0\
&= U_f frac{1}{sqrt{2^4}} left[qr0qr0 + qr1qr0 + qr2qr0+qr3qr0+qr4qr0+qr5qr0+qr6qr0 + qr{7}qr0right] qr0\
&=!begin{multlined}[t] frac{1}{sqrt{2^4}} big[U_fqr0qr0 + U_fqr1qr0 + U_fqr2qr0+U_fqr3qr0 \[-1.5ex]
qquad+ U_fqr4qr0+U_fqr5qr0+U_fqr6qr0 + U_fqr{7}qr0big] qr0
end{multlined}\
&= frac{1}{sqrt{2^4}} left[qr0qr2 + qr1qr4 + ... + qr{i}qr{f(i)} + ... + qr{7}qr1right] qr0,
end{split}
end{equation*}
end{document}
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 4 hours ago
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 4 hours ago
Vinicius M. G. SilveiraVinicius M. G. Silveira
12
12
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Vinicius M. G. Silveira is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
But how to align the equal signs withinequation?alignis appropriate here.
– Sigur
4 hours ago
I forgot to add that I'd recomend using thesplitenvironment to align the equal signs and the multlined environment to break one the lines into two.
– Vinicius M. G. Silveira
4 hours ago
add a comment |
1
But how to align the equal signs withinequation?alignis appropriate here.
– Sigur
4 hours ago
I forgot to add that I'd recomend using thesplitenvironment to align the equal signs and the multlined environment to break one the lines into two.
– Vinicius M. G. Silveira
4 hours ago
1
1
But how to align the equal signs within
equation? align is appropriate here.– Sigur
4 hours ago
But how to align the equal signs within
equation? align is appropriate here.– Sigur
4 hours ago
I forgot to add that I'd recomend using the
split environment to align the equal signs and the multlined environment to break one the lines into two.– Vinicius M. G. Silveira
4 hours ago
I forgot to add that I'd recomend using the
split environment to align the equal signs and the multlined environment to break one the lines into two.– Vinicius M. G. Silveira
4 hours ago
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%2f476218%2fwhat-am-i-doing-wrong-in-this-use-of-split%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
2
I'm not quite sure what you're aiming for, but have you tried commenting out the
begin{split}andend{split}, and leaving the inner two lines alone?– Teepeemm
5 hours ago
Wow. Why am I using split in the first place? I thought this wouldn't work at all.
– Joep Awinita
5 hours ago
Needless to say, @Teepeemm, you're answered the question completely.
– Joep Awinita
5 hours ago
But a two line comment takes far less effort than a complete answer. I'm content with letting those wanting to take the time to also take the points.
– Teepeemm
4 hours ago