Graphics, Figures & Tables ⇒ makecirc | Circuit Diagrams with MetaPost
makecirc | Circuit Diagrams with MetaPost
I am trying to draw circuit diagrams in MetaPost for inclusion into a LaTeX Document. The package I hope to use is called makecirc. However, I have no experience whatsoever with MetaPost which is causing me troubles.
Can anybody help me use one of their examples? I have installed the package.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
makecirc | Circuit Diagrams with MetaPost
welcome to the board!
So why do you use MetaPost? WasTDKBW wrote:However, I have no experience whatsoever with MetaPost which is causing me troubles.
makecirc
just the first you found? Would you consider alternative packages? For example, based on the widely used TikZ and PSTricks.- There's a circuit library in TikZ. It's documented in the
TikZ manual, in 29 Circuit Libraries.
- The
circuitikz package is also based on TikZ. See perhaps: circuitikz examples.
-
pst-circ is based on
PSTricks.
makecirc | Circuit Diagrams with MetaPost
Sure. Here's how you could make a document that includes the circuit in Figure 6 on page 17 of the MakeCirc-en.pdf documentation file.TDKBW wrote:Can anybody help me use one of their examples? I have installed the package.
1. Create a file called mycircuit.mp with these contents:
Code: Select all
input makecirc;
initlatex("\usepackage{amsmath,amssymb}");
beginfig(0);
resistor.a(origin,normal,90,"R","10\ohm");
inductor.a(R.a.r+(2cm,0),Up,-90,"L","");
centreof.A(R.a.r,L.a.l,cap);
capacitor.a(c.A,normal,phi.A,"C","");
wire(R.a.r,C.a.l,nsq);
wire(C.a.r,L.a.l,nsq);
wire(L.a.r,R.a.l,udsq);
endfig;
end
Code: Select all
mpost mycircuit.mp
mpost mycircuit.mp
Code: Select all
\documentclass{article}
\include{graphicx}
\begin{document}
\includegraphics{mycircuit.0}
\end{document}
Code: Select all
latex makecirctest.tex
dvips makecirctest.dvi
ps2pdf makecirctest.ps