[ home ] [ math / cs / ai / phy / as / chem / bio / geo ] [ civ / aero / mech / ee / hdl / os / dev / web / app / sys / net / sec ] [ med / fin / psy / soc / his / lit / lin / phi / arch ] [ off / vg / jp / 2hu / tc / ts / adv / hr / meta / tex ] [ chat ] [ wiki ]

Viewing source code

The following is the source code for post >>>/ee/9

Mathchan supports embedding \textbf{circuits} through CircuiTikZ by using the \`\begin{circutikz} ... \end{circuitikz}\` environment.

For example, pasting the following excerpt from the attached PDF file (CircuiTikZ manual): 
```
\begin{circuitikz}[american, cute inductors]
\node [op amp](A1){\texttt{OA1}};
\draw (A1.-) to[short] ++(0,1) coordinate(tmp) to[R, l_=$R$] (tmp -| A1.out) to[short] (A1.out);
\draw (tmp) to[short] ++(0,1) coordinate(tmp) to[C=$C$] (tmp -| A1.out) to[short] (A1.out);
\draw (A1.+) to [battery2, invert] ++(0,-2.5) node[ground](GND){};
\draw (A1.-) to [L=$L$] ++(-2,0) coordinate(tmp) to[sV, l=$v_s$, fill=yellow] (tmp |-GND) node[ground]{};
\draw (A1.out) to[R=$R_s$] ++(2,0) coordinate(bb) to[I, l_=$I_B$, invert] ++(0,2) node[vcc](VCC){};
\draw (bb) to[D, l=$D$, *-] ++(0,-2) coordinate(bb1) to[R=$R_m$] ++(0,-2) node[vee](VEE){};
\draw (bb) --++(1,0) node[npn, anchor=B](Q1){Q1};
\draw (bb1) --++(1,0) node[pnp, anchor=B](Q2){Q2};
\draw (Q1.E) -- (Q2.E) ($(Q1.E)!0.5!(Q2.E)$) to [short, *-o, name=S] ++(2.5,0)
node[right]{$v_{o_Q}$};
\draw (S.s) to[european resistor, l=$Z_L$, *-] (S.s|-GND) node[ground]{};
\draw (Q1.C) -- (Q1.C|-VCC) node[vcc]{\SI{5}{V}};
\draw (Q2.C) -- (Q2.C|-VEE) node[vee]{\SI{-5}{V}};
\end{circuitikz}
```
Will render as the following figure on Mathchan:
\begin{circuitikz}[american, cute inductors]
\node [op amp](A1){\texttt{OA1}};
\draw (A1.-) to[short] ++(0,1) coordinate(tmp) to[R, l_=$R$] (tmp -| A1.out) to[short] (A1.out);
\draw (tmp) to[short] ++(0,1) coordinate(tmp) to[C=$C$] (tmp -| A1.out) to[short] (A1.out);
\draw (A1.+) to [battery2, invert] ++(0,-2.5) node[ground](GND){};
\draw (A1.-) to [L=$L$] ++(-2,0) coordinate(tmp) to[sV, l=$v_s$, fill=yellow] (tmp |-GND) node[ground]{};
\draw (A1.out) to[R=$R_s$] ++(2,0) coordinate(bb) to[I, l_=$I_B$, invert] ++(0,2) node[vcc](VCC){};
\draw (bb) to[D, l=$D$, *-] ++(0,-2) coordinate(bb1) to[R=$R_m$] ++(0,-2) node[vee](VEE){};
\draw (bb) --++(1,0) node[npn, anchor=B](Q1){Q1};
\draw (bb1) --++(1,0) node[pnp, anchor=B](Q2){Q2};
\draw (Q1.E) -- (Q2.E) ($(Q1.E)!0.5!(Q2.E)$) to [short, *-o, name=S] ++(2.5,0)
node[right]{$v_{o_Q}$};
\draw (S.s) to[european resistor, l=$Z_L$, *-] (S.s|-GND) node[ground]{};
\draw (Q1.C) -- (Q1.C|-VCC) node[vcc]{\SI{5}{V}};
\draw (Q2.C) -- (Q2.C|-VEE) node[vee]{\SI{-5}{V}};
\end{circuitikz}