Hot answers tagged

6

There are several ways of achieving that without nesting tikzpictures. You could for example first draw the five circles as nodes, then draw the dots and lines relative to those circles, and finally draw lines between the circles. In the code below I define a macro \drawdots that draws the three dots in each circle, for convenience. It takes one argument, ...


5

See, if the following MWE gives what you like to obtain: \documentclass[10pt]{article} \usepackage{tikz} \usetikzlibrary{positioning, shapes, arrows} \begin{document} \begin{tikzpicture}[ node distance=3mm, class/.style = {shape=rectangle, rounded corners, draw, top color=blue!15, bottom color=blue!5, minimum ...


5

As Alenanno explained, it's not a good idea to nest tikzpictures. If you want to nest nodes there are several options. One of them is shown in following code. It uses fit library to define a node which contains inner node and its label. (I've declared Caption as inner label, although it could be another non drawn node). \documentclass[border=1pt, ...


4

One possibility is to use polar coordinates to place nodes at arbitrary positions: \documentclass[tikz,border=1pt]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \node (A) {A}; %How to have a fourth node above A that is not on top of B,C or D? \node at (A) [shift=(36 :1cm)] (B) {B}; \node at (A) [shift=(72 :1cm)] (C) {C}; ...


4

Hadn't seen that library before, perhaps because it is a third-party library, and not discussed in the TikZ manual. The only documentation seems to be a short readme file, so I had a look at the code of the library itself. The library file can be found by running kpsewhich tikzlibrarybayesnet.code.tex in a terminal, on my system it is found in ...


3

Another solution. It uses width function to define node's size. As the same parameter is used as node contents and size delimiter, node's name and position must be declared before options or inside options. \documentclass[border=2mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}% [square/.style={% draw, ...


3

Use the current bounding box instead of naming the node. To do this, you can replace your \path command with \draw[very thick](current bounding box.south west) -- (current bounding box.south east); \documentclass{article} \usepackage{tikz} \newcommand{\LabelText}[3]{% \begin{tikzpicture}[baseline=(LabelText.base)] \node[ text ...


3

Probably it's not what you want but if there is no better solution ... \documentclass[tikz]{standalone} \usetikzlibrary{positioning,shapes.multipart} \begin{document} \begin{tikzpicture}[mynode/.style={rectangle split, rectangle split parts=2, draw, node contents=#1}, mynode/.default={A\nodepart{two}B}] \node (A) [mynode]; \node[right=5mm of A] (B) ...


3

Quick fix: You can for example use specific anchors, for example set left=of NodeB.north west,anchor=north east, and vice versa for the other. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,shadows,shapes,arrows} \tikzset{abstract/.style={rectangle, draw=black, rounded corners, fill=blue, drop shadow, text centered, anchor=north, ...


2

You cannot use Thing to create multipart nodes in graphs if you also want it to create multipart nodes outside them. However, you can create a similar style thing for use within graphs. This needs to use as rather than node contents to specify the contents of the node. For example, if we write thing/.style={ circle split, ...


2

Something like this? \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning, fit} \tikzset{ object1/.pic={ \node[circle,draw] (-A) {A}; \node[circle,draw, right=of -A] (-B) {B}; \node[circle,draw, above right=5mm and 1cm of -A] (-C) {C}; \draw[->] (-A)--(-C); \draw[->] (-C)--(-B); ...


2

There are several possible problems. The only obvious problem in your snippet is that you have empty lines inside the equation environment, which is not permitted. That said, egreg is correct in saying that you cannot have an equation environment inside a node, unless you set the text width of the node. That makes the node a minipage like box, and makes it ...


2

Imho you are looking for the overlay unbroken and first key: \documentclass{article} \usepackage[left=60pt,top=60pt,right=60pt,bottom=60pt]{geometry} \usepackage{xcolor} \usepackage{lipsum} \usepackage{kantlipsum} \usepackage{enumitem} \usepackage[many]{tcolorbox} \setitemize{nolistsep,labelsep=1ex,leftmargin=*} %% colors--- ...


2

like this : \documentclass[border=1pt, tikz]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[draw=black, scale=1, transform shape , every node/.style = {rectangle, draw=black, align=center, inner xsep=6mm, inner ysep=3mm} ] % change default arrow style \tikzset{very thick, ->, -latex, shorten <=0pt, ...


2

You can modify Gonzalo's code (from the accepted answer to the question you refer to) to only have text, for example \documentclass[border=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{chains} \begin{document} \begin{tikzpicture}[thick] % the vertices of U \begin{scope}[start chain=going below,node distance=7mm] \foreach [count=\i] ...


2

You could do this, though I'm not at all clear why you need to use label so I'm not at all sure this is an option. \documentclass[tikz,multi,border=10pt]{standalone} % code for sub-nodes (in the non-tikzmark sense) from Mark Wibrow: https://groups.google.com/d/msg/comp.text.tex/yunrzHUfSUk/y3x-QWP7sJ0J \makeatletter ...


2

\documentclass{standalone} \usepackage[french]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{backgrounds, shapes} \begin{document} \begin{tikzpicture}[background rectangle/.style={draw=blue!50,fill=blue!10, rounded corners=1ex}, show background rectangle] \node[name=s1, signal, minimum ...


2

I found two ways to deal with it. One is to modify the \LabelText macro to embrace the use of #1 as in \newcommand{\LabelText}[3]{% \begin{tikzpicture}[baseline=(LabelText.base)] \node [ text width=width("{#1}"), text centered, draw=none, thick, rectangle, inner sep=0pt, outer sep=0pt, fill={#3}, ] ...



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