{nodes} is about nodes in {diagrams}.
33
votes
1answer
3k views
Difference between “right of=” and “right=of” in PGF/TikZ
In the PGF/TikZ manual, sometimes I see the option right of=somenode instead of right=of somenode. They look very similar, but the effects are different. The distance between nodes positioned with ...
27
votes
1answer
286 views
How can I know if a node is already defined?
I think I've seen this question before, but I can't find it. The problem is simple; before I assign a name to a node I would like to know if the name is already used.
I think when a node is created ...
24
votes
2answers
13k views
How to change the size of nodes?
How is it possible to change the size of a node, for example:
\begin{tikzpicture}
\draw node[fill,circle]{} (0,0);%
\end{tikzpicture}
How to make the circle smaller or larger?
23
votes
4answers
5k views
Node shapes TikZ
I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins.
One is for data ...
22
votes
3answers
6k views
Add more anchors to standard TikZ nodes
I frequently find myself needing more than the standard anchors TikZ nodes provide, i.e. north, north east, east and so forth. I usually use coordinate calculations for this, as in the example below, ...
21
votes
3answers
525 views
TikZ Nodes not exactly centered
In my solution to draw a plot with point, it was pointed out that the nodes containing \textbullet and $\circ$ were not placed exactly centered at the specified point. I found this hard to believe ...
19
votes
2answers
1k views
Defining a new environment whose contents go in a TikZ node
I would like to define an environment which typesets the contents in a box, and I'd like to use TikZ (I'm aware of alternatives like fancybox). So I would like something like
\newenvironment{abox}%
...
19
votes
3answers
2k views
How to place a node in the middle of an arc?
I think it is a simple question, but I didn't find the answer yet. The code I'm using is the following:
\draw[->](1,0) arc(0:-30:1) node[midway]{$30$};
But in this way the node is placed at the ...
18
votes
3answers
912 views
Fancy arrows with TikZ
I would like to draw an arrow like this using TikZ:
This is taken from Workflow diagram. I didn't succeed in reproducing the arrow; is somewhat beyond my (extremely limited) TikZ abilities. I don't ...
18
votes
3answers
3k views
TikZ: Bend text so that it follows a line
I have two arrows going from a node on the left to a node on the right. Both arrows are slightly bent. I want to label the arrows with text that is bent just like the arrows. This is as far as I've ...
18
votes
2answers
9k views
Tikz: Multi-line text in the node description
I use tikz to create pictures in latex.
My picture consists of set of nodes. Every node has its own text inside the node, for example, "This node is valuable":
\node (mynode) [mystyle,right=of ...
17
votes
2answers
462 views
Tikz: purely vertical arrow from nodeA.south to nodeB.north
I have the following tikz code
% compilation command: pdflatex --jobname=Diag-f1 Diag.tex
\documentclass{book}
\usepackage{tikz}
\pgfrealjobname{Diag}
\begin{document}
\beginpgfgraphicnamed{Diag-f1}
...
17
votes
4answers
11k views
TikZ set node label position more precisely
This seems like it should be really easy but I can't seem to find it anywhere...
I'd like to be able to fine-tune the positioning of a node label.
I'm aware of the ...
16
votes
2answers
414 views
How to modify nodes in TikZ to automatically add a line on their top?
In TikZ there is the very flexible node system. As a beginner I am still stumbling over a few details. How can I modify a node or create my own nodes easily? As an example I need a node with a thick ...
15
votes
3answers
263 views
How can I set the tikz label anchor explicitly?
I want to add a label to a node, but "inside" the node. Something like this:
The manual seems to indicate it might be possible, although no actual key is named.
The ... anchor point for the ...
15
votes
2answers
372 views
How to center a typewriter (ttfamily) '+'
I would like to draw a circular TikZ node with + in its center, but font=\ttfamily moves it up. Why? How to solve it?
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\begin{document}
...
15
votes
1answer
501 views
TikZ picture shapes
I am very new to the TikZ package, and I need to draw some flow chars by using the following shapes.
However I couldn't figure out how to draw the 4th and and 6th ones below. It would be very nice ...
14
votes
4answers
585 views
TikZ: difference between \node and \coordinate?
What is the difference between \node and \coordinate in TikZ? Exchanging them does no visual effect in my (to be honest: still simple) pictures.
When to use what?
14
votes
3answers
6k views
Tikz - How to Draw Boxes Around Set of Nodes
How to draw the boxes as shown in the attached image? I could only manage to draw the chart but could not highlight the desired node / nodes with a rectangle box. Preferably dotted. I could not draw ...
14
votes
3answers
2k views
Placing nodes along an ellipse in TikZ
Is anybody aware of a simple way to place nodes at arbitrary positions along an ellipse? Ideally I would want to mimic notation like
\draw (0,0) ellipse [ x radius=2, y radius = 1] node[pos=.3] ...
14
votes
1answer
2k views
Creating node shapes
I am currently learning how to use TikZ/PGF to make some figures for a project report, and so I have a question:
Is there is a practical way of making a particular object into a node?
The object ...
14
votes
1answer
677 views
Accessing the logic values of a TikZ coordinate
In TikZ accessing the coordinate values of a node can be done using the let syntax of the calc library or using the PGF command \pgfpointanchor. However, this values are dimensions/lengths in points ...
13
votes
3answers
3k views
TikZ - multi-color double circle node
How do I draw a node with a double circle shape where one circle has a different color than the other circle?
A single \node[whatever] {content} would be nice!
13
votes
2answers
456 views
Text over rectangular node
I am trying to create a new environment that will contain the following displayed counter (at least something like it):
\documentclass[letterpaper]{article}
\usepackage{amsmath,amssymb}
...
13
votes
4answers
3k views
Nested TikZ nodes
This isn’t the first time this question was asked but the other solutions don’t work in my case.
Consider the following image:
It was created using this code:
\begin{tikzpicture}[
node ...
13
votes
2answers
523 views
TikZ rectangle split parts with fixed height
I was wondering if there is a way to set the height of rectangle split parts. I had no luck finding something in the pgfmanual. (Using \phantom seems just like a quickfix.)
Here is an example to ...
13
votes
1answer
164 views
nodes structure like file system
I would like to draw a picture that reflects some file structure. Below code works almost as expected. I need to adjust the connections between nodes so they don't start from the center of the bottom ...
12
votes
5answers
1k views
Creating a node fitting the horizontal width of two other nodes
I have the two PGF nodes foo and bar positioned in a row.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[node ...
12
votes
3answers
4k views
How to set exact radius for a node?
I have a bunch of nodes and would like to size them so that their areas represent some numbers I have (so that if I have two nodes with corresponding values 1 and 2, then the second node's area should ...
12
votes
1answer
1k views
Bending arrows in Tikz
In Tikz, I would like to bend an arrow like the one between $H_2O$ and $O_2$ in this figure:
I'm able to have a bended line between $H_2O$ and $O_2$, but it's not touching the photophosphorylation ...
12
votes
1answer
714 views
TikZ style attribute for adding default node text?
Is there a TikZ style attribute for adding default text to a node? For instance, I want to be able to do something like the following:
\begin{tikzpicture}[%
stuff/.style={%
draw,
text=Bla ...
12
votes
1answer
368 views
Nested node class with pictogram decoration
I'm wondering how can I define custom TikZ node class mynode thats allows my to use following syntax:
\node [mynode,fill=yellow!40] {component}
\child{
\node [mynode,fill=yellow!40] ...
11
votes
2answers
139 views
How to define an environment that begins with a node?
Please see the following definition:
\tikzstyle{boxStyle} = [draw=blue!80, fill=blue!9, very thick,
rectangle, rounded corners=3mm, inner sep=10pt, inner ysep=15pt]
...
11
votes
3answers
2k views
How can I align two nodes to the left in TikZ?
I have two unaligned nodes
|AAAAAAA|
|B|
and I want to have the node with the B aligned to the left of the node with AAAs and below it
|AAAAAAA|
|B|
How can this be done?
11
votes
2answers
1k views
How two connect any arbitrary nodes of tree in tikz
I need to be able to connect any arbitrary nodes in a tree to each other. I am using the tree package in tikz to create my tree. I cannot figure out though how to connect to nodes by let say a draw ...
11
votes
1answer
176 views
How can I put “=” in a TikZ node label specified as an option
When I try to put an = symbol into a TikZ node label specified as an option (using label=), I get an error:
Extra }, or forgotten $.
Is there a way to specify = in such cases that I'm missing?
...
11
votes
1answer
617 views
How to use “fit” to frame the nodes and labels
I'm using the fit TikZ library to fit a rectangle around two nodes which include labels. However, the rectangle is only fit around the actual nodes, not about their labels:
\documentclass{article}
...
10
votes
2answers
536 views
How to avoid covering nodes with connection lines
When drawing connection lines (edge) between nodes, the lines will be drawn over the nodes (due to the drawing sequence). If having many connections, it may problematically cover the nodes, and ...
10
votes
1answer
511 views
macro for empty nodes in tikz-qtree
I'm trying to define a macro for writing empty nodes in a binary tree using tikz-qtree.
Referring to the code below, I want the string \missing in my code to be replaced by \edge[draw=none]; {} as-is ...
10
votes
1answer
340 views
Comprehensive list of TikZ style options?
I'm aware that one can use \tikzstyle{every label}=[...] to apply styles to every label within a tikzpicture; or \tikzset{mystyle/.style={...}} to apply style specs to a specific type of node mystyle ...
10
votes
2answers
202 views
TikZ: shade also the border of a node
I would like to shade a node and the border of the node.
The following code works but I don't like it very much that I have to draw something after the node on the background layer. I would prefer a ...
10
votes
1answer
172 views
Can I calculate the difference between two relatively positioned nodes with TikZ using calc?
I have a chart with relatively positioned nodes.
How do I calculate the horizontal distance x, between node "sub3" and node "key" and multiply that value by 2 and use it for the positioning of node ...
10
votes
1answer
3k views
tikz nodes: centering with small font
I am trying to create tikz nodes with centered text, but changing fontsize. Unfortunately, while normally-sized text is nicely centered inside the nodes, the smaller text is not centered, but shifted ...
9
votes
3answers
5k views
How to increase the horizontal distance between nodes?
I've got this Tikz picture and I'd like to increase the horizontal distance between the nodes while keeping the vertical distance unchanged. I know how to do it by placing the nodes manually using ...
9
votes
3answers
1k views
Put a node behind another in a TikZ diagram
I want to place a node, that is kind of a note, behind another node.
However, I need to put the reference node before the note, so I can place the note in a relative position to the reference node. ...
9
votes
3answers
228 views
parametric naming of nodes in Tikz
I would like to generate a graph with nodes and edges names by their coordinates in the graph, something like:
\foreach \x in {0,1,...,6}
\foreach \y in {1,...,4}
\draw (1.5*\x,2.5*\y) circle ...
9
votes
2answers
3k views
Path From and To Same Node in tikz Flowchart
I'm working on creating flowcharts directly inside LaTeX documents using tikz. I am admittedly an extreme novice with tikz, although I have quite a bit of experience using LaTeX.
My problem is when ...
9
votes
3answers
221 views
pgfplots - Add offset to pins
I'm trying to make a bar plot for an optimization parameter in quantum physics. To be more informative, the graph should display the values of these parameters above the bars. So far I did
...
9
votes
3answers
1k views
Horizontal row separation line in tikz matrix (like \hline in tabular)
In this question tikz-matrix-as-a-replacement-for-tabular a nice solution was given to let the matrix in tikz behave like tabular.
In this solution cell/.style={rectangle} was used to draw lines ...
9
votes
2answers
201 views
Rounded corners as a tangent in the right direction
I want to split a path into two branches as in the following MWE.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node (A) [rectangle] ...


