Skip to content

Releases

0.2.3

Choose a tag to compare

@github-actions github-actions released this 19 Oct 09:38
Immutable release. Only release title and notes can be modified.

What's new in 0.2.3

No diagram draws differently, and none is compiled again after the update.

  • A diagram with clipping in it is framed by what shows. A pgfplots curve that runs past its axis,
    such as x^2 over domain=-8:8 in an axis that stops at 8, is clipped at the axis, but the
    plugin framed the whole curve, so the diagram had a large empty space above or below it: 1,284 pt
    tall for an axis of 295. Shadings had an empty margin round them for the same reason. Diagrams
    without clipping are framed as before. Reported in
    discussion #4.
  • Diagrams already cached get the new frame the first time they are shown, from the cache.

About

Renders TikZ and LaTeX diagrams inside notes. No LaTeX installation, no network
access: the whole TeX engine is compiled to WebAssembly and runs locally, on
desktop and on mobile. Requires Obsidian 1.7.2.

Installing

In Obsidian: Settings → Community plugins → Browse, search for TikZJax Next. To install by hand,
download main.js, manifest.json and styles.css below into
<vault>/.obsidian/plugins/tikzjax-next/ and enable it in Settings → Community plugins.

Engine

tikzjax engine build
texlive flavour  apt
format inputs    c7787859baf598b4af634232748de4fe (sha256 over the 145 files latex.ltx pulled in)
tex changes      ifincsname.ch filesize-missing.ch jump-out.ch snapshot.ch (engine-build/changes, after web2js's)
tex banner       TeX 3.141592653 (TeX Live 2023/Debian)
TEXMFDIST        /usr/share/texlive/texmf-dist
web2js           0114ef5905dc387b70e72c654bcedd3b52b29fad
web2js codegen   function-declaration.js function-evaluation.js memory.js (engine-build/web2js-codegen, sha256 443f3a3b1d4d6231)
wasm-opt         --mvp-features -O4 (binaryen 132.0.0), no asyncify
tikzjax          461ac15f1c63351392115c4262d8179bc9922404
memory pages     2500 (156 MiB)
hash_prime       131071 (hash_size 600000)
tex_files        247
node             v22.23.3

pgf.sty                3.1.10
pgfplots.sty           1.18.1
pgfplotstable.sty      1.18.1
tikz.sty               3.1.10
circuitikz.sty         1.6.6
chemfig.sty            1.66
siunitx.sty            3.3.10
expl3.sty              2024-01-22
xparse.sty             2023-10-10
amsmath.sty            2023/05/13 v2.17o AMS math features
standalone.cls         2022/10/10 v1.3b Class to compile TeX sub-files standalone
tikz-cd.sty            2021/05/04 v1.0 Commutative diagrams with TikZ

SHA-256

73186d95d4789a05105a2d969febf6f943b9fb3011a983e7ebb650174333d6fc  main.js
287fad1c6d49753ad1ce7e1749e7f22388def566388f3282307849da5c7a8b54  styles.css
adb3ba3caeec17946fad94b02683913c4bb2d89731c2c7cd1c3e598444edc5df  manifest.json

0.2.2

Choose a tag to compare

@github-actions github-actions released this 16 Oct 22:06

What's new in 0.2.2

No diagram draws differently, and every diagram 0.2.1 cached is shown from the cache.

  • The plugin's settings are in Obsidian's settings search, from Obsidian 1.13 on: searching for
    "saved preambles", for instance, finds the row in TikZJax Next's tab. The tab has the same rows as
    before, under the same headings. Below 1.13 it is drawn as in 0.2.1.
  • Clear, under Cache, counts the cached diagrams again in place once it has emptied the cache, where
    it drew the whole tab again. From Obsidian 1.13 on its button is painted the way Obsidian paints
    its own buttons that delete something.
  • Printing and exporting to PDF give the same black-on-white diagrams as before, without
    !important in the plugin's styles. A CSS snippet that sets --tikz-ink or --tikz-paper now
    applies in print as well; put it inside @media screen to keep print black on white.
  • With Obsidian Sync Standard carrying installed plugins, this is the first update that 0.2.1 can
    tell was only half carried: a device left with 0.2.1's main.js and this release's
    manifest.json says so once, with what to do.
    The README says the same.

About

Renders TikZ and LaTeX diagrams inside notes. No LaTeX installation, no network
access: the whole TeX engine is compiled to WebAssembly and runs locally, on
desktop and on mobile. Requires Obsidian 1.7.2.

Installing

In Obsidian: Settings → Community plugins → Browse, search for TikZJax Next. To install by hand,
download main.js, manifest.json and styles.css below into
<vault>/.obsidian/plugins/tikzjax-next/ and enable it in Settings → Community plugins.

Engine

tikzjax engine build
texlive flavour  apt
format inputs    c7787859baf598b4af634232748de4fe (sha256 over the 145 files latex.ltx pulled in)
tex changes      ifincsname.ch filesize-missing.ch jump-out.ch snapshot.ch (engine-build/changes, after web2js's)
tex banner       TeX 3.141592653 (TeX Live 2023/Debian)
TEXMFDIST        /usr/share/texlive/texmf-dist
web2js           0114ef5905dc387b70e72c654bcedd3b52b29fad
web2js codegen   function-declaration.js function-evaluation.js memory.js (engine-build/web2js-codegen, sha256 443f3a3b1d4d6231)
wasm-opt         --mvp-features -O4 (binaryen 132.0.0), no asyncify
tikzjax          461ac15f1c63351392115c4262d8179bc9922404
memory pages     2500 (156 MiB)
hash_prime       131071 (hash_size 600000)
tex_files        247
node             v22.23.3

pgf.sty                3.1.10
pgfplots.sty           1.18.1
pgfplotstable.sty      1.18.1
tikz.sty               3.1.10
circuitikz.sty         1.6.6
chemfig.sty            1.66
siunitx.sty            3.3.10
expl3.sty              2024-01-22
xparse.sty             2023-10-10
amsmath.sty            2023/05/13 v2.17o AMS math features
standalone.cls         2022/10/10 v1.3b Class to compile TeX sub-files standalone
tikz-cd.sty            2021/05/04 v1.0 Commutative diagrams with TikZ

SHA-256

b3f41380442f0e420e01399b852dabb39cc007ea6d8fc03934776eda8823687c  main.js
ebf086d11ae6a2f6e9ec3f636df1c7b27c9f49773d2927f1dee7d8a3a35590b2  styles.css
6587e32cf98b554aa02debf930b33f260c6de92e2390e02442722391c88c6eee  manifest.json

0.2.1

Choose a tag to compare

@github-actions github-actions released this 15 Oct 16:14

What's new in 0.2.1

The figures below were measured on my Windows desktop, in headless Chromium, the browser engine of
Obsidian's desktop app, and WebKit, the browser engine of the iPhone and iPad, through Playwright
rather than in Obsidian; where they compare with 0.2.0, it is 0.2.0 as released. None of them is
from a phone.

  • Updating from 0.2.0 compiles again only the diagrams that contain a character the engine has no
    font for, such as Chinese, Greek or Cyrillic, so that their labels show it, and the diagrams under
    a preamble file that ends with a comment and no newline (below). Every other diagram 0.2.0 cached
    is shown from the cache. Updating from 0.1.x compiles every cached diagram once more, the next
    time it is shown, as 0.2.0 did. From this release on the cache is tied to what the engine draws
    rather than to the exact build of it, so a release that only makes the engine faster no longer
    compiles every cached diagram again; one that changes what diagrams look like still does, and says
    so here.
  • A diagram that is not cached goes to the engine as soon as it comes into view. 0.2.0 made each one
    wait first, 300 ms on a computer and half a second on a phone, also when you had just opened the
    note. Only a diagram in a note you are typing in still waits for you to pause, so that it compiles
    once per pause and not at every keystroke. An edit that leaves a diagram as the note already
    showed it does not count as typing: once a session, as it first shows a code block, Obsidian makes
    such an edit to every open note without changing its text, and the diagrams Live Preview draws
    again just after it go to the engine at once. The TeX engine also starts as soon as a diagram
    turns out not to be cached, while the diagram is still on its way into view; it still never starts
    when every diagram shown is cached.
  • Diagrams that come into view together go to the engine from the top of the note down, so the
    first one you see is the first drawn, also while the engine is still starting: a diagram waiting
    for the engine gives its turn to one higher in the note. When a note has more new diagrams than
    the queue keeps, 16 on a phone or tablet and 64 on a computer, the "Render diagram" button goes to
    the ones the plugin met last, which, as a note opens, are the lowest in it.
  • TeX takes about a third less time. Over the 37 test diagrams 0.2.0 was released with, the fastest
    of seven runs each, TeX's time went from 2,827 to 1,850 ms in Chromium and from 4,210 to 2,772 ms
    in WebKit, and each diagram took 29% to 63% less in Chromium and 25% to 54% less in WebKit. The
    engine is compiled so that TeX keeps the values it works on where the processor reaches them
    directly, rather than in its memory; it is optimised with a newer binaryen; and its calls into the
    plugin, for every line and character TeX reads or prints, no longer make new arrays each time.
    Every test diagram 0.2.0 had draws as it did then, byte for byte; what draws differently is labels
    in other scripts and the two fixes below.
  • The engine starts in a third of the time: 54 ms instead of 162 in Chromium and 57 instead of 152
    in WebKit, medians of seven starts. The plugin hands the engine its files when it starts it,
    instead of carrying them inside the engine's own code, and the engine unpacks them with the
    system's own decompression where there is one, from iOS 16.4 on.
  • Saved preambles. A diagram whose preamble an earlier diagram has already compiled, with the same
    packages, libraries and preamble text, starts where that one stood once its \begin{document} was
    done, and TeX compiles only its body. That is every diagram after the first with the same
    preamble, the blocks of a note that are only a tikzpicture among them, and a diagram you are
    typing in, each time it compiles again. Drawn a second time in a row, circuitikz took 64 ms of TeX
    in Chromium, siunitx 10 and plain TikZ 4, where 0.2.0 took 314, 133 and 18, and the 37 test
    diagrams 752 ms where 0.2.0 took 2,827. The first diagram of each preamble pays for saving it, 11
    to 13 ms in Chromium, and about a tenth of a second without the JIT. A diagram drawn this way is
    the same, byte for byte, as one drawn from the start, and every release checks that for every test
    diagram and for 33 cases written to break it. An engine keeps up to 32 MB of saved preambles on a
    computer, and 12 MB on a phone or tablet or on a computer that reports less than 8 GB of memory.
  • Saved preambles are also kept in this device's own storage, in Obsidian's IndexedDB beside the
    diagram cache, never in the vault, so they are not synced with it. After the engine has stopped,
    after Obsidian restarts, or on a phone after the app was in the background, a diagram whose
    preamble is stored starts from it instead of loading its packages again. In WebKit with a phone's
    budgets, the first diagram after a fresh start of the browser, the engine's start included, took
    223 ms for circuitikz from its stored preamble where compiling the preamble took 426, and 153 for
    pgfplotstable where it took 358. Up to 64 MB are kept for each vault on a computer, and 16 MB on a
    phone or tablet or on a computer that reports less than 8 GB of memory, the preamble used least
    recently going first. A preamble the engine has no room left to keep is still saved once to be
    stored. Clearing the diagram cache deletes them too, which is the way to remove them
    from a device before uninstalling the plugin, since Obsidian does not tell a plugin it is being
    removed. The README says what a
    stored preamble holds.
  • Labels in Chinese, Japanese, Korean, Greek, Cyrillic, Arabic, Hebrew, Thai, Devanagari, IPA and
    emoji are drawn. The engine has no fonts for them, so TeX sets each character as a box one em wide
    and the plugin writes the character over it in your system's sans-serif font; nodes and arrows are
    placed around it as around any other text. 0.2.0 left each one out with "Unicode character … not
    set up for use with LaTeX". ¥ ¢ ‰ ½ № typed in a label, which made the whole diagram
    fail, are drawn the same way. In a text width node or a \parbox the text wraps: Chinese and
    Japanese between characters, though never before closing punctuation, and other scripts where a
    space is typed. Names in these scripts, of nodes, coordinates, styles, colours and \labels, work
    as they did in 0.2.0, and the pre-flight check no longer warns about any of these characters.
    The README lists what text drawn
    this way cannot do. Contributed by RepentStar in
    pull request #2.
  • The diagnostics view times each diagram from coming into view to drawn in the note, with every
    wait on the way, and of a diagram that waited for you to pause typing, which change to its note
    made it wait, or why a change did not; says how many times the engine started, how long each start
    took and why it stopped; says of each diagram whether it started from a saved or stored preamble,
    and where a preamble meant for storage went; and says whether TeX seems to run with the JIT
    compiler. Its Copy button copies all of it as text for a bug report: the plugin and Obsidian
    versions, the kind of device, what its WebView supports, the engine and every step's time, without
    your diagrams' code, their error messages or the names of your notes. Where the device does not
    let the plugin copy, the text is shown, to copy by hand.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in an engine
    of its own. Handed a note of 37 new diagrams at once, two engines drew them in 46 to 47% less time
    than one, in Chromium and in WebKit; a note you scroll through one diagram at a time gains less.
    The second engine starts only while diagrams wait, stops with the first, and took about 100 MiB
    more at the peak in Chromium. If it cannot start, the first carries on alone. Phones and tablets
    keep one engine, and so does a computer that reports less than 8 GB of memory.
  • Two new settings: Second engine, on a computer, turns the second engine off; Saved preambles turns
    saved preambles off, on any device, and deletes the stored ones, should a diagram ever draw
    differently from one. Please report the diagram if one does.
  • Without the JIT compiler, as with Lockdown Mode on an iPhone or iPad, TeX runs twenty to thirty
    times slower. The diagnostics view says whether TeX seems to run with the JIT: "on (probably)",
    "off (probably)" or "unclear". On an iPhone or iPad where two engine starts of a session have
    found it off, a notice says once that Lockdown Mode, if it is on, is the likely cause and how to
    exclude Obsidian from it. So that a phone that is only slow, in Low Power Mode or hot, is not
    taken for one without the JIT, the engine weighs its test against the rest of its own start, and
    takes it again a second later. Where Lockdown Mode turns WebAssembly off altogether, as it does on
    some versions of iOS, the diagram's card says so, where it said to close other apps.
  • When the main.js a device runs is not the version its manifest.json says, the plugin says so
    once, with how to put it right, and the diagnostics view shows both versions. Obsidian Sync
    Standard can leave a plugin like this when it carries installed plugins: it copies the new
    manifest.json and not main.js, which is over its 5 MB limit. A main.js older than this
    release cannot tell, so the first update this catches is the one after 0.2.1;
    the README says what to do until then.
  • The engine keeps one block of memory and, before each diagram, puts back only what the diagram
    before it changed, where 0.2.0 took a new 156 MiB block for every diagra...
Read more

0.2.1-beta.6

0.2.1-beta.6 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Oct 12:07

A pre-release, for testing. The community store keeps offering the latest full
release; BRAT installs this one.

What's new in 0.2.1-beta.6

The figures below were measured on my Windows desktop, in headless Chromium, the browser engine of
Obsidian's desktop app, and WebKit, the browser engine of the iPhone and iPad, through Playwright
rather than in Obsidian; where they compare with 0.2.0, it is 0.2.0 as released. None of them is
from a phone.

  • Updating from 0.2.0 compiles again only the diagrams that contain a character the engine has no
    font for, such as Chinese, Greek or Cyrillic, so that their labels show it, and the diagrams under
    a preamble file that ends with a comment and no newline (below). Every other diagram 0.2.0 cached
    is shown from the cache. Updating from 0.1.x compiles every cached diagram once more, the next
    time it is shown, as 0.2.0 did. From this release on the cache is tied to what the engine draws
    rather than to the exact build of it, so a release that only makes the engine faster no longer
    compiles every cached diagram again; one that changes what diagrams look like still does, and says
    so here.
  • A diagram that is not cached goes to the engine as soon as it comes into view. 0.2.0 made each one
    wait first, 300 ms on a computer and half a second on a phone, also when you had just opened the
    note. Only a diagram in a note you are typing in still waits for you to pause, so that it compiles
    once per pause and not at every keystroke. The TeX engine also starts as soon as a diagram turns
    out not to be cached, while the diagram is still on its way into view; it still never starts when
    every diagram shown is cached.
  • TeX takes about a third less time. Over the 37 test diagrams 0.2.0 was released with, the fastest
    of seven runs each, TeX's time went from 2,827 to 1,850 ms in Chromium and from 4,210 to 2,772 ms
    in WebKit, and each diagram took 29% to 63% less in Chromium and 25% to 54% less in WebKit. The
    engine is compiled so that TeX keeps the values it works on where the processor reaches them
    directly, rather than in its memory; it is optimised with a newer binaryen; and its calls into the
    plugin, for every line and character TeX reads or prints, no longer make new arrays each time.
    Every test diagram 0.2.0 had draws as it did then, byte for byte; what draws differently is labels
    in other scripts and the two fixes below.
  • The engine starts in a third of the time: 54 ms instead of 162 in Chromium and 57 instead of 152
    in WebKit, medians of seven starts. The plugin hands the engine its files when it starts it,
    instead of carrying them inside the engine's own code, and the engine unpacks them with the
    system's own decompression where there is one, from iOS 16.4 on.
  • Saved preambles. A diagram whose preamble an earlier diagram has already compiled, with the same
    packages, libraries and preamble text, starts where that one stood once its \begin{document} was
    done, and TeX compiles only its body. That is every diagram after the first with the same
    preamble, the blocks of a note that are only a tikzpicture among them, and a diagram you are
    typing in, each time it compiles again. Drawn a second time in a row, circuitikz took 64 ms of TeX
    in Chromium, siunitx 10 and plain TikZ 4, where 0.2.0 took 314, 133 and 18, and the 37 test
    diagrams 752 ms where 0.2.0 took 2,827. The first diagram of each preamble pays for saving it, 11
    to 13 ms in Chromium, and about a tenth of a second without the JIT. A diagram drawn this way is
    the same, byte for byte, as one drawn from the start, and every release checks that for every test
    diagram and for 33 cases written to break it. An engine keeps up to 32 MB of saved preambles on a
    computer, and 12 MB on a phone or tablet or on a computer that reports less than 8 GB of memory.
  • Saved preambles are also kept in this device's own storage, in Obsidian's IndexedDB beside the
    diagram cache, never in the vault, so they are not synced with it. After the engine has stopped,
    after Obsidian restarts, or on a phone after the app was in the background, a diagram whose
    preamble is stored starts from it instead of loading its packages again. In WebKit with a phone's
    budgets, the first diagram after a fresh start of the browser, the engine's start included, took
    223 ms for circuitikz from its stored preamble where compiling the preamble took 426, and 153 for
    pgfplotstable where it took 358. Up to 64 MB are kept for each vault on a computer, and 16 MB on a
    phone or tablet or on a computer that reports less than 8 GB of memory, the preamble used least
    recently going first. A preamble the engine has no room left to keep is still saved once to be
    stored. Clearing the diagram cache deletes them too, which is the way to remove them
    from a device before uninstalling the plugin, since Obsidian does not tell a plugin it is being
    removed. The README says what a
    stored preamble holds.
  • Labels in Chinese, Japanese, Korean, Greek, Cyrillic, Arabic, Hebrew, Thai, Devanagari, IPA and
    emoji are drawn. The engine has no fonts for them, so TeX sets each character as a box one em wide
    and the plugin writes the character over it in your system's sans-serif font; nodes and arrows are
    placed around it as around any other text. 0.2.0 left each one out with "Unicode character … not
    set up for use with LaTeX". ¥ ¢ ‰ ½ № typed in a label, which made the whole diagram
    fail, are drawn the same way. In a text width node or a \parbox the text wraps: Chinese and
    Japanese between characters, though never before closing punctuation, and other scripts where a
    space is typed. Names in these scripts, of nodes, coordinates, styles, colours and \labels, work
    as they did in 0.2.0, and the pre-flight check no longer warns about any of these characters.
    The README lists what text drawn
    this way cannot do. Contributed by RepentStar in
    pull request #2.
  • The diagnostics view times each diagram from coming into view to drawn in the note, with every
    wait on the way, and of a diagram that waited for you to pause typing, which change to its note
    made it wait; says how many times the engine started, how long each start took and why it
    stopped; says of each diagram whether it started from a saved or stored preamble, and where a
    preamble meant for storage went; and says whether TeX seems to run with the JIT compiler. Its Copy button copies all of it as text for a bug report:
    the plugin and Obsidian versions, the kind of device, what its WebView supports, the engine and
    every step's time, without your diagrams' code, their error messages or the names of your notes.
    Where the device does not let the plugin copy, the text is shown, to copy by hand.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in an engine
    of its own. Handed a note of 37 new diagrams at once, two engines drew them in 46 to 47% less time
    than one, in Chromium and in WebKit; a note you scroll through one diagram at a time gains less.
    The second engine starts only while diagrams wait, stops with the first, and took about 100 MiB
    more at the peak in Chromium. If it cannot start, the first carries on alone. Phones and tablets
    keep one engine, and so does a computer that reports less than 8 GB of memory.
  • Two new settings: Second engine, on a computer, turns the second engine off; Saved preambles turns
    saved preambles off, on any device, and deletes the stored ones, should a diagram ever draw
    differently from one. Please report the diagram if one does.
  • Without the JIT compiler, as with Lockdown Mode on an iPhone or iPad, TeX runs twenty to thirty
    times slower. The diagnostics view says whether TeX seems to run with the JIT: "on (probably)",
    "off (probably)" or "unclear". On an iPhone or iPad where two engine starts of a session have
    found it off, a notice says once that Lockdown Mode, if it is on, is the likely cause and how to
    exclude Obsidian from it. So that a phone that is only slow, in Low Power Mode or hot, is not
    taken for one without the JIT, the engine weighs its test against the rest of its own start, and
    takes it again a second later. Where Lockdown Mode turns WebAssembly off altogether, as it does on
    some versions of iOS, the diagram's card says so, where it said to close other apps.
  • When the main.js a device runs is not the version its manifest.json says, the plugin says so
    once, with how to put it right, and the diagnostics view shows both versions. Obsidian Sync
    Standard can leave a plugin like this when it carries installed plugins: it copies the new
    manifest.json and not main.js, which is over its 5 MB limit. A main.js older than this
    release cannot tell, so the first update this catches is the one after 0.2.1;
    the README says what to do until then.
  • The engine keeps one block of memory and, before each diagram, puts back only what the diagram
    before it changed, where 0.2.0 took a new 156 MiB block for every diagram and left the old ones
    for the browser to free when it got round to it. Over a run of 85 diagrams, the most memory the
    page had in use at once went from 318 to 278 MiB in Chromium and from 643 to 453 MiB in WebKit,
    medians of five runs. Right after the last diagram, with the engine waiting for the next, WebKit
    held more than with 0.2.0, 405 MiB against 226, because the engine keeps its memory and its saved
    preambles until it stops. On a phone it now stops after 15 seconds without a diagram, where 0.2.0
    waited 30.
  • A preamble file that ends with a comment and no newline after it, as some editors save one, ...
Read more

0.2.1-beta.5

0.2.1-beta.5 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Oct 08:47

A pre-release, for testing. The community store keeps offering the latest full
release; BRAT installs this one.

What's new in 0.2.1-beta.5

  • Updating from 0.2.0 recompiles only the diagrams that contain a character the engine has no font
    for, such as Chinese, Greek or Cyrillic, so that their labels show it (see the next point); every
    other diagram 0.2.0 cached is shown from the cache, as before. Updating from 0.1.x compiles every
    cached diagram once more, the next time it is shown, as 0.2.0 did. From this release on, the cache
    is tied to what the engine draws rather than to the exact build of it, so a release that only
    makes the engine faster no longer compiles every cached diagram once more. A release that changes
    what diagrams look like still does, and says so here.
  • Labels in Chinese, Greek, Cyrillic, Arabic, Hebrew, Thai, Devanagari, IPA and emoji are drawn.
    The engine has no fonts for them, so TeX sets each character as a box one em wide, and the
    plugin writes the character over it in your system's sans-serif font; nodes and arrows are
    placed around it as around any other text. Until now TeX left each one out with "Unicode
    character … not set up for use with LaTeX". ¥ ¢ ‰ ½ № typed in a label, which made the
    whole diagram fail, are drawn the same way. In a text width node or a \parbox the text
    wraps: Chinese and Japanese between characters, though never before closing punctuation, and
    other scripts where a space is typed. Names in these scripts, of nodes, coordinates, styles,
    colours and \labels, work as they did in 0.2.0. The README lists what the text drawn this way
    cannot do. From pull request #2.
  • Pre-flight no longer warns about characters the engine cannot typeset, in a label or in a name:
    the engine, its stand-ins for ° × £ € and the rest, or the sans-serif text above now draw
    every one of them, and names in any script work since 0.2.0. In maths, TeX's own $\alpha$
    still gives Computer Modern's α, where a typed α is drawn upright in sans-serif.
  • The diagnostics view shows the rest of a diagram's wait: how long it waited between coming into
    view and being handed to the queue, how long it took to be drawn in the note once its SVG was
    ready, and the whole time from coming into view to drawn. It also says how many times the engine
    started this session, how long each start took, and why it stopped. A Copy button copies it as
    text for a bug report: the plugin and Obsidian versions, the kind of device, what its WebView
    supports, the engine, and every step's time, without your diagrams' code, their error messages or
    the names of your notes. Where the device does not let the plugin copy, the text is shown, to copy
    by hand.
  • A diagram that is not cached goes to the engine as soon as it comes into view. Until now each
    one waited first, half a second on a phone and 300 ms on a desktop, also when you had just
    opened the note. Only a diagram in a note you are typing in still waits for you to pause, so that
    typing in it, in a second pane or beside a Reading view, compiles it once per pause and not at
    every keystroke.
  • The TeX engine starts as soon as a diagram turns out not to be in the cache, while the diagram is
    still on its way into view, instead of when it is about to be compiled. It still never starts
    when every diagram shown is cached, and an engine started for a diagram you never scroll to stops
    again once it has had nothing to do for a while, as before.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in a TeX
    engine of its own. Handed a note of 37 new diagrams at once, two engines drew them all in 46–47%
    less time than one, in WebKit and in Chromium, measured on a Windows desktop with this release's
    engine; a note you scroll through one diagram at a time gains less. The second engine starts only
    while diagrams wait, and stops with the first; in that note it took about 100 MiB more at the
    peak in Chromium, the browser engine of Obsidian's desktop app, measured on the same desktop. If
    it cannot start, the first carries on alone. Phones and tablets keep one engine, and so does a
    computer that reports less than 8 GB of memory; Settings → Second engine turns it off.
  • TeX takes about a third less time. Over 37 of the diagrams the plugin is tested with, measured on
    a Windows desktop against 0.2.1-beta.1, TeX's time went from 4.2 s to 2.8 s in WebKit, the
    browser engine of the iPhone and iPad, and from 2.8 s to 1.8 s in Chromium, the one Obsidian's
    desktop app is built on. Each of the 37 took at least 28% less in both, comparing each one's
    fastest of seven runs, but the first diagram after the engine starts only 11 to 16% less. Most of
    it is the engine, now compiled so that TeX keeps the values it works on where the processor
    reaches them directly, rather than in its memory, and optimised with a newer binaryen. The
    engine's calls into the plugin, for every line and every character TeX reads or prints, no longer
    make new arrays each time, which on its own took about 4% off. Every diagram draws as before, byte
    for byte, so none is compiled again for this. main.js is 60 KB smaller than 0.2.0's, and 72 KB
    smaller than 0.2.1-beta.1's. Nothing has been measured on a phone yet.
  • This release's engine leaves TeX less room to nest. Measured on the same desktop, 1,621 \number
    nested inside each other still draw in Chromium, where 0.2.1-beta.1 drew 2,344, and 19,950 in
    WebKit, where it drew between 20,049 and 21,281, depending on what it had compiled before.
    Android runs the same JavaScript engine as the desktop app, and neither Android nor an iPhone has
    been measured. Something nested deeper fails with "TeX nested deeper than the engine's stack
    allows.", as it did past the old limit. The deepest real diagrams tried draw as before, a forest
    tree 80 levels deep, 4,000 groups inside each other and a plot of 2,000 coordinates among them,
    and those three are now among the diagrams every release is tested with.
  • A line longer than TeX's buffer of 300,000 bytes, such as thousands of definitions written on one
    line, fails with "TeX cannot read a line longer than its buffer of 300,000 bytes." Since 0.2.0 it
    failed with "TeX nested deeper than the engine's stack allows.", which pointed at the wrong thing.
    Written a line each, the same definitions draw.
  • The TeX engine starts in well under half the time. Measured on a Windows desktop, from 145 to
    57 ms in WebKit and from 160 to 51 ms in Chromium. The plugin now hands the engine its files when
    it starts it, instead of carrying them inside the engine's own code, which every start had to read
    through first, and the engine unpacks them with the system's own decompression where there is
    one, from iOS 16.4 on. With that and the system's base64 decoding hidden from it, as on iOS 14.5
    to 16.3, the start went from 155 to 114 ms in WebKit on the same desktop. The diagnostics view
    shows, beside each engine start, how long unpacking and compiling took inside the engine, and
    whether the system's decompression and base64 decoding were used. Nothing has been measured on a
    phone yet.
  • The engine keeps one block of memory for TeX and, before each diagram, puts back only what the
    diagram before it changed. It used to take a new 156 MiB block for every diagram and leave the
    old ones for WebKit or Chromium to free when they got round to it. With this release's other
    changes to the engine, over a run of 85 diagrams on the same desktop against 0.2.1-beta.1, the
    most memory the page had in use at once went from 645 to 423 MiB in WebKit and from 318 to 235 MiB
    in Chromium, and the most it had committed from 2,954 to 1,754 MiB and from 939 to 582 MiB.
    Measured change by change, the one block alone took WebKit from 451 to 423 MiB and from 2,174 to
    1,755 MiB committed, most of the rest coming with the calls that no longer make new arrays; in
    Chromium it did most of it. What the page still held right after the last diagram, with the
    engine waiting for the next, went down in Chromium, from 272 to 195 MiB, but up in WebKit, from
    226 to 378 MiB, and from 575 to 1,423 MiB committed: the engine keeps its block while it waits,
    and the new blocks it takes after a diagram TeX gave up on still wait for the collector. On a
    phone the engine stops after 30 seconds without a diagram, and that gives it all back. After a
    diagram TeX gave up on, with an emergency stop or "TeX capacity exceeded", the next one starts
    from a new block; the diagnostics view says "new memory" for it, and "memory reset" for the
    others. Every release now checks, after each diagram of the test set in five different orders,
    that the block TeX is handed is the same as a new one, byte for byte.
  • Neither the faster start nor the one block of memory changes what a diagram looks like, so nothing
    cached is compiled again for them.
  • A diagram whose preamble an earlier diagram has already compiled starts where that one stood once
    its \begin{document} was done, and TeX compiles only its body. That is every diagram after the
    first with the same packages, libraries and preamble text, the blocks of a note that are only a
    tikzpicture among them, and a diagram you are typing in, each time it is compiled again. The
    first diagram of each preamble takes a few milliseconds more, to save where TeX stands, and about
    a tenth of a second without the JIT. Measured on a Windows desktop in headless WebKit and Chromium
    against 0.2.1-beta.2, with the 32 MB a computer keeps, rendering each of the 44 test diagrams
    twice in a row, the second took 35% less TeX time in WebKit, the browser engine of the iPhone and
    iPad, and 34% less in Chromium, the one of Obsidian's desktop app: a plain TikZ diagram 6 ms
    instead of 17 in WebKit and 4 instead of 11 in Chromiu...
Read more

0.2.1-beta.4

0.2.1-beta.4 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Oct 00:16

A pre-release, for testing. The community store keeps offering the latest full
release; BRAT installs this one.

What's new in 0.2.1-beta.4

  • Updating from 0.2.0 recompiles only the diagrams that contain a character the engine has no font
    for, such as Chinese, Greek or Cyrillic, so that their labels show it (see the next point); every
    other diagram 0.2.0 cached is shown from the cache, as before. Updating from 0.1.x compiles every
    cached diagram once more, the next time it is shown, as 0.2.0 did. From this release on, the cache
    is tied to what the engine draws rather than to the exact build of it, so a release that only
    makes the engine faster no longer compiles every cached diagram once more. A release that changes
    what diagrams look like still does, and says so here.
  • Labels in Chinese, Greek, Cyrillic, Arabic, Hebrew, Thai, Devanagari, IPA and emoji are drawn.
    The engine has no fonts for them, so TeX sets each character as a box one em wide, and the
    plugin writes the character over it in your system's sans-serif font; nodes and arrows are
    placed around it as around any other text. Until now TeX left each one out with "Unicode
    character … not set up for use with LaTeX". ¥ ¢ ‰ ½ № typed in a label, which made the
    whole diagram fail, are drawn the same way. In a text width node or a \parbox the text
    wraps: Chinese and Japanese between characters, though never before closing punctuation, and
    other scripts where a space is typed. Names in these scripts, of nodes, coordinates, styles,
    colours and \labels, work as they did in 0.2.0. The README lists what the text drawn this way
    cannot do. From pull request #2.
  • Pre-flight no longer warns about characters the engine cannot typeset, in a label or in a name:
    the engine, its stand-ins for ° × £ € and the rest, or the sans-serif text above now draw
    every one of them, and names in any script work since 0.2.0. In maths, TeX's own $\alpha$
    still gives Computer Modern's α, where a typed α is drawn upright in sans-serif.
  • The diagnostics view shows the rest of a diagram's wait: how long it waited between coming into
    view and being handed to the queue, how long it took to be drawn in the note once its SVG was
    ready, and the whole time from coming into view to drawn. It also says how many times the engine
    started this session, how long each start took, and why it stopped. A Copy button copies it as
    text for a bug report: the plugin and Obsidian versions, the kind of device, what its WebView
    supports, the engine, and every step's time, without your diagrams' code, their error messages or
    the names of your notes. Where the device does not let the plugin copy, the text is shown, to copy
    by hand.
  • A diagram that is not cached goes to the engine as soon as it comes into view. Until now each
    one waited first, half a second on a phone and 300 ms on a desktop, also when you had just
    opened the note. Only a diagram in a note you are typing in still waits for you to pause, so that
    typing in it, in a second pane or beside a Reading view, compiles it once per pause and not at
    every keystroke.
  • The TeX engine starts as soon as a diagram turns out not to be in the cache, while the diagram is
    still on its way into view, instead of when it is about to be compiled. It still never starts
    when every diagram shown is cached, and an engine started for a diagram you never scroll to stops
    again once it has had nothing to do for a while, as before.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in a TeX
    engine of its own. Handed a note of 37 new diagrams at once, two engines drew them all in 46–47%
    less time than one, in WebKit and in Chromium, measured on a Windows desktop with this release's
    engine; a note you scroll through one diagram at a time gains less. The second engine starts only
    while diagrams wait, and stops with the first; in that note it took about 100 MiB more at the
    peak in Chromium, the browser engine of Obsidian's desktop app, measured on the same desktop. If
    it cannot start, the first carries on alone. Phones and tablets keep one engine, and so does a
    computer that reports less than 8 GB of memory; Settings → Second engine turns it off.
  • TeX takes about a third less time. Over 37 of the diagrams the plugin is tested with, measured on
    a Windows desktop against 0.2.1-beta.1, TeX's time went from 4.2 s to 2.8 s in WebKit, the
    browser engine of the iPhone and iPad, and from 2.8 s to 1.8 s in Chromium, the one Obsidian's
    desktop app is built on. Each of the 37 took at least 28% less in both, comparing each one's
    fastest of seven runs, but the first diagram after the engine starts only 11 to 16% less. Most of
    it is the engine, now compiled so that TeX keeps the values it works on where the processor
    reaches them directly, rather than in its memory, and optimised with a newer binaryen. The
    engine's calls into the plugin, for every line and every character TeX reads or prints, no longer
    make new arrays each time, which on its own took about 4% off. Every diagram draws as before, byte
    for byte, so none is compiled again for this. main.js is 60 KB smaller than 0.2.0's, and 72 KB
    smaller than 0.2.1-beta.1's. Nothing has been measured on a phone yet.
  • This release's engine leaves TeX less room to nest. Measured on the same desktop, 1,621 \number
    nested inside each other still draw in Chromium, where 0.2.1-beta.1 drew 2,344, and 19,950 in
    WebKit, where it drew between 20,049 and 21,281, depending on what it had compiled before.
    Android runs the same JavaScript engine as the desktop app, and neither Android nor an iPhone has
    been measured. Something nested deeper fails with "TeX nested deeper than the engine's stack
    allows.", as it did past the old limit. The deepest real diagrams tried draw as before, a forest
    tree 80 levels deep, 4,000 groups inside each other and a plot of 2,000 coordinates among them,
    and those three are now among the diagrams every release is tested with.
  • A line longer than TeX's buffer of 300,000 bytes, such as thousands of definitions written on one
    line, fails with "TeX cannot read a line longer than its buffer of 300,000 bytes." Since 0.2.0 it
    failed with "TeX nested deeper than the engine's stack allows.", which pointed at the wrong thing.
    Written a line each, the same definitions draw.
  • The TeX engine starts in well under half the time. Measured on a Windows desktop, from 145 to
    57 ms in WebKit and from 160 to 51 ms in Chromium. The plugin now hands the engine its files when
    it starts it, instead of carrying them inside the engine's own code, which every start had to read
    through first, and the engine unpacks them with the system's own decompression where there is
    one, from iOS 16.4 on. With that and the system's base64 decoding hidden from it, as on iOS 14.5
    to 16.3, the start went from 155 to 114 ms in WebKit on the same desktop. The diagnostics view
    shows, beside each engine start, how long unpacking and compiling took inside the engine, and
    whether the system's decompression and base64 decoding were used. Nothing has been measured on a
    phone yet.
  • The engine keeps one block of memory for TeX and, before each diagram, puts back only what the
    diagram before it changed. It used to take a new 156 MiB block for every diagram and leave the
    old ones for WebKit or Chromium to free when they got round to it. With this release's other
    changes to the engine, over a run of 85 diagrams on the same desktop against 0.2.1-beta.1, the
    most memory the page had in use at once went from 645 to 423 MiB in WebKit and from 318 to 235 MiB
    in Chromium, and the most it had committed from 2,954 to 1,754 MiB and from 939 to 582 MiB.
    Measured change by change, the one block alone took WebKit from 451 to 423 MiB and from 2,174 to
    1,755 MiB committed, most of the rest coming with the calls that no longer make new arrays; in
    Chromium it did most of it. What the page still held right after the last diagram, with the
    engine waiting for the next, went down in Chromium, from 272 to 195 MiB, but up in WebKit, from
    226 to 378 MiB, and from 575 to 1,423 MiB committed: the engine keeps its block while it waits,
    and the new blocks it takes after a diagram TeX gave up on still wait for the collector. On a
    phone the engine stops after 30 seconds without a diagram, and that gives it all back. After a
    diagram TeX gave up on, with an emergency stop or "TeX capacity exceeded", the next one starts
    from a new block; the diagnostics view says "new memory" for it, and "memory reset" for the
    others. Every release now checks, after each diagram of the test set in five different orders,
    that the block TeX is handed is the same as a new one, byte for byte.
  • Neither the faster start nor the one block of memory changes what a diagram looks like, so nothing
    cached is compiled again for them.
  • A diagram whose preamble an earlier diagram has already compiled starts where that one stood once
    its \begin{document} was done, and TeX compiles only its body. That is every diagram after the
    first with the same packages, libraries and preamble text, the blocks of a note that are only a
    tikzpicture among them, and a diagram you are typing in, each time it is compiled again. The
    first diagram of each preamble takes a few milliseconds more, to save where TeX stands, and about
    a tenth of a second without the JIT. Measured on a Windows desktop in headless WebKit and Chromium
    against 0.2.1-beta.2, with the 32 MB a computer keeps, rendering each of the 44 test diagrams
    twice in a row, the second took 35% less TeX time in WebKit, the browser engine of the iPhone and
    iPad, and 34% less in Chromium, the one of Obsidian's desktop app: a plain TikZ diagram 6 ms
    instead of 17 in WebKit and 4 instead of 11 in Chromiu...
Read more

0.2.1-beta.3

0.2.1-beta.3 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 14 Oct 18:10

A pre-release, for testing. The community store keeps offering the latest full
release; BRAT installs this one.

What's new in 0.2.1-beta.3

  • Updating from 0.2.0 recompiles only the diagrams that contain a character the engine has no font
    for, such as Chinese, Greek or Cyrillic, so that their labels show it (see the next point); every
    other diagram 0.2.0 cached is shown from the cache, as before. Updating from 0.1.x compiles every
    cached diagram once more, the next time it is shown, as 0.2.0 did. From this release on, the cache
    is tied to what the engine draws rather than to the exact build of it, so a release that only
    makes the engine faster no longer compiles every cached diagram once more. A release that changes
    what diagrams look like still does, and says so here.
  • Labels in Chinese, Greek, Cyrillic, Arabic, Hebrew, Thai, Devanagari, IPA and emoji are drawn.
    The engine has no fonts for them, so TeX sets each character as a box one em wide, and the
    plugin writes the character over it in your system's sans-serif font; nodes and arrows are
    placed around it as around any other text. Until now TeX left each one out with "Unicode
    character … not set up for use with LaTeX". ¥ ¢ ‰ ½ № typed in a label, which made the
    whole diagram fail, are drawn the same way. In a text width node or a \parbox the text
    wraps: Chinese and Japanese between characters, though never before closing punctuation, and
    other scripts where a space is typed. Names in these scripts, of nodes, coordinates, styles,
    colours and \labels, work as they did in 0.2.0. The README lists what the text drawn this way
    cannot do. From pull request #2.
  • Pre-flight no longer warns about characters the engine cannot typeset, in a label or in a name:
    the engine, its stand-ins for ° × £ € and the rest, or the sans-serif text above now draw
    every one of them, and names in any script work since 0.2.0. In maths, TeX's own $\alpha$
    still gives Computer Modern's α, where a typed α is drawn upright in sans-serif.
  • The diagnostics view shows the rest of a diagram's wait: how long it waited between coming into
    view and being handed to the queue, how long it took to be drawn in the note once its SVG was
    ready, and the whole time from coming into view to drawn. It also says how many times the engine
    started this session, how long each start took, and why it stopped. A Copy button copies it as
    text for a bug report: the plugin and Obsidian versions, the kind of device, what its WebView
    supports, the engine, and every step's time, without your diagrams' code, their error messages or
    the names of your notes. Where the device does not let the plugin copy, the text is shown, to copy
    by hand.
  • A diagram that is not cached goes to the engine as soon as it comes into view. Until now each
    one waited first, half a second on a phone and 300 ms on a desktop, also when you had just
    opened the note. Only a diagram in a note you are typing in still waits for you to pause, so that
    typing in it, in a second pane or beside a Reading view, compiles it once per pause and not at
    every keystroke.
  • The TeX engine starts as soon as a diagram turns out not to be in the cache, while the diagram is
    still on its way into view, instead of when it is about to be compiled. It still never starts
    when every diagram shown is cached, and an engine started for a diagram you never scroll to stops
    again once it has had nothing to do for a while, as before.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in a TeX
    engine of its own. Handed a note of 37 new diagrams at once, two engines drew them all in 46–47%
    less time than one, in WebKit and in Chromium, measured on a Windows desktop with this release's
    engine; a note you scroll through one diagram at a time gains less. The second engine starts only
    while diagrams wait, and stops with the first; in that note it took about 100 MiB more at the
    peak in Chromium, the browser engine of Obsidian's desktop app, measured on the same desktop. If
    it cannot start, the first carries on alone. Phones and tablets keep one engine, and so does a
    computer that reports less than 8 GB of memory; Settings → Second engine turns it off.
  • TeX takes about a third less time. Over 37 of the diagrams the plugin is tested with, measured on
    a Windows desktop against 0.2.1-beta.1, TeX's time went from 4.2 s to 2.8 s in WebKit, the
    browser engine of the iPhone and iPad, and from 2.8 s to 1.8 s in Chromium, the one Obsidian's
    desktop app is built on. Each of the 37 took at least 28% less in both, comparing each one's
    fastest of seven runs, but the first diagram after the engine starts only 11 to 16% less. Most of
    it is the engine, now compiled so that TeX keeps the values it works on where the processor
    reaches them directly, rather than in its memory, and optimised with a newer binaryen. The
    engine's calls into the plugin, for every line and every character TeX reads or prints, no longer
    make new arrays each time, which on its own took about 4% off. Every diagram draws as before, byte
    for byte, so none is compiled again for this. main.js is 60 KB smaller than 0.2.0's, and 72 KB
    smaller than 0.2.1-beta.1's. Nothing has been measured on a phone yet.
  • This release's engine leaves TeX less room to nest. Measured on the same desktop, 1,621 \number
    nested inside each other still draw in Chromium, where 0.2.1-beta.1 drew 2,344, and 19,950 in
    WebKit, where it drew between 20,049 and 21,281, depending on what it had compiled before.
    Android runs the same JavaScript engine as the desktop app, and neither Android nor an iPhone has
    been measured. Something nested deeper fails with "TeX nested deeper than the engine's stack
    allows.", as it did past the old limit. The deepest real diagrams tried draw as before, a forest
    tree 80 levels deep, 4,000 groups inside each other and a plot of 2,000 coordinates among them,
    and those three are now among the diagrams every release is tested with.
  • A line longer than TeX's buffer of 300,000 bytes, such as thousands of definitions written on one
    line, fails with "TeX cannot read a line longer than its buffer of 300,000 bytes." Since 0.2.0 it
    failed with "TeX nested deeper than the engine's stack allows.", which pointed at the wrong thing.
    Written a line each, the same definitions draw.
  • The TeX engine starts in well under half the time. Measured on a Windows desktop, from 145 to
    57 ms in WebKit and from 160 to 51 ms in Chromium. The plugin now hands the engine its files when
    it starts it, instead of carrying them inside the engine's own code, which every start had to read
    through first, and the engine unpacks them with the system's own decompression where there is
    one, from iOS 16.4 on. With that and the system's base64 decoding hidden from it, as on iOS 14.5
    to 16.3, the start went from 155 to 114 ms in WebKit on the same desktop. The diagnostics view
    shows, beside each engine start, how long unpacking and compiling took inside the engine, and
    whether the system's decompression and base64 decoding were used. Nothing has been measured on a
    phone yet.
  • The engine keeps one block of memory for TeX and, before each diagram, puts back only what the
    diagram before it changed. It used to take a new 156 MiB block for every diagram and leave the
    old ones for WebKit or Chromium to free when they got round to it. With this release's other
    changes to the engine, over a run of 85 diagrams on the same desktop against 0.2.1-beta.1, the
    most memory the page had in use at once went from 645 to 423 MiB in WebKit and from 318 to 235 MiB
    in Chromium, and the most it had committed from 2,954 to 1,754 MiB and from 939 to 582 MiB.
    Measured change by change, the one block alone took WebKit from 451 to 423 MiB and from 2,174 to
    1,755 MiB committed, most of the rest coming with the calls that no longer make new arrays; in
    Chromium it did most of it. What the page still held right after the last diagram, with the
    engine waiting for the next, went down in Chromium, from 272 to 195 MiB, but up in WebKit, from
    226 to 378 MiB, and from 575 to 1,423 MiB committed: the engine keeps its block while it waits,
    and the new blocks it takes after a diagram TeX gave up on still wait for the collector. On a
    phone the engine stops after 30 seconds without a diagram, and that gives it all back. After a
    diagram TeX gave up on, with an emergency stop or "TeX capacity exceeded", the next one starts
    from a new block; the diagnostics view says "new memory" for it, and "memory reset" for the
    others. Every release now checks, after each diagram of the test set in five different orders,
    that the block TeX is handed is the same as a new one, byte for byte.
  • Neither the faster start nor the one block of memory changes what a diagram looks like, so nothing
    cached is compiled again for them.
  • A diagram whose preamble an earlier diagram has already compiled starts where that one stood once
    its \begin{document} was done, and TeX compiles only its body. That is every diagram after the
    first with the same packages, libraries and preamble text, the blocks of a note that are only a
    tikzpicture among them, and a diagram you are typing in, each time it is compiled again. The
    first diagram of each preamble takes a few milliseconds more, to save where TeX stands, and about
    a tenth of a second without the JIT. Measured on a Windows desktop in headless WebKit and Chromium
    against 0.2.1-beta.2, with the 32 MB a computer keeps, rendering each of the 44 test diagrams
    twice in a row, the second took 35% less TeX time in WebKit, the browser engine of the iPhone and
    iPad, and 34% less in Chromium, the one of Obsidian's desktop app: a plain TikZ diagram 6 ms
    instead of 17 in WebKit and 4 instead of 11 in Chromiu...
Read more

0.2.1-beta.2

0.2.1-beta.2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 14 Oct 10:33

A pre-release, for testing. The community store keeps offering the latest full
release; BRAT installs this one.

What's new in 0.2.1-beta.2

  • Updating from 0.2.0 recompiles only the diagrams that contain a character the engine has no font
    for, such as Chinese, Greek or Cyrillic, so that their labels show it (see the next point); every
    other diagram 0.2.0 cached is shown from the cache, as before. Updating from 0.1.x compiles every
    cached diagram once more, the next time it is shown, as 0.2.0 did. From this release on, the cache
    is tied to what the engine draws rather than to the exact build of it, so a release that only
    makes the engine faster no longer compiles every cached diagram once more. A release that changes
    what diagrams look like still does, and says so here.
  • Labels in Chinese, Greek, Cyrillic, Arabic, Hebrew, Thai, Devanagari, IPA and emoji are drawn.
    The engine has no fonts for them, so TeX sets each character as a box one em wide, and the
    plugin writes the character over it in your system's sans-serif font; nodes and arrows are
    placed around it as around any other text. Until now TeX left each one out with "Unicode
    character … not set up for use with LaTeX". ¥ ¢ ‰ ½ № typed in a label, which made the
    whole diagram fail, are drawn the same way. In a text width node or a \parbox the text
    wraps: Chinese and Japanese between characters, though never before closing punctuation, and
    other scripts where a space is typed. Names in these scripts, of nodes, coordinates, styles,
    colours and \labels, work as they did in 0.2.0. The README lists what the text drawn this way
    cannot do. From pull request #2.
  • Pre-flight no longer warns about characters the engine cannot typeset, in a label or in a name:
    the engine, its stand-ins for ° × £ € and the rest, or the sans-serif text above now draw
    every one of them, and names in any script work since 0.2.0. In maths, TeX's own $\alpha$
    still gives Computer Modern's α, where a typed α is drawn upright in sans-serif.
  • The diagnostics view shows the rest of a diagram's wait: how long it waited between coming into
    view and being handed to the queue, how long it took to be drawn in the note once its SVG was
    ready, and the whole time from coming into view to drawn. It also says how many times the engine
    started this session, how long each start took, and why it stopped. A Copy button copies it as
    text for a bug report: the plugin and Obsidian versions, the kind of device, what its WebView
    supports, the engine, and every step's time, without your diagrams' code, their error messages or
    the names of your notes. Where the device does not let the plugin copy, the text is shown, to copy
    by hand.
  • A diagram that is not cached goes to the engine as soon as it comes into view. Until now each
    one waited first, half a second on a phone and 300 ms on a desktop, also when you had just
    opened the note. Only a diagram in a note you are typing in still waits for you to pause, so that
    typing in it, in a second pane or beside a Reading view, compiles it once per pause and not at
    every keystroke.
  • The TeX engine starts as soon as a diagram turns out not to be in the cache, while the diagram is
    still on its way into view, instead of when it is about to be compiled. It still never starts
    when every diagram shown is cached, and an engine started for a diagram you never scroll to stops
    again once it has had nothing to do for a while, as before.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in a TeX
    engine of its own. Handed a note of 37 new diagrams at once, two engines drew them all in 46–47%
    less time than one, in WebKit and in Chromium, measured on a Windows desktop with this release's
    engine; a note you scroll through one diagram at a time gains less. The second engine starts only
    while diagrams wait, and stops with the first; in that note it took about 100 MiB more at the
    peak in Chromium, the browser engine of Obsidian's desktop app, measured on the same desktop. If
    it cannot start, the first carries on alone. Phones and tablets keep one engine, and so does a
    computer that reports less than 8 GB of memory; Settings → Second engine turns it off.
  • TeX takes about a third less time. Over 37 of the diagrams the plugin is tested with, measured on
    a Windows desktop against 0.2.1-beta.1, TeX's time went from 4.2 s to 2.8 s in WebKit, the
    browser engine of the iPhone and iPad, and from 2.8 s to 1.8 s in Chromium, the one Obsidian's
    desktop app is built on. Each of the 37 took at least 28% less in both, comparing each one's
    fastest of seven runs, but the first diagram after the engine starts only 11 to 16% less. Most of
    it is the engine, now compiled so that TeX keeps the values it works on where the processor
    reaches them directly, rather than in its memory, and optimised with a newer binaryen. The
    engine's calls into the plugin, for every line and every character TeX reads or prints, no longer
    make new arrays each time, which on its own took about 4% off. Every diagram draws as before, byte
    for byte, so none is compiled again for this. main.js is 60 KB smaller than 0.2.0's, and 72 KB
    smaller than 0.2.1-beta.1's. Nothing has been measured on a phone yet.
  • This release's engine leaves TeX less room to nest. Measured on the same desktop, 1,621 \number
    nested inside each other still draw in Chromium, where 0.2.1-beta.1 drew 2,344, and 19,950 in
    WebKit, where it drew between 20,049 and 21,281, depending on what it had compiled before.
    Android runs the same JavaScript engine as the desktop app, and neither Android nor an iPhone has
    been measured. Something nested deeper fails with "TeX nested deeper than the engine's stack
    allows.", as it did past the old limit. The deepest real diagrams tried draw as before, a forest
    tree 80 levels deep, 4,000 groups inside each other and a plot of 2,000 coordinates among them,
    and those three are now among the diagrams every release is tested with.
  • A line longer than TeX's buffer of 300,000 bytes, such as thousands of definitions written on one
    line, fails with "TeX cannot read a line longer than its buffer of 300,000 bytes." Since 0.2.0 it
    failed with "TeX nested deeper than the engine's stack allows.", which pointed at the wrong thing.
    Written a line each, the same definitions draw.
  • The TeX engine starts in well under half the time. Measured on a Windows desktop, from 145 to
    57 ms in WebKit and from 160 to 51 ms in Chromium. The plugin now hands the engine its files when
    it starts it, instead of carrying them inside the engine's own code, which every start had to read
    through first, and the engine unpacks them with the system's own decompression where there is
    one, from iOS 16.4 on. With that and the system's base64 decoding hidden from it, as on iOS 14.5
    to 16.3, the start went from 155 to 114 ms in WebKit on the same desktop. The diagnostics view
    shows, beside each engine start, how long unpacking and compiling took inside the engine, and
    whether the system's decompression and base64 decoding were used. Nothing has been measured on a
    phone yet.
  • The engine keeps one block of memory for TeX and, before each diagram, puts back only what the
    diagram before it changed. It used to take a new 156 MiB block for every diagram and leave the
    old ones for WebKit or Chromium to free when they got round to it. With this release's other
    changes to the engine, over a run of 85 diagrams on the same desktop against 0.2.1-beta.1, the
    most memory the page had in use at once went from 645 to 423 MiB in WebKit and from 318 to 235 MiB
    in Chromium, and the most it had committed from 2,954 to 1,754 MiB and from 939 to 582 MiB.
    Measured change by change, the one block alone took WebKit from 451 to 423 MiB and from 2,174 to
    1,755 MiB committed, most of the rest coming with the calls that no longer make new arrays; in
    Chromium it did most of it. What the page still held right after the last diagram, with the
    engine waiting for the next, went down in Chromium, from 272 to 195 MiB, but up in WebKit, from
    226 to 378 MiB, and from 575 to 1,423 MiB committed: the engine keeps its block while it waits,
    and the new blocks it takes after a diagram TeX gave up on still wait for the collector. On a
    phone the engine stops after 30 seconds without a diagram, and that gives it all back. After a
    diagram TeX gave up on, with an emergency stop or "TeX capacity exceeded", the next one starts
    from a new block; the diagnostics view says "new memory" for it, and "memory reset" for the
    others. Every release now checks, after each diagram of the test set in five different orders,
    that the block TeX is handed is the same as a new one, byte for byte.
  • Neither the faster start nor the one block of memory changes what a diagram looks like, so nothing
    cached is compiled again for them.

About

Renders TikZ and LaTeX diagrams inside notes. No LaTeX installation, no network
access: the whole TeX engine is compiled to WebAssembly and runs locally, on
desktop and on mobile. Requires Obsidian 1.7.2.

Installing

In Obsidian: Settings → Community plugins → Browse, search for TikZJax Next. To install by hand,
download main.js, manifest.json and styles.css below into
<vault>/.obsidian/plugins/tikzjax-next/ and enable it in Settings → Community plugins.

Engine

tikzjax engine build
texlive flavour  apt
format inputs    c7787859baf598b4af634232748de4fe (sha256 over the 145 files latex.ltx pulled in)
tex changes      ifincsname.ch filesize-missing.ch jump-out.ch (engine-build/changes, after web2js's)
tex banner       TeX 3.141592653 (TeX Live 2023/Debian)
TEXMFDIST        /usr/share/texlive/texmf-dist
web2js           0114ef5905dc387b70e72c654bcedd3b52b29fad
web2js codegen   function-declaration....
Read more

0.2.1-beta.1

0.2.1-beta.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 14 Oct 04:56

A pre-release, for testing. The community store keeps offering the latest full
release; BRAT installs this one.

What's new in 0.2.1-beta.1

  • Updating from 0.2.0 recompiles nothing: every diagram 0.2.0 cached is shown from the cache, as
    before. Updating from 0.1.x compiles every cached diagram once more, the next time it is shown, as
    0.2.0 did. From this release on, the cache is tied to what the engine draws rather than to the
    exact build of it, so a release that only makes the engine faster no longer compiles every cached
    diagram once more. A release that changes what diagrams look like still does, and says so here.
  • The diagnostics view shows the rest of a diagram's wait: how long it waited between coming into
    view and being handed to the queue, how long it took to be drawn in the note once its SVG was
    ready, and the whole time from coming into view to drawn. It also says how many times the engine
    started this session, how long each start took, and why it stopped. A Copy button copies it as
    text for a bug report: the plugin and Obsidian versions, the kind of device, what its WebView
    supports, the engine, and every step's time, without your diagrams' code, their error messages or
    the names of your notes. Where the device does not let the plugin copy, the text is shown, to copy
    by hand.
  • A diagram that is not cached goes to the engine as soon as it comes into view. Until now each
    one waited first, half a second on a phone and 300 ms on a desktop, also when you had just
    opened the note. Only a diagram in a note you are typing in still waits for you to pause, so that
    typing in it, in a second pane or beside a Reading view, compiles it once per pause and not at
    every keystroke.
  • The TeX engine starts as soon as a diagram turns out not to be in the cache, while the diagram is
    still on its way into view, instead of when it is about to be compiled. It still never starts
    when every diagram shown is cached, and an engine started for a diagram you never scroll to stops
    again once it has had nothing to do for a while, as before.
  • On a computer, two diagrams compile at once when several new ones are waiting, each in a TeX
    engine of its own. Handed a note of 37 new diagrams at once, two engines drew them all in 45–46%
    less time than one, in WebKit and in Chromium, measured on a Windows desktop with this release's
    engine; a note you scroll through one diagram at a time gains less. The second engine starts only
    while diagrams wait, takes about 100 MB more at its peak, measured in Node 22 on the same desktop,
    and stops with the first; if it cannot start, the first carries on alone. Phones and tablets keep
    one engine, and so does a computer that reports less than 8 GB of memory; Settings → Second engine
    turns it off.

About

Renders TikZ and LaTeX diagrams inside notes. No LaTeX installation, no network
access: the whole TeX engine is compiled to WebAssembly and runs locally, on
desktop and on mobile. Requires Obsidian 1.7.2.

Installing

In Obsidian: Settings → Community plugins → Browse, search for TikZJax Next. To install by hand,
download main.js, manifest.json and styles.css below into
<vault>/.obsidian/plugins/tikzjax-next/ and enable it in Settings → Community plugins.

Engine

tikzjax engine build
texlive flavour  apt
format inputs    c7787859baf598b4af634232748de4fe (sha256 over the 145 files latex.ltx pulled in)
tex changes      ifincsname.ch filesize-missing.ch jump-out.ch (engine-build/changes, after web2js's)
tex banner       TeX 3.141592653 (TeX Live 2023/Debian)
TEXMFDIST        /usr/share/texlive/texmf-dist
web2js           0114ef5905dc387b70e72c654bcedd3b52b29fad
wasm-opt         --mvp-features -O4 (binaryen 99.0.0), no asyncify
tikzjax          461ac15f1c63351392115c4262d8179bc9922404
memory pages     2500 (156 MiB)
hash_prime       131071 (hash_size 600000)
tex_files        247
node             v22.23.3

pgf.sty                3.1.10
pgfplots.sty           1.18.1
pgfplotstable.sty      1.18.1
tikz.sty               3.1.10
circuitikz.sty         1.6.6
chemfig.sty            1.66
siunitx.sty            3.3.10
expl3.sty              2024-01-22
xparse.sty             2023-10-10
amsmath.sty            2023/05/13 v2.17o AMS math features
standalone.cls         2022/10/10 v1.3b Class to compile TeX sub-files standalone
tikz-cd.sty            2021/05/04 v1.0 Commutative diagrams with TikZ

SHA-256

cd4dfcc2590108243bc38c3174e9b17d2e8248c0b0d1abe3f303567c357da238  main.js
9d45f156b9db1e0c3e810cedc460058053c95a8d62a415a302afbc48255e6ed2  styles.css
1bf9cbacc625f58a02af05f9a12cfc188db0f8d8265902c9411230902eece9df  manifest.json

0.2.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 18:26

What's new in 0.2.0

  • After updating, every cached diagram is compiled once more, the next time it is shown: the
    engine's id is part of the cache key, and it changed. Diagrams that rendered before come out the
    same, byte for byte, apart from the changes below.
  • TeX runs in a little over half the time: over the 26 diagrams 0.1.5 was tested with, its time went
    from 4.6 s to 2.5 s, measured in Node, which runs JavaScript and WebAssembly with the same
    engine as Obsidian on the desktop. The engine no longer carries asyncify, machinery in every
    function that 0.1.5 no longer used and still paid for, and TeX looks up its macros in a table
    spread wider, with shorter searches.
  • The TeX engine starts about three times as fast and needs far less memory. Most of its 156 MiB
    starting image is zeros, and now only the rest ships, is unpacked when the engine starts, and is
    copied into each compile. Measured on a Windows desktop in Node 22, whose JavaScript engine (V8)
    is the one Obsidian's desktop app runs: starting 529 → 161 ms, buffers held once started 157.5 →
    23.5 MiB, the most memory the process took over five compiles 703 → 168 MiB, and each compile
    about 20 ms quicker to set up. With both changes, a small diagram compiles in 27 ms where it took
    61, once the engine is running. Nothing has been measured on an iPhone or iPad yet.
  • A diagram on which TeX gives up, with "TeX capacity exceeded" from a macro that never stops
    expanding, an emergency stop, or a hundred errors, now fails at once with TeX's message, instead of
    waiting out its time budget and being reported as too slow. That includes a \usepgfplotslibrary
    the engine does not have. A diagram that switches TeX to \batchmode, which keeps TeX's messages
    off the terminal, gets its error from TeX's transcript file instead of "TeX produced no output",
    and a page TeX shipped before giving up is still drawn. Something nested a few thousand deep can
    run out of the engine's own stack before TeX reaches a limit of its own; that is now reported as
    TeX running out of room instead of "TeX produced no output", though TeX says nothing about it and
    a page it shipped before is lost.
  • ~ is a non-breaking space, as in LaTeX. Until now every ~ in a diagram gave three TeX errors
    and drew a stray tilde before its space, because the engine lacked the \ifincsname primitive
    LaTeX's ~ asks for. A node with Fig.~1 now comes out as TeX Live's own latex sets it.
  • Accented letters work where LaTeX makes a name of them: in a node or coordinate name, a style
    name, a \label key and its \ref, and an \edef. With \ifincsname LaTeX loads its current
    UTF-8 support instead of the one from before 2019, under which each of these gave "Missing
    \endcsname inserted" or a run of other errors. Most such diagrams failed; one with an accented
    \label was drawn with the errors, and now comes out without them, and so differently.
  • A diagram that loads a package the engine does not have is drawn without it, as LaTeX goes on
    when you press Return at its prompt, and LaTeX's "File x.sty' not found" is shown on the diagram. Until now the engine told LaTeX that every file existed and read a missing one as empty, so nothing said which package was missing, and anything it defines failed further down as an undefined control sequence. A diagram that loads a package it never uses, such as inputencoramsthm, is drawn as before, with that message on it. An \input` of a file the engine does not
    have now stops the diagram at once, with LaTeX's message, where it used to be read as an empty
    file.
  • pgfplotstable loads, as the README has said it does. Only its .sty was bundled, and that
    reads two files that were not, so a diagram that loaded it never finished.
  • The diagnostics view shows, under each diagram compiled, where its time went: waiting for other
    diagrams, waiting for the engine to start, setting up TeX's memory, TeX itself, turning TeX's
    output into SVG, and preparing that SVG for the note.

About

Renders TikZ and LaTeX diagrams inside notes. No LaTeX installation, no network
access: the whole TeX engine is compiled to WebAssembly and runs locally, on
desktop and on mobile. Requires Obsidian 1.7.2.

Installing

In Obsidian: Settings → Community plugins → Browse, search for TikZJax Next. To install by hand,
download main.js, manifest.json and styles.css below into
<vault>/.obsidian/plugins/tikzjax-next/ and enable it in Settings → Community plugins.

Engine

tikzjax engine build
texlive flavour  apt
format inputs    c7787859baf598b4af634232748de4fe (sha256 over the 145 files latex.ltx pulled in)
tex changes      ifincsname.ch filesize-missing.ch jump-out.ch (engine-build/changes, after web2js's)
tex banner       TeX 3.141592653 (TeX Live 2023/Debian)
TEXMFDIST        /usr/share/texlive/texmf-dist
web2js           0114ef5905dc387b70e72c654bcedd3b52b29fad
wasm-opt         --mvp-features -O4 (binaryen 99.0.0), no asyncify
tikzjax          461ac15f1c63351392115c4262d8179bc9922404
memory pages     2500 (156 MiB)
hash_prime       131071 (hash_size 600000)
tex_files        247
node             v22.23.3

pgf.sty                3.1.10
pgfplots.sty           1.18.1
pgfplotstable.sty      1.18.1
tikz.sty               3.1.10
circuitikz.sty         1.6.6
chemfig.sty            1.66
siunitx.sty            3.3.10
expl3.sty              2024-01-22
xparse.sty             2023-10-10
amsmath.sty            2023/05/13 v2.17o AMS math features
standalone.cls         2022/10/10 v1.3b Class to compile TeX sub-files standalone
tikz-cd.sty            2021/05/04 v1.0 Commutative diagrams with TikZ

SHA-256

f33ba74d2222d0be9b0ceb9c5be0fd21d03dfe30fd671be526b7199bbdc433a3  main.js
f5355f14961db4b769a95536178b67852188b8135798cd32a2067e002defb37f  styles.css
23593db0b82adc1074497aa3c039c7f0762b8a7ca05b24976ee53b8a19266951  manifest.json