# Tag Info

## Hot answers tagged nodes

17

A recommended solution with PSTricks (plus supporting Chinese characters as you are living in Macau, China), just for best-practitioners. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-eucl} \usepackage{CJKutf8} \newsavebox\IBox \begin{document} \begin{CJK}{UTF8}{bsmi} \savebox\IBox{中} \begin{pspicture}[showgrid=false](5.75,4.25) ...

17

In this case it is pretty simple to use the calc and intersections library: \documentclass[tikz,border=0.125cm]{standalone} \usetikzlibrary{calc,intersections} \begin{document} \begin{tikzpicture} \path [rotate=60] (0,0) coordinate (A) (-2,-3) coordinate (B) (0,-3) coordinate (C) ($(B)!2!(C)$) coordinate (D) ($(A)!0.5!(B)$) coordinate ...

9

Add the options remember picture and overlay to the connecting drawing commands: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{arrows,shapes,trees,positioning} \author{Apurba Paul} \begin{document} ...

7


6


6

Use the remember picture option on both figures and then insert a third one with overlay option to connect them. Note the use of the decorations.pathreplacing library and the changing of node's anchors to adjust the position of the brace. Also you can control the distance of the brace using the option raise=5pt. \documentclass{report} \usepackage{tikz} ...

6

Section 39.4.3 of the Tikz manual helped me to get a clean solution in which two root nodes can be directly connected using a circle connection bar path: \documentclass[landscape]{article} \usepackage{tikz} \usetikzlibrary{mindmap} \pagestyle{empty} \begin{document} \begin{tikzpicture}[small mindmap, outer sep=0pt, text=black] \begin{scope}[concept ...

6

This is a solution via TikZ matrix node Code \documentclass[tikz,border=1cm]{standalone} \usetikzlibrary{matrix, shapes, arrows, positioning} \usepackage{xcolor} \begin{document} \begin{figure} \begin{center} \tikzset{% decision/.style = {diamond, draw, fill=blue!20, text width=5em, text badly centered, inner sep=0pt}, block/.style = {rectangle, ...

6

The path is treated as a single object and therefore the segments themselves can't have arrows. But you can easily draw the path in a loop, and then each segment can have its own arrow: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture}[auto, block/.style = {rectangle, draw}] \matrix[every node/.style = ...

6

The difference between right of= and right=of is that the first one uses the center of the node as reference point and the second one uses the border. And with the second one it works. \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing,shapes,arrows,positioning} \usetikzlibrary{calc} \usepackage[]{xcolor} ...

5

This can be achieved using the fit library, using for example \node[draw=red,double,fit=(un) (montreal) ,inner sep=1ex,circle] (tmp) {}; Note that in the code below I have used tikzset instead of tikzstyle as described in Should \tikzset or \tikzstyle be used to define TikZ styles? % arara: pdflatex \documentclass{beamer} \usepackage{tikz} ...

4

Just for fun with PSTricks. \documentclass[preview,border=12pt,12pt]{standalone}% change it back to your own document class \usepackage{amsmath} \usepackage{pst-node} \begin{document} \displaystyle \! \begin{gathered} y = [\rnode[b]{L}{\frac{a}{b}}\rnode[b]{R}{\frac{c}{d}}]\\[12pt] \rnode[t]{LT}{\text{First part}}\qquad \rnode[t]{RT}{\text{Second part}} ... 3 Without tikz: \documentclass{article} \usepackage{MnSymbol} \usepackage{stackengine} \renewcommand\useanchorwidth{T} \usepackage{graphicx} \stackMath \begin{document} \[ y = \bigg[ \def\stackalignment{r} \stackunder{% \stackunder{\displaystyle\frac{a}{b}}{\scalebox{2}{\swarrow}\,}% }{\scriptstyle\mathsf{First~Part}~~} \def\stackalignment{l} ... 3 Time to call \foreach. \documentclass{report} \usepackage{tikz,calc} \begin{document} \begin{tikzpicture} \foreach \a in {1,2,...,17}{ \draw (\a*360/17: 4cm) node{angle \a}; } \end{tikzpicture} \end{document} 3 This may not be the solution you want, but it works. BTW, could you at least try to create a MWE which is minimal and working, but still has the problem. \documentclass{article} \usepackage{tikz} \usepackage{caption} \usetikzlibrary{shadows} \begin{document} \begin{figure}[t] \centering \begin{tabular}{cc} \begin{tikzpicture}[thick,scale=0.5,every ... 3 Why array and why two tikzpictures? (That leaves me confused whether MM is in math mode or not). It can be done like this: \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{tikzpicture} \draw[thick] (0,0) -- (0,9); %% the line \foreach \y in {0,1,...,9}{ \draw (-.1,\y) -- ... 2 The culprit seems to be text width. If you change it to minimum width, then the texts will be centered properly. Code \documentclass[border=2pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \tikzset{ treenode/.style = {align=center, inner sep=1pt, font=\sffamily}, arn_m/.style = {treenode, rectangle, rounded corners=1mm, ... 2 Your code is far away to be MWE and it also has some errors. So it is difficult to see, what is the problem. From the MWE below you can see, that with proper use of subfloats from subfig package you obtain nice figure on half of page: \documentclass{article} \usepackage{caption,subfig} \usepackage{tikz} \begin{document} \begin{figure}\centering ... 2 Don't load MnSymbol just for \udots; the symbol can be defined in a different way. For the diagram there's tikz-cd \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tikz} \usepackage{tikz-cd} \providecommand{\udots}{\Udots} \makeatletter \DeclareRobustCommand{\Udots}{% \vcenter{\offinterlineskip \halign{% \hbox to ... 2 With PSTricks' ultimate macro \curvepnodes. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-node,pst-plot} \degrees[10] \begin{document} \makeatletter \begin{pspicture}(-3,-3)(3,3) \curvepnodes[plotpoints=11]{0}{10}{2.7 t \pst@angleunit PtoC}{A} \psnccurve[showpoints](0,9){A} \multido{\i=0+1}{10}{\uput[\i](A\i){A_{\i}$}} ... 2 May be I don't understand, but xshift works for me. \draw [decorate,decoration={brace,amplitude=10pt},xshift=-0.5cm,yshift=0pt] (0.5,0.5) -- (0.5,5.0) node [black,midway,xshift=-0.6cm] {\footnotesize$P_1$}; Full code \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{tikzpicture}[scale=1] ... 2 Thanks to input from @HKumar here's a fix that uses two xshift commands - one xshift for each of the centres of the nodes which are joined by the brace. It still would be nice to know why one xshift doesn't move the whole brace as experimentation with the first xshift value in the \draw [decorate,decoration= below seems to have no effect. ... 2 There are various problems with your code. First, multirooted structures are not formally trees, so you can't expect tree drawing packages to handle them directly. See the following question for more discussion on techniques for this: Multi-rooted Tree-like Structures and Nodes with Multiple Parents in LaTeX Furthermore, the syntax for a gb4e example ... 1 It was Harish's answer that led me to the line of thinking that took me to this answer. However, I am posting it as a separate answer because it's quite different in the end. Harish, your answer was very competent and gave good results, I just found myself asking whether there was a way to do it without fudging things (for example, where does shorten <= ... 1 Next code shows a possibility. It consists in drawing a bigger mindmap on background layer. In this case it has been easy because you already used every node/.style={scale=0.8}, so changing it to scale=0.85 everything grown up. Concepts with border are drawn in black (or whatever color you prefer for border) and the other ones are drawn in white (or whatever ... 1 You can accomplish this by setting fixed text height and text depth settings. I used this piece of code, originally for lining up expressions in commutative diagrams: \tikzstyle{inline text}=[text height=1.5ex, text depth=0.25ex, yshift=0.5mm] but it also seems to work pretty well for other kinds of diagrams. 1 The solution was to add anchor=center in the /.style. Thanks Mark! \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,calc} \tikzset{add/.style n args={4}{ draw, circle, minimum width=6mm, path picture={ \draw (path picture bounding box.south east) -- (path picture bounding box.north west) ... 1 Here's a non-tikz approach: \documentclass{article} \usepackage{graphicx} \usepackage{stackengine} \begin{document} \stackinset{c}{} {c}{ 2.3ex}{N}{% \stackinset{c}{} {c}{-2.3ex}{S}{% \stackinset{c}{ 2.3ex}{c}{} {E}{% \stackinset{c}{-2.3ex}{c}{} {W}{% \scalebox{3.5}{$\bigotimes\$}% }}}} \end{document}

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