l1xnan / obsidian-better-export-pdf

Obsidian PDF export enhancement plugin
MIT License
339 stars 21 forks source link

[BUG] Rendering of some elements (mainly LaTeX is different compared to default export #343

Open ZeroKun265 opened 2 weeks ago

ZeroKun265 commented 2 weeks ago

So i noticed that some stuff renders differently compared to the default obsidian export This comparison is between BetterPDF export (multiple note render, issue arises on single note too tho) on the left and Obsidian export to pdf on the right image IF it was just slightly different font i'd be okay with it, but this removes stuff like \mathbb and breaks some other stuff like a big curly bracket which looks like this:

image

Tested on Linux (Fedora 40, fully updated) and flatpak version of obsidian(fully updated), both in my vault and a test vault with no other stuff other than this plugin Have yet to try on windows, i can't as of writing this.

l1xnan commented 6 days ago

I suspect it is only a problem on Linux. This problem will not occur on Windows. Can you share your test file?

ZeroKun265 commented 1 day ago

Hi, sorry for the late reply Yes i can share this exact document ( i don't think there's a need for all the documents, the issue arises on single export too) testing.zip There's the document and the exported pdf on linux

l1xnan commented 1 day ago

I have conducted some tests.

  1. There are problems on Windows.
  2. There are problems with the official export.
  3. For the same formula, when rendered on the MathJax online website and the web page is saved as a PDF, there is no problem.

Another rather strange phenomenon is that when the PDF zoom ratio is adjusted to 75%, the formula visually no longer appears broken. image

Given that the plugin only calls the printToPDF interface of Electron without any other doing, I suspect that it is an issue at the bottom layer of Electron/Chromium. Subsequently, I will test Electron separately to further confirm which part the problem actually lies in. Currently, this BUG may persist for a while.