LuaTikZ

by Sharbel Marshi
5
4
3
2
1
Score: 44/100

Description

Reviews

No reviews yet.

Stats

4
stars
504
downloads
0
forks
5
days
2
days
2
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
3
total issues
1
open issues
2
closed issues
69
commits

Latest Version

2 days ago

Changelog

LuaTikZ 1.9.7 Load-failure fixes

A stability patch. Two separate bugs could stop LuaTikZ from loading at all, showing "LuaTikz failed to load" with a RangeError or Config merge conflict in the console. Both are fixed. No feature or behaviour changes otherwise.

Fixed: failed to load when another plugin provides autocompletion

LuaTikZ configured CodeMirror's autocomplete with the override field. That field has no merge rule, so as soon as any other installed plugin also set it, the editor configuration threw

Config merge conflict for field override

during startup, and Obsidian aborted the whole plugin.

TikZ completions are now registered as language data, which is additive. Two consequences:

  • LuaTikZ can no longer conflict with another plugin's autocompletion, whatever it configures.
  • override had also been replacing every completion source in the editor, for all files, so other plugins' completions were being suppressed globally. They now coexist properly.

Fixed: failed to load when notes were already open

The hover-highlight extension used two CodeMirror state fields, one reading the other through the transaction's previous state. Obsidian installs plugin editor extensions into already-open notes by reconfiguring them, and in that transaction the previous state predates the plugin, so the lookup threw

RangeError: Field is not present in this state

again during load. This is why the failure looked intermittent: starting with no notes open worked, while restoring a session with an open note did not.

The two fields are now a single field, which cannot race its own installation.

README file from

Github

LuaTikZ

Fast LuaLaTeX TikZ rendering with full library support, live preview, a visual touch/stylus TikZ editor, RTL support, and simple diagram helpers.

Render tikz and luatikz fenced code blocks in Obsidian. Desktop can use local LuaLaTeX or TikZJax; mobile uses TikZJax. Enable LuaTikZ under Settings → Community plugins and choose your prefered Renderer.

Floating live preview

What's new
  • Visual TikZ editor the floating preview now has an Edit mode which opens a full window with the editor filling the pane: which contains shapes, selection tools, function plotter, circuit components, handwriting, styiling and much more. Details
  • Freehand ink strokes are smoothed, simplified, and fitted to editable Bézier paths, with an adjustable smoothing setting.
  • Touch, stylus, and Apple Pencil one finger pans, two fingers pinch-zoom; an explicit Finger draw toggle makes one finger draw; a pen always draws, with practical palm rejection while it's near the glass.
  • Floating preview on mobile the inline live preview (and the Edit mode) now works on iPad, Android tablets, and phones, rendering through TikZJax. Details

Visual Editor

Requirements

Mobile (iOS / Android)

LuaTikZ runs on Obsidian mobile. Diagrams render in reading view through the bundled TikZJax runtime so there is no need for a local TeX install and no shell access required.

Desktop

For a full support of libraries, a Local LuaLatex (recommended) is required and choose Local Lualatex renderer through plugin's settings

  • LuaLaTeX (MacTeX or TeX Live)
  • pdftocairo for PDF → SVG (brew install poppler on macOS)

For regular use keep TikzJax Renderer and there is no need for a local TeX install.

Usage

```tikz or ```luatikz
\begin{tikzpicture}
.
.  -> tikz code here
.
\end{tikzpicture}
```

If you are interested in learning to code with TikZ, I suggest this website: Tikz.org

Features

  • Background grid: Add an optional centimeter-based grid behind rendered diagrams. Details
  • RTL labels: Use Hebrew and Arabic labels with LuaLaTeX shaping and a TikZJax fallback. Details
  • Built-in helpers: Use diagram macros, autocomplete, snippets, node anchors, and relative-coordinate suggestions. Details
  • Live preview and coordinate picking: Preview diagrams while editing, pick coordinates on desktop, and locate source statements from rendered shapes. Details
  • Visual editor (Edit mode): Draw and edit native TikZ visually with shapes, circuits, styling, freehand input, touch and stylus support, and two-way source sync. Details
  • Editor assistance and export: Get line-aware editing, linting, templates, formatting, auto-close helpers, and SVG or PNG export. Details
  • Errors and editing: LuaTikZ maps compile failures back to the diagram, highlights affected lines, and offers plain-language explanations and suggested fixes when possible. Details
  • Settings: Choose renderers, fonts, preambles, caching, dark-mode behavior, editor assistance, and environment checks. Details
  • Renderers: Use local LuaLaTeX for the full TeX toolchain or bundled TikZJax for shell-free and mobile rendering. Details
  • Security and permissions: Local rendering is opt-in and narrowly scoped; the detailed guide explains shell execution, temporary files, clipboard access, and bundled dependencies. [Details](
  • Hover-to-locate: moving the pointer over a shape in the floating preview highlights the statement that drew it. Details
  • PNG export: the toolbar button is now Export with a format menu for SVG or PNG. Details
  • Explained errors: opaque LaTeX failures such as Dimension too large now come with a plain-language explanation of the cause and the fixes that work. Details
  • Font settings: override the main, Hebrew and Arabic fonts. Details
  • Custom preamble: replace the generated LuaLaTeX preamble entirely, with buttons to load the current one or reset. Details
  • Hebrew/Arabic load only when used: and per script, so a Hebrew diagram no longer pulls in the Arabic gloss that minimal TeX installs lack. Details

Samples

Diagrams rendered with LuaTikZ, exported as SVG. Files in samples/.

Astronomy

Astronomy

Anatomy

Heart anatomy Eye anatomy
Neural anatomy Airflow path

Circuits and logic

Circuit diagram 1 Circuit diagram 2
Circuit diagram 3 MOSFET P-channel
Logic gates 1 Logic gates 2

Math and decision diagrams

PDE diagram Decision matrix

Maps and layouts

Train routes Isometric city

License

MIT — see LICENSE.