Hot answers tagged

20

For the circuitikz approach: You need to tell TikZ what to do with (myand1.out), (myxnor.in 1), and so on. At the moment, you just mention the nodes, but don't tell TikZ to actually connect them, because you ended the previous \draw command already with the ;. Also, to connect nodes with straight lines, you need to use --, not |. Here's your example in a ...


16

Here is an example using circuitikz: \documentclass{article} \usepackage{tikz} \usepackage{circuitikz} \begin{document} \tikzset{full Schottky diode/.append style={bipoles/length=.4cm}} \tikzset{american voltages} \tikzset{american inductors} \tikzset{european resistors} \begin{circuitikz} % TRANSISTORS \draw (0,2) node[nigfete] (t1) {} ...


15

Here's one possibility using the tikz-dsp (Digital Signal Processing) library; the library can be downloaded following the provided link from TeXample.net. I defined two new styles for the adder, to obtain the label position illustrated in the image from the original question: \documentclass{article} \usepackage{siunitx} \usepackage{tikz} ...


15

You can use yscale=-1: \documentclass{article} \usepackage{circuitikz} \begin{document} \begin{circuitikz} \draw (0,0) node[op amp] (opamp1) {} (opamp1.+) node[left ] {$v_+$} (opamp1.-) node[left ] {$v_-$}; \draw (3,0) node[op amp,yscale=-1] (opamp2) {} (opamp2.+) node[left ] {$v_+$} (opamp2.-) node[left ] {$v_-$}; \end{circuitikz} ...


14

This can be best done with cylinders but for the shading effects one can do some manual construction too. \begin{tikzpicture} \draw[fill=blue!50](0,0) circle (1 and 2); \draw[top color=blue!25,bottom color=black,middle color=blue!50] (-0.5,2) arc (90:270:1 and 2) -- ++(0.5,0) arc (-90:-270:1 and 2) -- cycle; \draw[top color=white,bottom color=black!70] ...


14

The circuits library is not really suited for this kind of diagram. This can easily be achieved with three nodes and a few edges. The shapes.geometric library provides the ellipse shape. The auto=right option positions all nodes along a path on the right side (the default is left). The swap option changes this for only one node to the other side. Code ...


12

With PSTricks. Just for fun! \documentclass[preview,border={10pt 10pt 10pt 40pt}]{standalone} \usepackage{pst-node} \def\obj#1{\makebox[1cm]{\strut#1}} \begin{document} \offinterlineskip \begin{psmatrix}[colsep=1cm,rowsep=3cm,mnode=oval] [name=l]\obj{x} & & [name=r]\obj{y}\\ & [name=b]\obj{daervz} \\ \end{psmatrix} ...


12

I was able to reproduce the error and to fix it. Let's start to examine a simple document with a plot and a resistor: \documentclass[a4paper,11pt]{article} \usepackage{circuitikz} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \usetikzlibrary{external} \tikzexternalize \tikzset{external/force remake} \begin{document} \begin{tikzpicture} ...


12

Question 1 Instead of scaling the circuit, you can use x=<length>, y=<length>, so labels, for example, won't be affected. Question 2 You can simply use -- and rounded corners to easily produce the smooth cuved path. In the example below, instead of \draw[>=latex,->,color=magenta,text=black, thick] (0.6,1.9) ...


12

The diagram would be improved alot by using connecting wires that are only horizontal or vertical. There is a conveient syntax |- for a path that is first vertical then horizontal, and the corresponding -|. You can apply colours to the individual symbols and to the connecting wires by specifying color=red. Perhaps this is close to what you are after: ...


11

This is one possible solution. amssymb is used for loop currents. Code \documentclass{article} \usepackage{tikz} \usepackage[siunitx,cuteinductors,americanvoltages,americancurrents]{circuitikz} \usepackage{latexsym,amssymb,amsmath} \begin{document} \begin{circuitikz} \draw (0,0) to [R=$R_1$] (2,0) -| (3,-1) to [L,l_=$L_1$] (3,-3) |- (-1,-4) to ...


11

I've never used circuitikz but shapes.gates.logic tikzlibrary. You have AND, NOT, NOR and all logic gates, place them as regular tikz nodes and draw connections. That's all. Here you have an example: \documentclass[border=3mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,shapes.gates.logic.US,shapes.gates.logic.IEC,calc} \begin{document} ...


11

Components in CircuiTikz are defined in the pgfcirc*poles.sty files via pretty much low-level pgf commands. You can either try looking at the *sty files, in particular pgfcirctripoles.sty there most ports are defined, and cut&paste your way to a new component. If you manage to code it, please send it to me so I can add it for everyone to use :) send ...


10

I was in the same search several weeks earlier, only on the Mac platform. I finally settled down with the circtuitikz, and found it intuitive to work with. I abandoned previous choice Circuit_Macro simply because CircuitTiKz suit my workflow, that means I don't want to have too much compile work. My current workflow look likes this, although on Mac ...


10

The TikZ circuit library is inspired by circuitikz. From the TikZ manual (Chapter 29: Circuit Libraries): Written and documented by Till Tantau, and Mark Wibrow. Inspired by the work of Massimo Redaelli. Massimo Redaelli is the author of the circuitikz package. Apparently (see @CountZero's comment) the two are not compatible, However, as far as I know ...


10

The circuitkiz manual show that you can draw the entire graphic in one single \draw command which looking at the example seems failry simple but positioning can be a bit of an issue. Using the [short] nodes you can pretty much position the elements where you want time (after a bit of trial and error) I eventually got this code out: ...


10

In my eyes, a drawing like that looks like a good job for a matrix. And honestly, the positioning with the circuitikz package seems complicated as the other answers prove … The advantage of a TikZ matrix and its library is that all nodes in it are named automatically: (<matrix name>-<row>-<column>). We can use these names later to connect ...


9

Addressing your specific questions, but in reverse order: Is there a simpler way without using coordinates? Yes. You can use positioning tikz library which allows you to specify the placement of a new node or coordinate relative to the position to another node, with a simple syntax: \node[below=1cm of 0], for example, asuming that (0) is the name of a ...


9

You have to load circuitikz with the siunitx option. Also, the correct syntax is |component| = |value|<|unit|>. The unit macro needs to be surrounded by < and >. The expression may not be put in math mode by surrounding it with $. Here's an example: \documentclass{article} \usepackage[siunitx]{circuitikz} \begin{document} \begin{circuitikz} ...


9

I too find the circuitikz documentation a bit lacking, but you learn a lot from inspecting the examples. A quick [circuitikz] search on the site will lead you to more examples. Moreover, a few additional circuitikz examples are available at texample.net. Regarding spacing, my main piece of advice (which applies to any vector-graphics package, really) is to ...


8

Hope the code itself is explanatory: \documentclass{standalone} \usepackage{circuitikz} % \begin{document} \begin{circuitikz} \draw (0,2) node[and port] (myand) {} (2,1) node[or port] (myor) {} (myand.in 1) node[above left=.5cm](a) {A} (myand.in 2) node[below left = .5cm](b) {B} (myand.out) -| (myor.in 1) (a) -| (myand.in 1) (b) -| (myand.in 2) (b) ...


8

(answer to comments below) Here is one solution. Note that the ammeter and voltmeter that you wanted aren't in circuitikz' set of components. To get around this I used the fact that all of the components and lines are tikz components and lines so that all of the stuff valid in tikz can be used. I created nodes with the appropriate info. In addition, I used ...


8

Since circuitikz is built upon TikZ, you can use \draw to draw a circle: \documentclass{article} \usepackage{circuitikz} \begin{document} \begin{circuitikz} \draw (0,0) node[npn] (npn) {} (npn.base) node[anchor=east] {B} (npn.collector) node[anchor=south] {C} (npn.emitter) node[anchor=north] {E}; \draw ($(npn)-(0.18,0)$) circle [radius=18pt]; ...


8

The following code is a modification of the definition of cspst. I just removed the arc and the arrow. \documentclass{minimal} \usepackage{circuitikz} % modified code from pgfcircbipoles.sty and circuitikz1.code.tex \makeatletter % create the shape \pgfcircdeclarebipole{}{\ctikzvalof{bipoles/interr/height ...


8

I could not understand your question properly, especially the free body diagram part. However, will this be useful? \documentclass{article} \usepackage{graphicx} % to add figure environment that comes with caption \usepackage{caption} %if you don't want to float your figure for using \captionof \usepackage{tikz} ...


8

Just to summarize: My answer: It could be done with the "transform shape" option: \begin{circuitikz}[scale = 'some_scale_factor', transform shape] Martin's answer: Wrap the whole thing in a \scalebox{<factor>}{..} (graphicx package) or \begin{adjustbox}{scale=<factor>} .. \end{adjustbox} (adjustbox pacakge).


8

Following Mythio's suggestion, you can use "pure" TikZ code to locate the labels. Here is how it works: draw the AND port and remember to give it a name because in such a way later on you can access the inputs and output pins; for example: \draw (0,0) node[rotate=90,and port] () {}; the blue circle represents the exact coordinates of the inputs and ...


8

You may have to play around with the label distances, but the following works: Placing the additional nodes for the labels after setting the circuit. \documentclass{article} \usepackage{circuitikz}% http://ctan.org/pkg/circuitikz \begin{document} \begin{center} \begin{circuitikz} \draw (0,0) node[and port] (myand){} (myand.in 1) ...


8

For a one-off addition, I think you'd be best adding this as a feature request to the tracker on SourceForge. As a package developer myself, I find it a lot easier to have things listed in the database so I don't forget about them, which does happen with e-mails. That does mean having an account on SourceForge: you can use OpenID, which should mean you can ...


8

TikZ, starting version 2.10 has its own circuits library, which works very well (for me :) ).



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