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.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- 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