1

I am an extensive user of latex and being EE engineer I use circuitikz a lot. But it becomes a little inflexible once I start doing a complex circuit and hence I am taking an initiative to generate code from schematic just like how one can generate code for equations or table. Since I have little knowledge on how one can achieve that, I would like to know where can I start?

rsg1710
  • 143
  • 1
    Can you provide us with more details? How does what you refer to as a complex curicuit look like? What is the basis you would like to generate source code from? – Matthias Nov 13 '17 at 14:18
  • 1
    Well its difficult to provide more details because as of now I am able to draw circuits as I want, its when the circuit grows in size (lets say more than 10 transistors) then I start to get confused which belongs to what. If I was not clear, I am interested to generate code just like there are latex code generators for equations (or tables) where in one can just select on some icons to get the source code. it would generate from \begin{equation}.... \end{equation} – rsg1710 Nov 13 '17 at 14:27
  • 1
    Is there some sort of unambiguous technical notation for circuits? For example, for chemical structures, there are formats like SMILES - all the atoms and bonds in the caffeine molecule are unequivocally described by the string CN1C=NC2=C1C(=O)N(C(=O)N2C)C. Or maybe there is some interactive program that can write some XML file. In either case, it should be possible to write a program to convert that to LaTeX markup; I did something similar for chemical structures (see http://chimpsky.uwaterloo.ca/mol2chemfig/). – Michael Palmer Nov 13 '17 at 14:36
  • @MichaelPalmer its a great tool. I didnt understand your comment fully but I can express probably better. Unlike your tool, I would like to generate source code from what I draw . With respect to your tool, what I am trying to achieve is to get code from the ChemDoodle for ex. – rsg1710 Nov 13 '17 at 14:47
  • @Matthias Well its difficult to provide more details because as of now I am able to draw circuits as I want, its when the circuit grows in size (lets say more than 10 transistors) then I start to get confused which belongs to what. If I was not clear, I am interested to generate code just like there are latex code generators for equations (or tables) where in one can just select on some icons to get the source code. it would generate from \begin{equation}.... \end{equation} – rsg1710 Nov 13 '17 at 14:57
  • @rsg1710 Do you think of a software with a graphical user interface such as Yenka that allows you to draw circuits? I am not aware of any such tool that provides TikZ export or uses an open file format, e.g., based on XML. – Matthias Nov 13 '17 at 15:04
  • @Matthias I know many more softwares but I love the result I get from Latex. I dont want a tool; instead I am ready to design one, i just want to know where to start. – rsg1710 Nov 13 '17 at 16:53
  • @rsg1710 I think that Michael Palmer provides the right starting point in his previous comment. You should investigate if there are any standard and open file formats for circuits the software applications are capable of dealing with. A file format based on XML might be best, since XSLT allows very flexible code transformations. Writing such a transformation could be anything you need. – Matthias Nov 13 '17 at 17:13
  • Maybe this is a useful resource: https://electronics.stackexchange.com/questions/67536/xml-schema-for-electric-circuits I would try to find an interactive tool that exports its graphs to XML or any other text-based format, and then write my own program to parse that and put out LaTeX. (And I would recommend Python rather than XSLT for that.) – Michael Palmer Nov 13 '17 at 17:19
  • @Matthias yeah will go through and see if I can do some progress. – rsg1710 Nov 13 '17 at 18:15
  • @MichaelPalmer thank you for some pointers will work on your suggestions and see if I can do something :) – rsg1710 Nov 13 '17 at 18:16
  • @HenriMenke very close but that covered more on Tikz than circuitikz but one of the answer in this question is a possible answer for me as well. Thank you – rsg1710 Nov 14 '17 at 08:36

0 Answers0