Enhancement Proposal: Export to CircuiTikZ (.tex) for IEEE Publication-Quality Schematics

I would like to propose adding a native CircuiTikZ export option to LibrePCB.

Engineers in academia and professional research, need publication quality schematics in a journal or for a technical conference paper. Usually, such a paper will be published in an IEEE journal which predominantly use LaTeX. While LibrePCB’s current PDF/SVG exports are great for general use, they fall short of the “publication-quality” standard required by top-tier journals for several reasons:

a. A CircuiTikZ export allows the schematic to use the exact same fonts as the rest of the paper (e.g., Computer Modern or Times), creating a seamless look.

b. Circuit diagrams in LaTeX via TikZ are the gold standard for electrical engineering publications. They allow for precise control over line weights and scaling that matches the journal’s style guides perfectly.

c. Unlike static images, TikZ code is rendered by the LaTeX compiler, ensuring the schematic remains perfectly sharp at any zoom level without the “boxiness” sometimes seen in imported vector files.

I propose to add an “Export to CircuiTikZ” option. Ideally the export would map the standard LibrePCB components to their equivalent CircuiTikz macros. This will allow users to generate schematics that are “publication ready” directly from their working design.

Adding this would make LibrePCB the premier open-source EDA tool for the academic community and professional engineering community who publish their designs. Currently, many researchers have to manually redraw their circuits in TikZ after finishing their PCB design. Automating this would save significant time and increase LibrePCB’s adoption among professional electrical engineers. As engineers are trained in academic institutions they will be exposed to LibrePCB at an early stage of their careers.

Hi @Gilad

Thank you for your feature proposal, much appreciated. I totally understand the request and I agree it would be a cool feature. However, to be honest, I have some doubts that this would be feasible to implement.

The first problem is that every component in LibrePCB would need a mapping to the corresponding CircuiTikZ element. The question is, where this mapping would be defined. If it’s in every component library element, it will be quite some additional work to maintain the libraries. If it is not there, it would not work for any user-created components. Also what to do with components which have no corresponding CircuiTikZ element?

The second problem is that since the drawings of LibrePCB symbols and CircuiTikZ symbols are independent, they will have different dimensions. For example if you place 2 capacitors in series, it will occupy 5.08mm in total in LibrePCB. But in CircuiTikZ, the pin spacing may be twice as much, ending up with 10.16mm in total for two capacitors. So the layout of the circuit will be messed up.

Also I think the annotations and additional signs (e.g. arrows for current flow) will always differ in a real schematic vs. an academic drawing. For example, LibrePCB will automatically name the resistors R1, R2, R3, but in academic drawings we use more descriptive designators, including some math notations which are not even supported by LibrePCB.

Therefore I think even if LibrePCB can export CircuiTikZ drawings, you will have to make a lot of manual adjustments afterwards. But understanding the exported CircuiTikZ code (to make your adjustments) might then be more cumbersome than just writing the whole CircuiTikZ code from scratch.

That’s my current opinion but I’m open to consider other opinions :slightly_smiling_face: