Menu

How to convert a block diagram to TikZ without redrawing it
📰

How to convert a block diagram to TikZ without redrawing it

DEV Community: tutorial·Chintu Gurbani·12 days ago
#pbjIZDaK
#devtotutorial#devto#dev#catchtex#tikz
Reading 0:00
15s threshold

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.

The quick way

Snip the diagram in the PDF viewer (Ctrl+O) or from the screen (Ctrl+Alt+T).

Pick the Diagram chip (Auto also recognises most diagrams).

Check the preview : boxes, summing junctions with their + and − signs, arrows and

labels, placed like the original.

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}

Enter fullscreen mode

Exit fullscreen mode

What it handles

Boxes with text or maths labels (transfer…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.