Block diagram to TikZ

Redrawing a control loop or a flowchart in TikZ by hand takes an hour of nudging coordinates. CatchTeX reads the boxes, junctions, arrows and labels from the picture and writes the TikZ for you, laid out like the original.

Updated 2026-10-05

Recorded in CatchTeX 0.9: a feedback loop becomes TikZ code.

The quick way

  1. Snip the diagram in the PDF viewer (Ctrl+O) or from the screen (Ctrl+Alt+T).
  2. Pick the Diagram chip (Auto also recognises most diagrams).
  3. Check the preview: boxes, summing junctions with their + and − signs, arrows and labels, placed like the original.
  4. Copy LaTeX and paste it into your document. The copied code includes the packages and TikZ libraries it needs.
\begin{tikzpicture}
\node[circle, draw] (s) at (0,0) {};
\node[draw, minimum height=8mm] (g) at (2.2,0) {$G(s)$};
\coordinate (y) at (4.4,0);
\draw[->] (s) -- (g);
\draw[->] (g) -- node[above] {$y$} (y);
\draw[->] (3.6,0) -- (3.6,-1.2) -- (0,-1.2)
      -- node[left] {$-$} (s);
\end{tikzpicture}

What it handles

On our test set of control diagrams every block and junction is found, with the right type and the right signs; 94 % of the connections are found. Small labels on arrows are the weak spot: about half are picked up offline, so check them in the preview.

Dense diagrams: the optional AI assistant

For crowded real-world diagrams you can switch on the AI assistant with your own API key (Anthropic, OpenAI, Google Gemini or OpenRouter). CatchTeX sends the snip together with everything it measured, the model corrects missing feedback paths or arrow directions, and every connection is marked as confirmed or inferred so you know what to check. It is off by default; without it everything still runs offline.

Other ways, compared

MethodEditable TikZEffort
Redraw by hand in TikZYes30–90 minutes per diagram
Draw in a visual editor and exportOften messy codeRedraw everything
Include the imageNoNone, but fonts and style do not match
CatchTeXYes, readable nodes and pathsOne snip, then small fixes