Aligning text on edge

Aligning text on edge



I cannot figure out why the text on the edge is not entered. What am I doing wrong?


documentclass[margin=1mm]standalone


usepackagetikz
usetikzlibrarypositioning

begindocument

begintikzpicture
node[rectangle,draw,minimum width=1cm, minimum height=1cm] (r1) ;;

node[rectangle,draw,minimum width=1cm, minimum height=1cm, right=3cm of r1] (r2) edge[<-,thick] node[above,text width=1.5cm, align=center] Asynchronous\[-3pt]replication (r1);
endtikzpicture

enddocument



enter image description here




1 Answer
1



Remove text width setting:


text width


documentclass[margin=1mm]standalone


usepackagetikz
usetikzlibrarypositioning

begindocument

begintikzpicture
node[rectangle,draw,minimum width=1cm, minimum height=1cm] (r1) ;;

node[rectangle,draw,minimum width=1cm, minimum height=1cm, right=3cm of r1] (r2) edge[<-,thick] node[above, align=center] Asynchronous\[-3pt]replication (r1);
endtikzpicture

enddocument



enter image description here



A 1.5 cm text width is smaller than the width:



enter image description here





Thank you very much; I thought that would allow the multiple lines, but it is not the case.
– ozsu
Aug 25 at 13:44





@ozsu You're welcome, you can do that, but you need to have the enough length set for text width, and the \[-3pt] won't be needed for line breaking.
– jak123
Aug 25 at 14:54



text width


\[-3pt]






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)