How do I get rid of polarity signs of source? - latex

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}

Related

Latex beamer error: argument of \language#active#arg" has an extra }. \end{frame}

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}

Place boundary of two adjacent nodes on top of each other

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}

How can I write the code of bellow figure in Latex?

Help me to write the code of given figure in Latex.
To give you something to start with:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[blue,draw=black] (0,0) arc [start angle=180, end angle=0, radius=6];
\fill[violet,draw=black] (0,0) arc [start angle=180, end angle=0, radius=5];
\fill[red,draw=black] (0,0) arc [start angle=180, end angle=0, radius=4];
\fill[orange,draw=black] (0,0) arc [start angle=180, end angle=0, radius=3];
\fill[yellow,draw=black] (0,0) arc [start angle=180, end angle=0, radius=2];
\foreach \x in {0,...,6}{
\node at (2*\x,-0.3) {\x};
}
\end{tikzpicture}
\end{document}
My version with some cycles:
\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \n in {0,...,6} \node [below] at (\n,0) {$\n$};
\foreach \m/\c in {6/0,5/25,4/50,3/75,2/100}%
\filldraw [black,fill=lime!\c!blue] (\m,0) arc(0:180:.5*\m) -- cycle;
\foreach \n in {1,...,5} \node [above] at (\n+.5,.1) {$\mathcal{U}_{\n}$};
\draw (0,0) -- (7,0);
\draw (1,.08) -- (1,-.08);
\end{tikzpicture}
\end{document}

How do I to fill the regions of the petals?

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}

How do I draw other circle to the right instead of under?

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}

Resources