22

The \subnode command from tikzmark is designed for this sort of situation. It fakes a node around text that's inside a \node. It does need a few compilation runs to settle (it took 3 for this code for me) and you must remember the remember picture key on the tikzpicture. \documentclass{article} %\url{https://tex.stackexchange.com/q/582127/86} \usepackage{...


16

You just need to fix a minimum size large enough, but applied to state, not to the tikzpicutre: state/.style={circle, draw, minimum size=2cm} The symmetry can be obtained changing the drawing order: \documentclass{article} \usepackage{tikz} \usetikzlibrary{automata,arrows,calc,positioning} \begin{document} \begin{figure}%[H] \centering \...


15

Each "blob" can be drawn using a technique taken from this answer, but modified to use Hobby package which produces smoother results. In the next example I define a pic which draws one of these "blobs". Being a pic is very easy to rotate, scale and translate the shape, so I draw 35 of them in a regular grid. Instead of a regular grid you can use the random ...


14

You can put the node at pos=1 and then left (or right, depending on where) align it: \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[every node/.style={draw=red}, ] \draw (0,0) -- (1,0) node[right]{a} ; \draw (1,0.5) --node[pos=1, left]{b} (0,0.5) ; \draw (0,-1) -- node[pos=1, ...


14

Interesting, here a test of the commands, according to what I found that the dimension of the shapes in text nodes, in this case circle, depends on the text_node_content_shape_dimmension + the_internal_separation (inner sep); as it defines itself the minimum size, it would only define the size if the dimension of the text + the internal separation are less ...


12

at node with circle shape is radius equal to minimum size/2, of course if you set inner sep to zero. node features can define local at node or as new style with tikzpicture options or globally with tikzset in preamble of a document. for example: \documentclass[tikz, margin=3mm]{standalone} \begin{document} \begin{tikzpicture}[ dot/.style = {circle, fill, ...


11

Here is a modification of that code where you set the number of hidden layers in a macro, and the rest is done automatically. \documentclass{article} \usepackage{tikz} \begin{document} \pagestyle{empty} \def\layersep{1.5cm} \begin{tikzpicture}[ shorten >=1pt,->, draw=black!50, node distance=\layersep, every pin edge/.style={<-,...


11

One can get somewhat close using the decorations.markings library. The code below makes use of the fact that a markings decoration has an internal coordinate system where the x-axis is parallel to the path, so I made a short path along the y-axis, and placed an auto node along it. It's not perfect, and I can't guarantee that it will always work. For the ...


11

You need first to calculate value of the \x+1+5*\y and than use result as content of the node: \documentclass[tikz, margin=3mm]{standalone} \begin{document} \begin{tikzpicture} \foreach \x in {0,...,4} \foreach \y in {0,...,4} \pgfmathtruncatemacro{\xy}{\x+1+5*\y} % macro which calculate value of \x+1+5*\y \draw (\x*8-1,\y*8+1) ...


11

When using ellipse as a node shape, you need to load the shapes.geometric tikz library. You can do that by adding \usetikzlibrary{shapes.geometric} in your preamble (usually immediately) after \usepackage{tikz}. Note that you don't need shapes.geometric to draw an ellipse, only to use it as a node shape like in your example. If you use several shapes.xxx ...


10

Apparently the inner tikz inherits the text width setting. It is visible if you draw the nodes: The line goes from the center of node A to the center of node B, but the nodes are so wide that the text of node B ends up being left of the line. If you reset the text width option, you recover the expected behavior. \documentclass{minimal} \usepackage{tikz} \...


10

\documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning, shapes.multipart} \begin{document} \begin{tikzpicture} \node[rectangle split, rectangle split parts=3, rectangle split horizontal, draw]{\nodepart{two}ReadInput}; \end{tikzpicture} \end{document} Update: Following code shows an improved version of previous code. It shows font and ...


10

As supplement to the Étienne answer: Tik Z & PGF Manual for Version 2.10-CVS is obsolete for years, I strongly recommend to use the recent version of the package as well as its manual. Actual version of TikZ manual is 3.1.5b (January 8, 2020), where your example is on page 141. Shapes Library is described in chapter 72 Shape Library starting at page 785,...


9

This solution uses a path picture option to fill part of the circle. It doesn't need backgrounds library. The pienode style is defined with 2 arguments, the first defines circle minimum size and the second is the percentage (0 to 100) to be filled. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning, calc} \begin{document} \begin{...


9

As Torbjørn says in the comment, nesting tikzpictures doesn't work well. Here's an alternative using the \subnode command from the tikzmark package (which was designed precisely for this sort of thing). \documentclass{article} %\url{https://tex.stackexchange.com/q/387792/86} \usepackage{tikz} \usetikzlibrary{tikzmark} \begin{document} \begin{tikzpicture} ...


9

To the upvoters: please don't upvote this very trivial answer! Use \draw[fill=white, thick] instead of the simple \fill[white]. Moreover, you don't need to write the path of your gray area twice, one to fill and one to draw, you can do it with a unique command (I added very thick only to highlight it). As percusse pointed out in his comment, you can use ...


9

(this is the first time I add another answer --- if it's not the correct thing to do, please tell me; but this is so different from my first one that... should I mark it community wiki?) You can use a transform on a decoration, thanks to the fact that the coordinate system in a decoration is along the path; that will shift the node after the end of the ...


9

This is what the auto option does. By default it places the nodes on the left side of the line, looking along the path. You can move it to the other side by adding the swap option. \documentclass[border = 2mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[ every node/.style={inner sep=0pt} % to make it clearer which line the nodes ...


9

as i mentioned, merging bot tikzpictures in one enable better controlling their elements positions: edit: position of braces are corrected acoording to new explanation in question \documentclass[a4paper]{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} % tikz library should be here, in preamble \begin{document} \begin{figure}[htb] ...


8

I'm not sure I've understood correctly, but do you want something like this? \documentclass[border=10pt,multi,tikz]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \node (circle) [draw, circle, minimum size = 20mm, label=above:$I$] at (0, 0) {}; \draw (circle.center) [{Rays[]}-|] -- (circle.east) node[below, midway] {$r$}; ...


8

you can use minimum size=6em \documentclass{article} \usepackage{tikz} \usetikzlibrary{automata,arrows,calc,positioning} \begin{document} \tikzset{bignode/.style={red, draw=blue, fill=yellow!20, minimum size=6em,}} { \centering \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2.5cm,scale=1, transform shape,align=center,...


8

It is very simple, if you use the coordinate (nodea -| nodeb) you have the y coordinate of nodea and the x coordinate of nodeb. Off-topic: see also Should \tikzset or \tikzstyle be used to define TikZ styles?. \documentclass[tikz]{standalone} \usepackage{mathtools} \usetikzlibrary{shapes,arrows.meta} % Define block styles \tikzset{ ...


8

\documentclass[border = 5pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{positioning} \usetikzlibrary{shadows.blur} \begin{document} \begin{tikzpicture}[ reserv/.style = { draw = #1, fill = #1!50, text = white, rounded corners = 5pt, minimum width = 6cm, minimum height = 1cm, inner sep = 1pt, drop shadow }, ...


8

Combining minimum width with single arrow head extend seems buggy. Use inner sep instead to define the inner width: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes.arrows} \begin{document} \begin{tikzpicture} \node [single arrow,draw,inner sep=1cm,minimum height=4cm, single arrow head extend=0.8cm,anchor=west] (a) {}; \draw[|<-...


7

There is a paragraph indentation. The white space is gone with \noindent: \documentclass[oneside]{scrartcl} \usepackage{tikz} \usepackage[margin=0cm]{geometry} \begin{document} \noindent \tikz \fill[red] (current page.north west) rectangle (current page.south east); \end{document}


7

The problem is that TikZ uses . to access an anchor of a node, for example a.west. So when you have a node called 2.5g2y, and use that in a \draw, TikZ thinks that is a node called 2, and the anchor would be 5g2y. I don't know if it's possible to use periods in node names, but a workaround is to add a count to your loop, and use that value instead. ...


Only top voted, non community-wiki answers of a minimum length are eligible