Fixes
- WebAssembly & initialization
- Fix TikZJax WebAssembly initialization issues.
- Fonts & symbol rendering
- Override DVI parser `machine.putText` to use split character code offsets from `tikzjax.js`.
- Map codes 0–9 starting at 161 to fix incorrect Γ rendering (was showing as Θ).
- Map codes 10–19 starting at 173 to resolve Ω and ⊗ collisions with soft hyphen.
- Layout & rendering
- Fix SVG clipping by switching to `position: relative` with `overflow: visible`.
- Adjust inline SVG behavior to prevent top-of-page clipping.
- Type compatibility
- Cast types to `unknown` in `TikzJaxLoader` and worker functions for compatibility.
- Error handling & cleanup
- Improve error handling across TikZ components.
- Remove unused dependencies and unnecessary console logs.
Features
- Package loading system
- Add robust dependency resolution in `loader.ts` for:
- `tikz-cd`
- `tikz-feynhand`
- `pgfcalendar`
- Ensure required libraries and keys load dynamically on demand.
- Rendering & layout improvements
- Enhance SVG bounding box calculation.
- Implement dynamic column width calculation.
- Improve row and column layout alignment and responsiveness.
- TikZ editor enhancements
- Add keyboard shortcut tooltips to sidebar buttons.
- Introduce thickness control slider for elements.
- Improve snapping system with modes:
- grid
- half
- none
- Add support for new shapes:
- circles
- rectangles
- triangles
- Improve TikZ code generation error handling.
Improvements
- Selection & editing UX
- Add lasso selection for multiple vertices in `CanvasGrid`.
- Support multi-element editing in `RightSidebar`.
- Refactor `TikzEditorModal` to handle multiple selected vertices.
- Enable batch updates for selected elements.
- Layout & styling
- Compact `.block-language-tikz` layout:
- margin: `1.5em 0` → `0.3em 0`
- padding: `1rem 0` → `0`
- Improve canvas controls and interaction styles.
- Component refactoring
- Refactor `CanvasGrid` to use template literals.
- Replace inline styles with `setCssStyles`.
- Improve `TikzCodec` node naming clarity.
- Improve `history manager` type safety with `EditorElement`.
- Use `window.setTimeout` in asset manager for better compatibility.
- Accessibility & UI polish
- Improve sidebar button titles and tooltips.
- Standardize live preview overlay button titles.
- Clean up modal styling and text consistency.
Documentation
- Revamp TeXcore plugin documentation:
- Clarify PDF export features and settings.
- Improve quick preview architecture explanation.
- Enhance equation search and autocomplete docs.
- Streamline snippets usage and transformations.
- Expand TikZ diagrams section with graphical editor guide.
- Improve getting started guide with clearer steps.
- Add navigation and configuration updates.
- Update plugin manifest descriptions for clarity.
3.9 KiB
Equation & Sub-Equation Numbering
The core engine of TeXcore provides automatic equation numbering using LaTeX \tag{} commands, allowing you to generate academic-grade numbering schemes inside Obsidian. This feature is heavily integrated with the plugin's Autocomplete System and Quick Hover Previews to keep references synchronized in both Live Preview and Reading View.
Defining Equation Identifiers
Unlike Obsidian's standard markdown block references which append identifiers at the end of elements, TeXcore indexes equations using LaTeX comments inside the display math block. Add a % id: eq-name comment line immediately before the closing $$ delimiter. The prefix eq- is required, followed by alphanumeric characters or hyphens.
$$
E = mc^2
% id: eq-einstein (1)
$$
- This comment is invisible in the final rendered note but is parsed by TeXcore's background indexing system to build the active note cache.
Lazy Numbering Mechanism
To keep your document layout clean, TeXcore uses lazy numbering by default. An equation is only assigned a right-aligned number tag if it is actively referenced somewhere in the vault. If the equation is not referenced, no tag is injected, keeping margins clear. You can disable this behavior to force-number all equations in the Settings Reference.
=== "1. Editor Code" Write the math block and reference it inline using Obsidian double brackets:
```latex
$$
E = mc^2
% id: eq-einstein
$$
As shown in [[#^eq-einstein]], mass is equivalent to energy.
```
=== "2. Generated Output"
The compiler automatically appends the \tag{} macro and renders the link with the assigned index:
$$
E = mc^2 \tag{1}
$$
As shown in [(1)](#), mass is equivalent to energy.
Numbering Customization
Configure the layout of your math indices globally via the Settings Panel. Numbering formats support a variety of typographic styles, prefixes, and suffixes.
Number Styles Matrix
| Style Name | Description | Output Example |
|---|---|---|
arabic |
Standard Hindu-Arabic numerals. | (1), (2), (3) |
alph |
Lowercase Latin alphabetical indexing. | (a), (b), (c) |
Alph |
Uppercase Latin alphabetical indexing. | (A), (B), (C) |
roman |
Lowercase Roman numerals. | (i), (ii), (iii) |
Roman |
Uppercase Roman numerals. | (I), (II), (III) |
!!! info "Prefixes & Suffixes"
Prepending prefixes (e.g., Eq.) or appending suffixes (e.g., .) will modify the output. For example, a prefix of Eq. with style arabic renders as (Eq.1). A suffix of . renders as (1.). See Reference Link Customization for additional details.
Sub-Equation System
Multi-line equations (such as systems of equations using LaTeX align or split blocks) can be individually referenced using sub-indices. Reference rows sequentially by appending the row number to the parent ID:
$$
\begin{aligned}
a &= b + c \\
d &= e + f
\end{aligned}
% id: eq-system
$$
Referencing row 1: [[#^eq-system-1]]
Referencing row 2: [[#^eq-system-2]]
The plugin automatically parses the structure and appends sub-tags such as \tag{1.1} to the first equation line and \tag{1.2} to the second.
Inserting References
To reference an equation quickly, type your trigger (default is \eqref) to activate the autocomplete dialog. Use your keyboard arrow keys to scroll, and press ++enter++ to insert the formatted wiki-link.
!!! tip "Jump-to-Equation Shortcut" Holding the ++ctrl++ key (or ++cmd++ on macOS) while pressing ++enter++ on a suggestion in the autocomplete list will instantly jump your cursor to the equation definition instead of inserting the link.