TeX - LaTeX Asked by Elec on February 14, 2021
This might be a simple question, but I would like the battery positive pole to be to the left, and to the right as the default,
(0,0) to [battery, v=$varepsilon$] (2,0)
Also, is there an option within circuitikz
to draw only one pair of poles instead of 2? I have seen the following solution
Battery symbol in circuitikz
but I would be happy to know if a circuitikz
solution exists.
The easiest way I can come up with is to simply reverse the direction in which you place the battery
. So instead of draw (0,0) to [battery, ...] (2,0)
you use draw (2,0) to [battery, ..] (0,0)
(as is the case in the second example below).
If you do not want to reverse the direction in which you place the nodes, you could use rotate=180,transform shape
option. This unfortunately also ends up producing a mirror image of the text, which can be remedied by applying a rotatebox{180}{}
to the voltage label (two 180 rotations of the text returns the text back to the original orientation).
By default, this place the direction arrow at the bottom. If you desire this at the top, you can use circuitikzbasekey/bipole/voltage/position =below
as is the case in the examples below:
documentclass{article}
usepackage{tikz}
usepackage{circuitikz}
begin{document}
begin{tikzpicture}
draw (0,0) to [battery, v=$varepsilon$] (2,0) node [right] {Default};
end{tikzpicture}
medskip
begin{tikzpicture}
draw (2,0) node [right] {Reverse coordinates} to
[battery, v=$varepsilon$,
circuitikzbasekey/bipole/voltage/position = below] (0,0) ;
end{tikzpicture}
medskip
begin{tikzpicture}
draw (0,0) to
[rotate=180,transform shape,
battery, v=rotatebox{180}{$varepsilon$},
circuitikzbasekey/bipole/voltage/position = below] (2,0)
node {Rotate text and symbol};
end{tikzpicture}
end{document}
Answered by Peter Grill on February 14, 2021
To change the circuitikz defaults you may have to alter its .sty and .tex files. Instead you can change direction of the battery terminals by changing the order of the component directions. You can also use circuitikz' label mechanism (l^ and l_) to place the name above or below the component.
documentclass{article}
usepackage{tikz}
usepackage[european,american]{circuitikz}
begin{document}
begin{tikzpicture}
draw (0,0) to [battery, l^={$varepsilon$}] (2,0);
end{tikzpicture}
begin{tikzpicture}
draw (2,0) to [battery, l_={$varepsilon$}] (0,0);
draw (4,0) to [battery, l^={$varepsilon$}] (3,0);
end{tikzpicture}
end{document}
Answered by zun on February 14, 2021
In recente versions of Circuitikz, you can use the invert
option to invert the poles of bipolar components, but it won't rotate labels or the arrow that indicates the rise of potential. That said, you can always set the arrow's direction using v<= , v>=
where the point of the less or greater tha symbol is the direction of the arrow.
documentclass{article}
usepackage{tikz}
usepackage{circuitikz}
begin{document}
begin{tikzpicture}
draw (0,0) to [battery, v=$varepsilon$] (2,0) node [right] {Default};
end{tikzpicture}
medskip
begin{tikzpicture}
draw (0,0) to [battery, v<=$varepsilon$,invert] (2,0) node [right] {Inverted};
end{tikzpicture}
end{document}
Notice that v<=
made the arrow point to the left in the inverted example .
PS.: Sorry for my broken English
Answered by LATEX NOOB JP on February 14, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP