primary-theme / obsidian

Comfy, playful but productive theme for Obsidian. "Primary instantly puts you in a relaxed state that opens the door to creativity and exploration. Wonderfully executed down to the smallest details,"
GNU General Public License v3.0
1.08k stars 46 forks source link

Latex equations render with a white box around the equation #253

Closed rachelkd closed 1 month ago

rachelkd commented 1 month ago

Primary Theme Version

v2.10.0

Debug Info

SYSTEM INFO: Obsidian version: v1.6.7 Installer version: v1.6.7 Operating system: Darwin Kernel Version 24.1.0: Tue Sep 17 07:47:56 PDT 2024; root:xnu-11215.40.59~38/RELEASE_ARM64_T6020 24.1.0 Login status: logged in Catalyst license: none Insider build toggle: off Live preview: on Base theme: light Community theme: Primary v2.10.0 Snippets enabled: 2 Restricted mode: off Plugins installed: 55 Plugins enabled: 52 1: Better Word Count v0.10.1 2: BRAT v1.0.3 3: Calendar v1.5.10 4: Code Editor Shortcuts v1.14.0 5: Dataview v0.5.67 6: Digital Garden v2.57.2 7: Force note view mode v1.2.2 8: Full Calendar v0.10.7 9: Imgur v2.6.1 10: Linter v1.26.0 11: Natural Language Dates v0.6.2 12: Paste URL into selection v1.7.0 13: Smart Typography v1.0.18 14: Style Settings v1.0.9 15: Tag Wrangler v0.6.1 16: Tasks v7.10.1 17: Templater v2.7.1 18: Lazy Plugin Loader v1.0.18 19: Regex Find/Replace v1.2.0 20: Google Calendar v1.10.15 21: Codeblock Customizer v1.2.8 22: Git v2.27.0 23: Workspaces Plus v0.3.3 24: Homepage v4.0.4 25: List Callouts v1.2.9 26: Callout Manager v1.1.0 27: Tracker v1.14.0 28: Quick Latex v2.6.5 29: Typewriter Mode v0.0.14 30: Callout Suggestions v1.0.2 31: Advanced Cursors v0.5.1 32: Latex Suite v1.9.5 33: Extended MathJax v0.4.1 34: Hover Editor v0.11.20 35: HTML Tags Autocomplete v0.0.7 36: Spaced Repetition v1.12.7 37: ToggleList v1.2.7 38: Typing speed v1.2.1 39: Automatic Table Of Contents v1.4.0 40: Better Export PDF v1.9.2 41: Enhancing Mindmap v0.2.5 42: Excalidraw v2.5.0 43: Focus Mode v1.11.4 44: Highlightr v1.2.2 45: Kanban v2.0.51 46: Kindle Highlights v1.9.2 47: Meld Encrypt v2.3.7 48: Outliner v4.8.1 49: Settings Search v1.3.10 50: Text Snippets v0.1.2 51: Underline v1.3.0 52: Zotero Integration v3.2.1

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the enhancement

When in reading mode, LaTeX math equations render with a white box around it. Here is the sample markdown code.

$\text{size}($![|50](https://i.imgur.com/WRPXnU5.png)$\begin{align}) = 1 + \text{size}(t_{1}) + \text{size}(t_{2}) &&&& \text{(by definition of size)}\end{align}$
$$\begin{align*}
&\leq 1 + 2^{\text{height}(t_{1})} + 2^{\text{height}(t_{2})} && \text{(by IH)} \\
&\leq 1 + 2^{\text{max}\Big(\text{height}(t_{1}), \text{height}(t_{2})\Big)} \cdot 2 && (\because 2^{h_{1}} + 2^{h_{2}} \leq 2^{\text{max}(h_{1}, h_{2})} + 2^{\text{max}(h_{1}, h_{2})} = 2 \cdot 2^{\text{max}\Big(h(t_{1}), h(t_{2})\Big)}) \\
&= \bbox[pink]{1} + 2^{\text{max}(\text{height}(t_{1}), \text{height}(t_{2}))+1}
\end{align*}$$

Here is an example of what is happening: https://i.imgur.com/RRRYLWM.mp4

ceciliamay commented 1 month ago

hey there @rachelkd ! i just checked this but it doesn't seem to be occurring on my end. it also doesn't occur in the default theme.

https://github.com/user-attachments/assets/b632ec65-d773-47f1-94e7-4f4002fec207

maybe you have a snippet or plugin that's affecting it? please try disabling all your snippets and plugins, then toggle them on one by one so you can find the culprit. let me know how it goes.

rachelkd commented 1 month ago

Hey, @ceciliamay ! I can confirm that this issue still occurs with all snippets turned off and community plugins disabled. It also occurs in a sandbox vault. I tried adjusting --file-line-width in a snippet to see if it was margins affecting the rendering, but even with that and readable line width turned off, it doesn't seem to work.

Video

ceciliamay commented 1 month ago

ohhh okay thanks for the additional info. i've tried it in the sandbox vault and still no luck in reproducing it on my end. i took a look at the video you sent again and i have a theory that this might be due to the scrollbar behavior, as i'm seeing the scrollbar take up the white margin. so i think this is at the os-level. can you check in your macOS system setting for these:

CleanShot 2024-10-09 at 18 59 39@2x

you can search scrollbar behavior and it should show up. mine is set at "when scrolling" and the issue doesn't occur. if yours isn't at "when scrolling" can you try selecting it and see if the issue still occurs?

rachelkd commented 1 month ago

I guess it is at the OS-level! Turned show scroll bars to when scrolling, and the issue went away.

ceciliamay commented 1 month ago

yay!! that's great to hear. will close this now. thanks for posting!!