If I place two nodes adjacent to each other the resulting boundary between the nodes is doubled making it more thick than other boundarys. Is it possible to place them on top of each other in order to keep the original thickness?
Here my code and below some example pictures:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}
\tikzstyle{node} = [draw, rectangle, minimum width=1cm]
\node [node] (n_one) {node 1};
\node [node, right = 0cm of n_one.north east, anchor = north west] (n_two) {node 2};
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
You can shift the right node by one line width:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}
\tikzstyle{node} = [draw, rectangle, minimum width=1cm]
\node [blue,node] (n_one) {node 1};
\node [red,node, right = -\the\pgflinewidth of n_one.north east, anchor = north west] (n_two) {node 2};
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
Or you could draw only a single node:
\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes.multipart}
\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}
\node[
rectangle split,
rectangle split parts=2,
draw,
rectangle split horizontal,
rectangle split part align={center, top, bottom}
] at (0,0) {node 1\nodepart{two}node 2};
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
Related
I'm trying to put together a presentation using latex beamer. I drew a triangle using the tikz package but I can't put the names on the angles. When executing the code, the following error appears: "Argument of \language#active#arg" has an extra }. \end{frame}"
The code is:
\documentclass[xcolor=dvipsnames,10pt,serif]{beamer} % serif, mathserif
\usepackage[english,brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ae}
\setbeamertemplate{caption}[numbered]
\setlength\abovecaptionskip{-3pt}
\setbeamertemplate{caption}[numbered]
\setbeamerfont{caption}{size=\scriptsize}
\usefonttheme[onlymath]{serif}
\usepackage{color}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amstext}
\usepackage{mathrsfs}
\usepackage{icomma}
\usepackage{bm}
\usepackage{steinmetz}
\usepackage{tikz}
\usepackage{adjustbox}
\usepackage{subfigure}
\usepackage{ragged2e}
\usepackage{tkz-euclide}
\usetikzlibrary{angles,quotes,babel}
\DeclareMathOperator{\sen}{sen}
\mode<presentation>
{
\usetheme{CambridgeUS}
}
\begin{document}
\begin{frame}{Frame Title}
\begin{figure}
\begin{tikzpicture}
\coordinate (C) at (-1.5,-1);
\coordinate (A) at (1.5,-1);
\coordinate (B) at (1.5,1);
\coordinate (D) at (1.5,-3);
\node [below] at (3,-1) {$\Re$};
\node [above] at (-1.5,2) {$\Im$};
%draw cartesian plane
\draw[stealth-stealth] (-1.5,-4) -- (-1.5,2) coordinate (y axis);
\draw[-stealth] (C) -- (3,-1) coordinate (x axis);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}] (C) --
node[font=\Large,sloped,above] {$S_{abc}$} (B);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}](A) --
node[font=\Large,pos=0.7,right] {$Q_{abc}$} (B);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}](C) --
node[font=\Large,pos=0.8,above] {$P_{abc}$} (A);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}](C) --
node[font=\Large,sloped,below] {$S_{abc}$} (D);
\draw[very thick,{Stealth[length=3mm, width=1.5mm]}-](D)--
node[font=\Large,pos=0.3,right] {$-Q_{abc}$} (A) ;
\pic[thick,"$\theta$", draw=blue,-stealth, angle eccentricity=1.2, angle radius=1cm]
{angle=A--C--B};
\pic[thick,"$\theta$", draw=red, stealth-, angle eccentricity=1.2, angle radius=0.9cm]
{angle=D--C--A};
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
Can anybody help me?
If you have fragile content in your frame, like certain tikz pictures, use the fragile frame option.
Some other comments:
the serif class option is obsolete. A warning in the log file will tell you to use the serif font theme instead, but as you already do this, there is really no reason to use this class option
if your tex distribution isn't terrible outdated, you no longer need \usepackage[utf8]{inputenc}
there are two \setbeamertemplate{caption}[numbered]
you don't need color and the ams* packages, beamer already loads them for you
\documentclass[xcolor=dvipsnames,10pt]{beamer} % serif, mathserif
\usepackage[english,brazil]{babel}
%\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ae}
\setbeamertemplate{caption}[numbered]
\setlength\abovecaptionskip{-3pt}
%\setbeamertemplate{caption}[numbered]
\setbeamerfont{caption}{size=\scriptsize}
\usefonttheme[onlymath]{serif}
%\usepackage{color}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
%\usepackage{amstext}
\usepackage{mathrsfs}
\usepackage{icomma}
\usepackage{bm}
\usepackage{steinmetz}
\usepackage{tikz}
\usepackage{adjustbox}
\usepackage{subfigure}
\usepackage{ragged2e}
\usepackage{tkz-euclide}
\usetikzlibrary{angles,quotes,babel}
\DeclareMathOperator{\sen}{sen}
\mode<presentation>
{
\usetheme{CambridgeUS}
}
\begin{document}
\begin{frame}[fragile]
\frametitle{Frame Title}
\begin{figure}
\begin{tikzpicture}
\coordinate (C) at (-1.5,-1);
\coordinate (A) at (1.5,-1);
\coordinate (B) at (1.5,1);
\coordinate (D) at (1.5,-3);
\node [below] at (3,-1) {$\Re$};
\node [above] at (-1.5,2) {$\Im$};
%draw cartesian plane
\draw[stealth-stealth] (-1.5,-4) -- (-1.5,2) coordinate (y axis);
\draw[-stealth] (C) -- (3,-1) coordinate (x axis);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}] (C) --
node[font=\Large,sloped,above] {$S_{abc}$} (B);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}](A) --
node[font=\Large,pos=0.7,right] {$Q_{abc}$} (B);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}](C) --
node[font=\Large,pos=0.8,above] {$P_{abc}$} (A);
\draw[very thick,-{Stealth[length=3mm, width=1.5mm]}](C) --
node[font=\Large,sloped,below] {$S_{abc}$} (D);
\draw[very thick,{Stealth[length=3mm, width=1.5mm]}-](D)--
node[font=\Large,pos=0.3,right] {$-Q_{abc}$} (A) ;
\pic[thick,"$\theta$", draw=blue,-stealth, angle eccentricity=1.2, angle radius=1cm]
{angle=A--C--B};
\pic[thick,"$\theta$", draw=red, stealth-, angle eccentricity=1.2, angle radius=0.9cm]
{angle=D--C--A};
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
The original images that I want:
Left me to fill the regions. Can somebody help me? My LaTeX code:
\documentclass[border=5mm]{standalone}
\usepackage[svgnames,x11names,dvispnames]{xcolor}
\usepackage{tikz,tkz-base,tkz-euclide,tkz-fct}
\begin{document}
\begin{tikzpicture}
\tkzDefPoints{0/0/A, 6/0/B}
\tkzDefSquare(A,B) \tkzGetPoints{C}{D}
\tkzDrawPolygon(A,B,C,D)
\tkzDefMidPoint(A,B) \tkzGetPoint{M}
\tkzDefMidPoint(A,D) \tkzGetPoint{N}
\tkzDefMidPoint(B,C) \tkzGetPoint{O}
\tkzDefMidPoint(C,D) \tkzGetPoint{P}
\tkzDrawSemiCircle(M,B)
\tkzDrawSemiCircle(N,A)
\tkzDrawSemiCircle(O,C)
\tkzDrawSemiCircle(P,D)
%\tkzLabelPoints(A,B,C,D,M,N,O,P)
\end{tikzpicture}
\end{document}
\documentclass[border=5mm]{standalone}
\usepackage[svgnames,x11names,dvispnames]{xcolor}
\usepackage{tikz,tkz-base,tkz-euclide,tkz-fct}
\begin{document}
\begin{tikzpicture}
\tkzDefPoints{0/0/A, 6/0/B}
\tkzDefSquare(A,B) \tkzGetPoints{C}{D}
\tkzDrawPolygon(A,B,C,D)
\tkzDefMidPoint(A,B) \tkzGetPoint{M}
\tkzDefMidPoint(A,D) \tkzGetPoint{N}
\tkzDefMidPoint(B,C) \tkzGetPoint{O}
\tkzDefMidPoint(C,D) \tkzGetPoint{P}
\begin{pgfinterruptboundingbox}
\begin{scope}
\tkzClipCircle(N,A)
\tkzDrawSemiCircle[fill=blue,draw=none](M,B)
\tkzDrawSemiCircle[fill=yellow,draw=none](P,D)
\end{scope}
\begin{scope}
\tkzClipCircle(O,B)
\tkzDrawSemiCircle[fill=red,draw=none](M,B)
\tkzDrawSemiCircle[fill=green,draw=none](P,D)
\end{scope}
\end{pgfinterruptboundingbox}
\tkzLabelPoints(A,B,C,D,M,N,O,P)
\end{tikzpicture}
\end{document}
I have this
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\tikzset{
mycirc/.pic={
\foreach \w in {0,0.5} {
\draw (0,\w) circle (0.5cm);
}
}
}
\begin{tikzpicture}
\pic at (2,2) {mycirc};
\end{tikzpicture}
\end{document}
The code draws to circles intersecting. I want the circles to intersect from the right instead of from under. How do I do it?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\tikzset{
mycirc/.pic={
\foreach \w in {0,0.5} {
\draw (\w,0) circle (0.5cm);
}
}
}
\begin{tikzpicture}
\pic at (2,2) {mycirc};
\end{tikzpicture}
\end{document}
My code
\documentclass[11pt,twoside]{report}
\usepackage[american]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw
(0,0)
to[sV, v<=$V$] ++(0,2.5)
to[R, l=$R$,i=$i$,-o] ++(3.5,0)
to[open, v^=$~~U$] ++(0,-2.5)
to[short,-o] ++(0,0)
--(0,0)
;
\end{circuitikz}
\end{document}
Gives me
I want
How do I remove polarity signs from the voltage source?
\documentclass{standalone}
\usepackage[
american,
]{circuitikz}
\begin{document}
\begin{circuitikz}[]
\draw
(0,0)
to[sV, voltage/american plus/.initial={}, voltage/american minus/.initial={}, v<=$V$] ++(0,2.5)
to[R, l=$R$,i=$i$,-o] ++(3.5,0)
to[open, v^=$~~U$] ++(0,-2.5)
to[short,-o] ++(0,0)
--(0,0)
;
\end{circuitikz}
\end{document}
I'm using TikZ for the first time and I don't know how to draw this taxonomy figure.
I only managed to draw 2 columns, with the following code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,snakes,positioning,shapes.misc}
\begin{document}
\begin{tikzpicture}
\node at (-3,1) [rectangle, aspect=0.5, draw=black!60,fill=black!20, inner sep=3pt, text width=2cm,,align=center](a){text text text};
\node at (-9,-1) [rectangle,draw](b1){text2};
\node at (-8.7,-2) [rectangle,draw](b2){text3};
\node at (-8.7,-3) [rectangle,draw](b3){text4};
\node at (-8.7,-4) [rectangle,draw](b4){text5};
\node at (-8.7,-5) [rectangle,draw](b5){text6};
\draw[->,thick] (a)--(0,0)--(-9,0);
\draw[->,thick] (-9,0)--(b1);
\draw[->,thick] ([xshift=0cm,yshift=0cm]b1.210)|-([]b2.west);
\draw[->,thick] ([xshift=0cm,yshift=0cm]b1.210)|-([]b3.west);
\draw[->,thick] ([xshift=0cm,yshift=0cm]b1.210)|-([]b3.west);
\draw[->,thick] ([xshift=0cm,yshift=0cm]b1.210)|-([]b4.west);
\draw[->,thick] ([xshift=0cm,yshift=0cm]b1.210)|-([]b5.west);
%%%%%%%%%%%%%%%%%%%%%%%
\node at (5,-1) [rectangle,draw](c1){text2};
\node at (4.7,-2) [rectangle,draw](c2){text3};
\node at (4.7,-3) [rectangle,draw](c3){text4};
\draw[->,thick] (a)--(0,0)--(5,0);
\draw[->,thick] (5,0)--(c1);
\draw[->,thick] ([xshift=0cm,yshift=0cm]c1.330)|-([]c2.east);
\draw[->,thick] ([xshift=0cm,yshift=0cm]c1.330)|-([]c3.east);
\end{tikzpicture}
\end{document}
You can use the forest package instead of trying to draw it manually with tikz. Then, it's easier to change the actual content (node, number of columns, etc.):
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{arrows.meta}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
line width=0.5pt,
draw=black,
fit=rectangle,
edge={color=black,>={Triangle[]}, ->},
if level=0{%
l sep+=1cm,
for descendants={%
calign=first,
},
align=center,
parent anchor=south,
}{%
if level=1{%
parent anchor=south west,
child anchor=north,
tier=three ways,
align=center,
for descendants={%
child anchor=west,
parent anchor=west,
align=left,
anchor=west,
xshift=-20pt,
edge path={
\noexpand\path[\forestoption{edge}]
(!to tier=three ways.parent anchor) |-
(.child anchor)\forestoption{edge label};
},
},
}{}%
},
}
[Drawing Diagrams
[Operational
[Offloading\\method
[Cost\\benefit\\analysis
[Mobility\\management
[Connection\\protocol]
]
]
]
]
[End user
[Incentives
[Presentation\\and usability]
]
]
[Service level
[Performance
[Cloud APIs]
]
]
]
\end{forest}
\end{document}