Skip to content

feat(tikz): default math preamble, embedded-font SVG output - #42

Merged
QQSHI13 merged 1 commit into
mainfrom
feat/tikz-diagrams
Aug 18, 2026
Merged

feat(tikz): default math preamble, embedded-font SVG output#42
QQSHI13 merged 1 commit into
mainfrom
feat/tikz-diagrams

Conversation

@QQSHI13

@QQSHI13 QQSHI13 commented Aug 18, 2026

Copy link
Copy Markdown
Owner

What

  • Default math preamble: bare TikZ sources (no \documentclass) are auto-wrapped in a standalone document with amsmath, amssymb, tikz, pgfplots, tikz-cd, tkz-euclide preloaded — a diagram is just the tikzpicture body (maths-encyclopedia-friendly).
  • Embedded-font SVGs: dvisvgm no longer runs with --no-fonts; diagram text stays selectable/searchable, with automatic fallback to outlined paths when TeX fonts are missing.
  • tikz_preamble config option for extra preamble lines.
  • Docker + demo CI gain texlive-fonts-recommended (amssymb/amsfonts); pgfplots/tikz-cd/tkz-euclide already ship in texlive-pictures.
  • Demo: new minimal math-kit.tex (commutative diagram + function plot + Euclidean construction, no \documentclass) exercises the default preamble; docs/changelog en+zh updated.

Verified

  • All 6 demo diagrams compiled locally through the new pipeline with embedded fonts (real <text> elements in SVG).
  • Fixes a wrap bug where a comment mentioning \documentclass would disable auto-wrapping.

CI

  • Demo workflow (main push) installs the same texlive set and compiles math-kit.tex — the gate for the preamble packages.

Bare diagram sources (no \documentclass) are now auto-wrapped in a
standalone document with amsmath, amssymb, tikz, pgfplots, tikz-cd and
tkz-euclide preloaded, so a diagram is just the tikzpicture body. New
tikz_preamble config option injects extra preamble lines.

dvisvgm no longer runs with --no-fonts: diagram text stays selectable
and searchable in the SVG, falling back to outlined paths only when the
TeX fonts are unavailable. texlive-fonts-recommended (amssymb/amsfonts)
added to the Docker image and demo CI - pgfplots, tikz-cd and
tkz-euclide already ship in texlive-pictures.

Demo gains math-kit.tex exercising all three plugin families in one
minimal source. Docs (en+zh) and changelog (en+zh) updated.
@QQSHI13
QQSHI13 merged commit d878369 into main Aug 18, 2026
8 checks passed
@QQSHI13
QQSHI13 deleted the feat/tikz-diagrams branch August 18, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant