fix: CircuiTikZ loads indefinitely on desktop#349
Conversation
f02dfba to
bc45e74
Compare
bc45e74 to
f74654a
Compare
|
Thanks @kuyacarlo, this is a solid fix and the mechanism is exactly right: node-tikzjax's WASM TeX engine has a fixed string-pool limit, and always pre-loading the heavy I've merged your commit into the Verified before merging:
The "circuits flash while typing in split view" note is a separate, pre-existing preview-refresh quirk, not something this PR needs to address. Thanks again! |
|
Merged into release/v2.12.0 (see comment above). Shipping in v2.11.0's successor. |
Problem
On Linux desktop app, rendering circuits with CircuiTikZ loads indefinitely, or crashes entirely.
Technical details (Antigravity)
node-tikzjaxuses a WebAssembly port of TeX with a hardcoded memory limit (pool_size= 920,271 characters). ZenNotes was pre-loading the heavypgfplotspackage by default for all TikZ blocks, leaving almost no room in the string pool for loading additional large packages likecircuitikz.Changes
pgfplots: Modifiedapps/desktop/src/main/tikz.tsto inspect the TikZ code block.pgfplotsis now only loaded if the code block explicitly contains"pgfplots","axis", or"plot".circuitikz: The runner now scans the code block for"circuitikz"or"ctikzset"and automatically injects thecircuitikzpackage intotexPackages. This enables circuit schematics to render out-of-the-box without requiring users to write\usepackage{circuitikz}in their note preambles.pgfplotsautomatically, while other diagrams (circuit diagrams, block diagrams, logic trees) gain a significant memory pool margin, resolving the compilation crashes.Not addressed
Screencast.From.2026-07-08.22-26-01.mp4
CircuiTikZ Error
TikZ error: TeX engine render failed. Set `options.showConsole` to `true` to see logs.! Emergency stop.
l.2 \ctikzset
{bipoles/length=.9cm}
CircuiTikZ Code
Note: Code edited by Google Antigravity