0

Can someone help me with this Drawing? i need to add it with Latex to a document and i don't know how to use Latex function properly enter image description here

7

LaTeX has a wonderful package specifically for drawing circuits. It's called CircuiTikz (documentation here: https://www.sharelatex.com/blog/2013/09/02/tikz-series-pt4.html).

Your drawing is nothing too complicated for LaTeX standards. Here is the code:

\documentclass[a4paper]{report}

\usepackage{amsmath}
\usepackage{circuitikz}

\begin{document}

\begin{circuitikz} \draw
(0,0) to[battery1] (5,0)
(5,0) to[generic, -*] (5,6)
(5,6) to[generic, -*] (2.5,3)
(5,6) to[generic, -*] (2.5,9)
(2.5,3) to[generic] (2.5, 9)
(2.5,3) to[generic, -*] (0,6)
(2.5,9) to[generic] (0,6)
(0,6) to[ammeter] (0,0)
(1,0) to[short, *-] (1,1.5)
(1,1.5) to[voltmeter] (4,1.5)
(4,1.5) to[short, -*] (4,0)
;
\end{circuitikz}

\end{document}

enter image description here

I hope that my post was helpful. For full documentation see: http://mirror.unl.edu/ctan/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf.

  • 1
    Why on Earth would you claim this will not work with other engines? There is absolutely nothing in your code to require XeLaTeX. Nothing whatsoever. I've removed the claim as it only undermines the quality of your answer, which is otherwise good. – cfr Mar 3 '17 at 2:31
  • On my system (fully updated) only XeLaTeX worked, so I wrote the answer as such. Of course I might have overlooked some detail that would allow compilation with PDFLaTeX and LuaLaTeX as well. Do you have any knowledge of the latter? I would be grateful. – Gregor Perčič Mar 3 '17 at 9:29
  • Worked fine for me with pdfLaTeX. I just compiled your code as was, just to be sure, before editing. – cfr Mar 3 '17 at 22:09
  • Can you maybe hypothesize what configuartion my system is faulty and consequently produces the result I have (for me, it compiles only with XeLaTeX)? I'd be very grateful. – Gregor Perčič Mar 4 '17 at 8:57
  • Sorry, I have no idea. You don't even say what error you get. Ask a new question with details or ask in chat. – cfr Mar 5 '17 at 4:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.