How can I fix the label locations on my tikzcd diagram?Location of Labels with Crossing Arrows in Commuative Diagrams with tikzcdproblem making a commutative diagram in tikz using positioning libraryWhy do I get an extra white page before my TikZ picture?Adjusting the width of a displaymath environmentHow to label an arrow in a commutative diagramHow to draw a square and its diagonals with arrows?Tikz-cd arrow labels are not on the same heightArrow type Rightarrow in tikz-cd displayed not correctlyCommutative diagram with curve connecting between nodesRotating label of arrow along the arrowHow to modify a tikz-cd diagram by changing the placement and length of arrows
Why is the marginal distribution/marginal probability described as "marginal"?
Is it possible to pass a pointer to an operator as an argument like a pointer to a function?
Why aren't satellites disintegrated even though they orbit earth within their Roche Limits?
Why are lawsuits between the President and Congress not automatically sent to the Supreme Court
Holding rent money for my friend which amounts to over $10k?
Was the dragon prowess intentionally downplayed in S08E04?
Can EU citizens work on Iceland?
Can I pay my credit card?
How can I make dummy text (like lipsum) grey?
What dog breeds survive the apocalypse for generations?
Is there an academic word that means "to split hairs over"?
When the match time is called, does the current turn end immediately?
Why can't I share a one use code with anyone else?
Gimp perspective tool is not actually transforming
AD: OU for system administrator accounts
Who is frowning in the sentence "Daisy looked at Tom frowning"?
What would a Dragon have to exhale to cause rain?
Is Precocious Apprentice enough for Mystic Theurge?
Canadian citizen who is presently in litigation with a US-based company
Why is so much ransomware breakable?
What do astronauts do with their trash on the ISS?
Is it standard for US-based universities to consider the ethnicity of an applicant during PhD admissions?
Can a person still be an Orthodox Jew and believe that the Torah contains narratives that are not scientifically correct?
I recently started my machine learning PhD and I have absolutely no idea what I'm doing
How can I fix the label locations on my tikzcd diagram?
Location of Labels with Crossing Arrows in Commuative Diagrams with tikzcdproblem making a commutative diagram in tikz using positioning libraryWhy do I get an extra white page before my TikZ picture?Adjusting the width of a displaymath environmentHow to label an arrow in a commutative diagramHow to draw a square and its diagonals with arrows?Tikz-cd arrow labels are not on the same heightArrow type Rightarrow in tikz-cd displayed not correctlyCommutative diagram with curve connecting between nodesRotating label of arrow along the arrowHow to modify a tikz-cd diagram by changing the placement and length of arrows
I am having trouble with the label locations on my commutative diagram.
Here is my code:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & N-1 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & N arrow[l, "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument
which produces

I would like the arrow labels to appear "centered" on the arrows, as they are in the second diagram, but with the node labels from the first diagram. How can I fix this?
Note: I have already looked at the question here and know that I could probably manually correct the spacing on every single label, but that seems way more tedious than should be necessary given that I'm pretty sure the labels should be centered on the arrows by default.
tikz-pgf tikz-cd
add a comment |
I am having trouble with the label locations on my commutative diagram.
Here is my code:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & N-1 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & N arrow[l, "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument
which produces

I would like the arrow labels to appear "centered" on the arrows, as they are in the second diagram, but with the node labels from the first diagram. How can I fix this?
Note: I have already looked at the question here and know that I could probably manually correct the spacing on every single label, but that seems way more tedious than should be necessary given that I'm pretty sure the labels should be centered on the arrows by default.
tikz-pgf tikz-cd
add a comment |
I am having trouble with the label locations on my commutative diagram.
Here is my code:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & N-1 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & N arrow[l, "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument
which produces

I would like the arrow labels to appear "centered" on the arrows, as they are in the second diagram, but with the node labels from the first diagram. How can I fix this?
Note: I have already looked at the question here and know that I could probably manually correct the spacing on every single label, but that seems way more tedious than should be necessary given that I'm pretty sure the labels should be centered on the arrows by default.
tikz-pgf tikz-cd
I am having trouble with the label locations on my commutative diagram.
Here is my code:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & N-1 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & N arrow[l, "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument
which produces

I would like the arrow labels to appear "centered" on the arrows, as they are in the second diagram, but with the node labels from the first diagram. How can I fix this?
Note: I have already looked at the question here and know that I could probably manually correct the spacing on every single label, but that seems way more tedious than should be necessary given that I'm pretty sure the labels should be centered on the arrows by default.
tikz-pgf tikz-cd
tikz-pgf tikz-cd
asked 6 hours ago
Abe SchulteAbe Schulte
419214
419214
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
What happens here? auto gets screwed up.
Why does it happen? See below.
Can one fix it? Yes, at least in an ad hoc way.
documentclassarticle
usepackagetikz-cd
tikzcdsetad hoc fix/.style=r'/.style=r,/tikz/above,l'/.style=l,/tikz/below,
every label/.append style=/tikz/auto=false
begindocument
begintikzcd[ampersand replacement=&,ad hoc fix]
0 arrow[r', "Nlambda", bend left] &
1 arrow[r', "(N - 1)lambda", bend left] arrow[l', "lambda", bend left] &
2 arrow[r', "(N - 2)lambda", bend left] arrow[l', "2lambda", bend left] &
cdots arrow[r', "2lambda", bend left] arrow[l', "3lambda", bend left] &
N-1 arrow[r', "lambda", bend left] arrow[l', "(N-1)lambda", bend left] &
N arrow[l', "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

The reason why this happens is that the arrows have different vertical positions of start and end points. This can be seen from
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &,every label/.append style=sloped]
0 arrow[r, "Nlambda", bend left] &
1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] &
2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] &
cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] &
N-1 arrow[r,"lambda", bend left] arrow[l, "(N-1)lambda", bend left] &
N arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

add a comment |
Misplacement of arrow labels you can be reduce by increasing the bend angles. With this you slightly change the position of the start and end of the arrows for longer nodes' names. For example:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[sep=large,
every arrow/.style=draw,->,bend left=45, % for shorter diagram code
]
0 ar[r, "Nlambda"]
& 1 ar[r, "(N - 1)lambda"]
ar[l, "lambda"]
& 2 ar[r, "(N - 2)lambda"]
ar[l, "2lambda"]
& cdots ar[r, "2lambda"]
ar[l, "3lambda"]
& N-1 ar[r, "lambda"]
ar[l, "(N-1)lambda"]
& N ar[l, "Nlambda"]
endtikzcd
enddocument

The output is not produced when running your code.
– marmot
3 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
No. For instance, you haveN-1-2in your code. Are you saying MikTeX converts this toN-1?
– marmot
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
add a comment |
Looks like a good application for tikz's chain library :
documentclassarticle
usepackagetikz
usetikzlibraryautomata,chains,positioning
begindocument
begintikzpicture[
auto,
start chain = going right,
state/.append style =
on chain,
draw=none,
,
]
node (s0)[state] $0$;
node (s1)[state] $1$;
node (s2)[state] $2$;
draw[->] (s0) edge[bend left] node $Nlambda$ (s1)
(s1) edge[bend left] node $lambda$ (s0)
(s1) edge[bend left] node $(N-1)lambda$ (s2)
(s2) edge[bend left] node $2lambda$ (s1)
;
endtikzpicture
enddocument

New contributor
Åke 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 |
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%2f491008%2fhow-can-i-fix-the-label-locations-on-my-tikzcd-diagram%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
What happens here? auto gets screwed up.
Why does it happen? See below.
Can one fix it? Yes, at least in an ad hoc way.
documentclassarticle
usepackagetikz-cd
tikzcdsetad hoc fix/.style=r'/.style=r,/tikz/above,l'/.style=l,/tikz/below,
every label/.append style=/tikz/auto=false
begindocument
begintikzcd[ampersand replacement=&,ad hoc fix]
0 arrow[r', "Nlambda", bend left] &
1 arrow[r', "(N - 1)lambda", bend left] arrow[l', "lambda", bend left] &
2 arrow[r', "(N - 2)lambda", bend left] arrow[l', "2lambda", bend left] &
cdots arrow[r', "2lambda", bend left] arrow[l', "3lambda", bend left] &
N-1 arrow[r', "lambda", bend left] arrow[l', "(N-1)lambda", bend left] &
N arrow[l', "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

The reason why this happens is that the arrows have different vertical positions of start and end points. This can be seen from
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &,every label/.append style=sloped]
0 arrow[r, "Nlambda", bend left] &
1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] &
2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] &
cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] &
N-1 arrow[r,"lambda", bend left] arrow[l, "(N-1)lambda", bend left] &
N arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

add a comment |
What happens here? auto gets screwed up.
Why does it happen? See below.
Can one fix it? Yes, at least in an ad hoc way.
documentclassarticle
usepackagetikz-cd
tikzcdsetad hoc fix/.style=r'/.style=r,/tikz/above,l'/.style=l,/tikz/below,
every label/.append style=/tikz/auto=false
begindocument
begintikzcd[ampersand replacement=&,ad hoc fix]
0 arrow[r', "Nlambda", bend left] &
1 arrow[r', "(N - 1)lambda", bend left] arrow[l', "lambda", bend left] &
2 arrow[r', "(N - 2)lambda", bend left] arrow[l', "2lambda", bend left] &
cdots arrow[r', "2lambda", bend left] arrow[l', "3lambda", bend left] &
N-1 arrow[r', "lambda", bend left] arrow[l', "(N-1)lambda", bend left] &
N arrow[l', "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

The reason why this happens is that the arrows have different vertical positions of start and end points. This can be seen from
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &,every label/.append style=sloped]
0 arrow[r, "Nlambda", bend left] &
1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] &
2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] &
cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] &
N-1 arrow[r,"lambda", bend left] arrow[l, "(N-1)lambda", bend left] &
N arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

add a comment |
What happens here? auto gets screwed up.
Why does it happen? See below.
Can one fix it? Yes, at least in an ad hoc way.
documentclassarticle
usepackagetikz-cd
tikzcdsetad hoc fix/.style=r'/.style=r,/tikz/above,l'/.style=l,/tikz/below,
every label/.append style=/tikz/auto=false
begindocument
begintikzcd[ampersand replacement=&,ad hoc fix]
0 arrow[r', "Nlambda", bend left] &
1 arrow[r', "(N - 1)lambda", bend left] arrow[l', "lambda", bend left] &
2 arrow[r', "(N - 2)lambda", bend left] arrow[l', "2lambda", bend left] &
cdots arrow[r', "2lambda", bend left] arrow[l', "3lambda", bend left] &
N-1 arrow[r', "lambda", bend left] arrow[l', "(N-1)lambda", bend left] &
N arrow[l', "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

The reason why this happens is that the arrows have different vertical positions of start and end points. This can be seen from
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &,every label/.append style=sloped]
0 arrow[r, "Nlambda", bend left] &
1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] &
2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] &
cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] &
N-1 arrow[r,"lambda", bend left] arrow[l, "(N-1)lambda", bend left] &
N arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

What happens here? auto gets screwed up.
Why does it happen? See below.
Can one fix it? Yes, at least in an ad hoc way.
documentclassarticle
usepackagetikz-cd
tikzcdsetad hoc fix/.style=r'/.style=r,/tikz/above,l'/.style=l,/tikz/below,
every label/.append style=/tikz/auto=false
begindocument
begintikzcd[ampersand replacement=&,ad hoc fix]
0 arrow[r', "Nlambda", bend left] &
1 arrow[r', "(N - 1)lambda", bend left] arrow[l', "lambda", bend left] &
2 arrow[r', "(N - 2)lambda", bend left] arrow[l', "2lambda", bend left] &
cdots arrow[r', "2lambda", bend left] arrow[l', "3lambda", bend left] &
N-1 arrow[r', "lambda", bend left] arrow[l', "(N-1)lambda", bend left] &
N arrow[l', "Nlambda", bend left]
endtikzcd
begintikzcd[ampersand replacement = &]
0 arrow[r, "Nlambda", bend left] & 1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] & 2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] & 3 arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] & 4 arrow[r, "lambda", bend left] arrow[l, "(N-1)lambda", bend left] & 5 arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

The reason why this happens is that the arrows have different vertical positions of start and end points. This can be seen from
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[ampersand replacement = &,every label/.append style=sloped]
0 arrow[r, "Nlambda", bend left] &
1 arrow[r, "(N - 1)lambda", bend left] arrow[l, "lambda", bend left] &
2 arrow[r, "(N - 2)lambda", bend left] arrow[l, "2lambda", bend left] &
cdots arrow[r, "2lambda", bend left] arrow[l, "3lambda", bend left] &
N-1 arrow[r,"lambda", bend left] arrow[l, "(N-1)lambda", bend left] &
N arrow[l, "Nlambda", bend left]
endtikzcd
enddocument

edited 3 hours ago
answered 3 hours ago
marmotmarmot
127k6162308
127k6162308
add a comment |
add a comment |
Misplacement of arrow labels you can be reduce by increasing the bend angles. With this you slightly change the position of the start and end of the arrows for longer nodes' names. For example:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[sep=large,
every arrow/.style=draw,->,bend left=45, % for shorter diagram code
]
0 ar[r, "Nlambda"]
& 1 ar[r, "(N - 1)lambda"]
ar[l, "lambda"]
& 2 ar[r, "(N - 2)lambda"]
ar[l, "2lambda"]
& cdots ar[r, "2lambda"]
ar[l, "3lambda"]
& N-1 ar[r, "lambda"]
ar[l, "(N-1)lambda"]
& N ar[l, "Nlambda"]
endtikzcd
enddocument

The output is not produced when running your code.
– marmot
3 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
No. For instance, you haveN-1-2in your code. Are you saying MikTeX converts this toN-1?
– marmot
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
add a comment |
Misplacement of arrow labels you can be reduce by increasing the bend angles. With this you slightly change the position of the start and end of the arrows for longer nodes' names. For example:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[sep=large,
every arrow/.style=draw,->,bend left=45, % for shorter diagram code
]
0 ar[r, "Nlambda"]
& 1 ar[r, "(N - 1)lambda"]
ar[l, "lambda"]
& 2 ar[r, "(N - 2)lambda"]
ar[l, "2lambda"]
& cdots ar[r, "2lambda"]
ar[l, "3lambda"]
& N-1 ar[r, "lambda"]
ar[l, "(N-1)lambda"]
& N ar[l, "Nlambda"]
endtikzcd
enddocument

The output is not produced when running your code.
– marmot
3 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
No. For instance, you haveN-1-2in your code. Are you saying MikTeX converts this toN-1?
– marmot
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
add a comment |
Misplacement of arrow labels you can be reduce by increasing the bend angles. With this you slightly change the position of the start and end of the arrows for longer nodes' names. For example:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[sep=large,
every arrow/.style=draw,->,bend left=45, % for shorter diagram code
]
0 ar[r, "Nlambda"]
& 1 ar[r, "(N - 1)lambda"]
ar[l, "lambda"]
& 2 ar[r, "(N - 2)lambda"]
ar[l, "2lambda"]
& cdots ar[r, "2lambda"]
ar[l, "3lambda"]
& N-1 ar[r, "lambda"]
ar[l, "(N-1)lambda"]
& N ar[l, "Nlambda"]
endtikzcd
enddocument

Misplacement of arrow labels you can be reduce by increasing the bend angles. With this you slightly change the position of the start and end of the arrows for longer nodes' names. For example:
documentclassarticle
usepackagetikz-cd
begindocument
begintikzcd[sep=large,
every arrow/.style=draw,->,bend left=45, % for shorter diagram code
]
0 ar[r, "Nlambda"]
& 1 ar[r, "(N - 1)lambda"]
ar[l, "lambda"]
& 2 ar[r, "(N - 2)lambda"]
ar[l, "2lambda"]
& cdots ar[r, "2lambda"]
ar[l, "3lambda"]
& N-1 ar[r, "lambda"]
ar[l, "(N-1)lambda"]
& N ar[l, "Nlambda"]
endtikzcd
enddocument

edited 2 hours ago
answered 3 hours ago
ZarkoZarko
134k872178
134k872178
The output is not produced when running your code.
– marmot
3 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
No. For instance, you haveN-1-2in your code. Are you saying MikTeX converts this toN-1?
– marmot
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
add a comment |
The output is not produced when running your code.
– marmot
3 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
No. For instance, you haveN-1-2in your code. Are you saying MikTeX converts this toN-1?
– marmot
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
The output is not produced when running your code.
– marmot
3 hours ago
The output is not produced when running your code.
– marmot
3 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
hm, I check the code again and obtain the same result as i show in answer. I use recent MikTeX (updated yesterday) on w10 machine.
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
@Åke, thank you very much !
– Zarko
2 hours ago
No. For instance, you have
N-1-2 in your code. Are you saying MikTeX converts this to N-1?– marmot
2 hours ago
No. For instance, you have
N-1-2 in your code. Are you saying MikTeX converts this to N-1?– marmot
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
ups, @marmoth you are right. Thank you very much to pointed to this. I didn't notice this, I just looked position of arrows labels. i will correct this asap. this left from some previous test ...
– Zarko
2 hours ago
add a comment |
Looks like a good application for tikz's chain library :
documentclassarticle
usepackagetikz
usetikzlibraryautomata,chains,positioning
begindocument
begintikzpicture[
auto,
start chain = going right,
state/.append style =
on chain,
draw=none,
,
]
node (s0)[state] $0$;
node (s1)[state] $1$;
node (s2)[state] $2$;
draw[->] (s0) edge[bend left] node $Nlambda$ (s1)
(s1) edge[bend left] node $lambda$ (s0)
(s1) edge[bend left] node $(N-1)lambda$ (s2)
(s2) edge[bend left] node $2lambda$ (s1)
;
endtikzpicture
enddocument

New contributor
Åke 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 |
Looks like a good application for tikz's chain library :
documentclassarticle
usepackagetikz
usetikzlibraryautomata,chains,positioning
begindocument
begintikzpicture[
auto,
start chain = going right,
state/.append style =
on chain,
draw=none,
,
]
node (s0)[state] $0$;
node (s1)[state] $1$;
node (s2)[state] $2$;
draw[->] (s0) edge[bend left] node $Nlambda$ (s1)
(s1) edge[bend left] node $lambda$ (s0)
(s1) edge[bend left] node $(N-1)lambda$ (s2)
(s2) edge[bend left] node $2lambda$ (s1)
;
endtikzpicture
enddocument

New contributor
Åke 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 |
Looks like a good application for tikz's chain library :
documentclassarticle
usepackagetikz
usetikzlibraryautomata,chains,positioning
begindocument
begintikzpicture[
auto,
start chain = going right,
state/.append style =
on chain,
draw=none,
,
]
node (s0)[state] $0$;
node (s1)[state] $1$;
node (s2)[state] $2$;
draw[->] (s0) edge[bend left] node $Nlambda$ (s1)
(s1) edge[bend left] node $lambda$ (s0)
(s1) edge[bend left] node $(N-1)lambda$ (s2)
(s2) edge[bend left] node $2lambda$ (s1)
;
endtikzpicture
enddocument

New contributor
Åke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Looks like a good application for tikz's chain library :
documentclassarticle
usepackagetikz
usetikzlibraryautomata,chains,positioning
begindocument
begintikzpicture[
auto,
start chain = going right,
state/.append style =
on chain,
draw=none,
,
]
node (s0)[state] $0$;
node (s1)[state] $1$;
node (s2)[state] $2$;
draw[->] (s0) edge[bend left] node $Nlambda$ (s1)
(s1) edge[bend left] node $lambda$ (s0)
(s1) edge[bend left] node $(N-1)lambda$ (s2)
(s2) edge[bend left] node $2lambda$ (s1)
;
endtikzpicture
enddocument

New contributor
Åke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Åke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 2 hours ago
ÅkeÅke
274
274
New contributor
Åke is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Åke 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 |
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%2f491008%2fhow-can-i-fix-the-label-locations-on-my-tikzcd-diagram%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