RyotaUshio / obsidian-latex-theorem-equation-referencer

A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
https://ryotaushio.github.io/obsidian-latex-theorem-equation-referencer/
MIT License
147 stars 6 forks source link

Theorems not numbered in PDF export in version 2 #197

Closed RyotaUshio closed 7 months ago

RyotaUshio commented 7 months ago

This seems to be due to the Obsidian's PDF export's implementation where context.getSectionInfo() always returns null.

// from Obsidian's app.js

t.prototype.print = function(e, t, n) {
                return v(this, void 0, Promise, (function() {
                    var i, r, o, a, s, l, c, u, h, p, d, f, g;
                    return y(this, (function(m) {
                        switch (m.label) {
                        case 0:
                            return i = e.createDiv("markdown-preview-view markdown-rendered"),
                            o = (r = this).app,
                            a = r.file,
                            i.toggleClass("rtl", o.vault.getConfig("rightToLeft")),
                            i.toggleClass("show-properties", "hidden" !== o.vault.getConfig("propertiesInDocument")),
                            n && i.createEl("h1", {
                                text: a.basename
                            }),
                            [4, this.app.vault.cachedRead(a)];
                        case 1:
                            return s = m.sent(),
                            l = rx(s),
                            c = cx(l),
                            u = ux(l),
                            h = hM(u),
                            i.appendChild(h),
                            i.addClasses(mx(c)),
                            p = [],
                            DP.postProcess(o, {
                                docId: $e(16),
                                sourcePath: a.path,
                                frontmatter: c,
                                promises: p,
                                addChild: function(e) {
                                    return t.addChild(e)
                                },
                                getSectionInfo: function() {
                                    return null
                                },
                                containerEl: i,
                                el: i,
                                displayMode: !0
                            }),
                            p.length > 0 ? [4, Promise.all(p)] : [3, 3];
                        case 2:
                            m.sent(),
                            m.label = 3;
                        case 3:
                            for (d = i.findAll("a.internal-link"),
                            f = 0,
                            g = d; f < g.length; f++)
                                g[f].removeAttribute("href");
                            return [2, i]
                        }
                    }
                    ))
                }
                ))
            }
RyotaUshio commented 7 months ago

The long-standing issue #170 might be due to the same reason.