High CPU when using URI with \href{} in LaTeX (maybe linux specific)

What I’m trying to do

I am trying to open a file (Standard Topology on R.md) in my “MathWiki” vault from a LaTeX document using the Obsidian URI as follows:

\href{obsidian://open?vault=MathWiki&file=Standard%20Topology%20on%20R.md}{Click}

I am able to click on the link in the pdf output and Obsidian successfully opens the file. However, my cpu stays at 100% indefinitely. Here is htop:


Clicking the link several times will spawn more tasks identical to the one in the first line, all with cpu usage at 100%.

Things I have tried

I have followed the instructions here:

OS: Arch Linux
Version: Obsidian 0.15.9-1
Electron version: 18.3.6-1


Content of /usr/share/applications/obsidian.desktop

[Desktop Entry]
Name=Obsidian
Exec=/usr/bin/obsidian %U
Terminal=false
Type=Application
Icon=obsidian
StartupWMClass=obsidian
Comment=Obsidian
MimeType=x-scheme-handler/obsidian;
Categories=Office;

Content of ~/.config/mimeapps.list

[Default Applications]
x-scheme-handler/obsidian=obsidian.desktop

Output of xdg-mime query default x-scheme-handler/obsidian and xdg-settings get default-url-scheme-handler obsidian are both obsidian.desktop.

Both

xdg-open obsidian://open?vault=MathWiki\&file=Standard%20Topology%20on%20R.md &

and

obsidian obsidian://open?vault=MathWiki\&file=Standard%20Topology%20on%20R.md &

work perfectly; cpu stays normal. Inserting [text](obsidian://open?vault=MathWiki&file=Standard%20Topology%20on%20R.md) in any note in my vault works too.


Also, \href{https://...}{...} works, so theres nothing wrong with the hyperref package. I have also tried

\url{obsidian://open?vault=MathWiki&file=Standard%20Topology%20on%20R.md}

with the same cpu result.


Reinstalling Obsidian changed nothing. I also tried the using the AppImage, with the same result.

Does obsidian open in the end or it doesn’t open and you only see high cpu?

what happens when you open the same link from somewhere else?
Is this really a problem of pdfs?

Does it happen if you use another desktop environment? KDE or Gnome?

Obsidian opens when I press the link in the pdf, and everything seems fine except for the high cpu usage.

I tried opening the same link from the command line and from within obsidian itself, but they all work fine (no cpu issue).

I will need to check about the other DEs. There is no issue on windows though, so it might be a linux specific issue.

This is too much of niche problem and I am not even sure it’s our problem. We won’t look into it. If you figure out what the issue is, let us know.

After some more testing, the issue seems to stem from my pdf-viewer Zathura and how it is opened via Neovim’s Vimtex plugin for forward/inverse search. It opens zathura as

zathura -x /usr/bin/nvim --headless -c "VimtexInverseSearch %{line} '${input}'" --synctex-forward 1:1:/home/zhao/..../name.tex name.pdf

but if I open zathura manually (that is, without the flags), everthing works fine.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.