Linebreak inside label - tikzcd package
up vote
5
down vote
favorite
I am using tikzcd
.
I want to use line breaks within the label of the arrows. Naively, I thought that
begin{tikzcd}
A arrow[d, "label 1 \ label 2"] \
B
end{tikzcd}
would work. But it gives me
instead. How to solve this?
tikz-pgf tikz-cd
add a comment |
up vote
5
down vote
favorite
I am using tikzcd
.
I want to use line breaks within the label of the arrows. Naively, I thought that
begin{tikzcd}
A arrow[d, "label 1 \ label 2"] \
B
end{tikzcd}
would work. But it gives me
instead. How to solve this?
tikz-pgf tikz-cd
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I am using tikzcd
.
I want to use line breaks within the label of the arrows. Naively, I thought that
begin{tikzcd}
A arrow[d, "label 1 \ label 2"] \
B
end{tikzcd}
would work. But it gives me
instead. How to solve this?
tikz-pgf tikz-cd
I am using tikzcd
.
I want to use line breaks within the label of the arrows. Naively, I thought that
begin{tikzcd}
A arrow[d, "label 1 \ label 2"] \
B
end{tikzcd}
would work. But it gives me
instead. How to solve this?
tikz-pgf tikz-cd
tikz-pgf tikz-cd
edited Nov 29 at 12:48
Phelype Oleinik
21.3k54380
21.3k54380
asked Nov 29 at 12:47
Soap
1554
1554
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
5
down vote
accepted
Use substack
.
documentclass{article}
usepackage{amsmath}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}[row sep=large]
A arrow[d, "substack{a \ a}"] & % good
A arrow[d,"a \ a" align=left] & % bad
A arrow[d,"shortstack{a\a}"] % ugly
\
B & B & B
end{tikzcd}
end{document}
If the labels are textual, use text
inside substack
. The same code as before, but with substack{text{a} \ text{a}}
in the leftmost arrow yields
add a comment |
up vote
5
down vote
documentclass{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d, "shortstack{label 1\label 2}"] \
B
end{tikzcd}
end{document}
add a comment |
up vote
5
down vote
You only need to add align=left
(or something of that sort).
documentclass{article}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d,"label1\ label2"align=left] \
B
end{tikzcd}
end{document}
add a comment |
up vote
3
down vote
From the pag. 13 of the guide of tikz-cd
http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf
I have used a matrix 2x1
(for example) to have two vertical labels. With the option row sep=...cm
you can increase or decrease the lenght of the arrow.
documentclass[a4paper,12pt,oneside]{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=2cm, ampersand replacement=&]
A arrow[d, "{begin{matrix} text{label1} \ text{label2} end{matrix}}
"] \
B
end{tikzcd}
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',
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%2f462374%2flinebreak-inside-label-tikzcd-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
Use substack
.
documentclass{article}
usepackage{amsmath}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}[row sep=large]
A arrow[d, "substack{a \ a}"] & % good
A arrow[d,"a \ a" align=left] & % bad
A arrow[d,"shortstack{a\a}"] % ugly
\
B & B & B
end{tikzcd}
end{document}
If the labels are textual, use text
inside substack
. The same code as before, but with substack{text{a} \ text{a}}
in the leftmost arrow yields
add a comment |
up vote
5
down vote
accepted
Use substack
.
documentclass{article}
usepackage{amsmath}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}[row sep=large]
A arrow[d, "substack{a \ a}"] & % good
A arrow[d,"a \ a" align=left] & % bad
A arrow[d,"shortstack{a\a}"] % ugly
\
B & B & B
end{tikzcd}
end{document}
If the labels are textual, use text
inside substack
. The same code as before, but with substack{text{a} \ text{a}}
in the leftmost arrow yields
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
Use substack
.
documentclass{article}
usepackage{amsmath}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}[row sep=large]
A arrow[d, "substack{a \ a}"] & % good
A arrow[d,"a \ a" align=left] & % bad
A arrow[d,"shortstack{a\a}"] % ugly
\
B & B & B
end{tikzcd}
end{document}
If the labels are textual, use text
inside substack
. The same code as before, but with substack{text{a} \ text{a}}
in the leftmost arrow yields
Use substack
.
documentclass{article}
usepackage{amsmath}
usepackage{tikz-cd}
begin{document}
begin{tikzcd}[row sep=large]
A arrow[d, "substack{a \ a}"] & % good
A arrow[d,"a \ a" align=left] & % bad
A arrow[d,"shortstack{a\a}"] % ugly
\
B & B & B
end{tikzcd}
end{document}
If the labels are textual, use text
inside substack
. The same code as before, but with substack{text{a} \ text{a}}
in the leftmost arrow yields
answered Nov 29 at 16:35
egreg
704k8618763155
704k8618763155
add a comment |
add a comment |
up vote
5
down vote
documentclass{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d, "shortstack{label 1\label 2}"] \
B
end{tikzcd}
end{document}
add a comment |
up vote
5
down vote
documentclass{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d, "shortstack{label 1\label 2}"] \
B
end{tikzcd}
end{document}
add a comment |
up vote
5
down vote
up vote
5
down vote
documentclass{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d, "shortstack{label 1\label 2}"] \
B
end{tikzcd}
end{document}
documentclass{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d, "shortstack{label 1\label 2}"] \
B
end{tikzcd}
end{document}
answered Nov 29 at 13:32
Herbert
267k23407716
267k23407716
add a comment |
add a comment |
up vote
5
down vote
You only need to add align=left
(or something of that sort).
documentclass{article}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d,"label1\ label2"align=left] \
B
end{tikzcd}
end{document}
add a comment |
up vote
5
down vote
You only need to add align=left
(or something of that sort).
documentclass{article}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d,"label1\ label2"align=left] \
B
end{tikzcd}
end{document}
add a comment |
up vote
5
down vote
up vote
5
down vote
You only need to add align=left
(or something of that sort).
documentclass{article}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d,"label1\ label2"align=left] \
B
end{tikzcd}
end{document}
You only need to add align=left
(or something of that sort).
documentclass{article}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=3cm]
A arrow[d,"label1\ label2"align=left] \
B
end{tikzcd}
end{document}
answered Nov 29 at 15:55
marmot
82.9k493177
82.9k493177
add a comment |
add a comment |
up vote
3
down vote
From the pag. 13 of the guide of tikz-cd
http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf
I have used a matrix 2x1
(for example) to have two vertical labels. With the option row sep=...cm
you can increase or decrease the lenght of the arrow.
documentclass[a4paper,12pt,oneside]{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=2cm, ampersand replacement=&]
A arrow[d, "{begin{matrix} text{label1} \ text{label2} end{matrix}}
"] \
B
end{tikzcd}
end{document}
add a comment |
up vote
3
down vote
From the pag. 13 of the guide of tikz-cd
http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf
I have used a matrix 2x1
(for example) to have two vertical labels. With the option row sep=...cm
you can increase or decrease the lenght of the arrow.
documentclass[a4paper,12pt,oneside]{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=2cm, ampersand replacement=&]
A arrow[d, "{begin{matrix} text{label1} \ text{label2} end{matrix}}
"] \
B
end{tikzcd}
end{document}
add a comment |
up vote
3
down vote
up vote
3
down vote
From the pag. 13 of the guide of tikz-cd
http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf
I have used a matrix 2x1
(for example) to have two vertical labels. With the option row sep=...cm
you can increase or decrease the lenght of the arrow.
documentclass[a4paper,12pt,oneside]{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=2cm, ampersand replacement=&]
A arrow[d, "{begin{matrix} text{label1} \ text{label2} end{matrix}}
"] \
B
end{tikzcd}
end{document}
From the pag. 13 of the guide of tikz-cd
http://ctan.math.washington.edu/tex-archive/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf
I have used a matrix 2x1
(for example) to have two vertical labels. With the option row sep=...cm
you can increase or decrease the lenght of the arrow.
documentclass[a4paper,12pt,oneside]{book}
usepackage{tikz-cd,amsmath}
begin{document}
begin{tikzcd}[row sep=2cm, ampersand replacement=&]
A arrow[d, "{begin{matrix} text{label1} \ text{label2} end{matrix}}
"] \
B
end{tikzcd}
end{document}
edited Nov 30 at 21:21
answered Nov 29 at 13:14
Sebastiano
8,59841756
8,59841756
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462374%2flinebreak-inside-label-tikzcd-package%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