-
Notifications
You must be signed in to change notification settings - Fork 409
Description
Description
I've been trying out various previewers recently due to dissatisfaction of them (unrelated to vimtex itself):
- Skim has to be launched by neovim for inverse searching to work, but since I use it as my main pdf viewer for papers it's not convenient.
- zathura is great overall as a previewer, but trackpad scrolling and keyboard scrolling have vastly different speed so no matter what it's always janky.
- sioyek is not polished enough, specifically its font rendering is buggy for multiple displays with different dpi
So it leads to me trying out configuring TeXShop. As it turns out, vimtex's setup seems not working for me. I dug into the source and extracted the AppleScript code and tested it. Maybe it's due to OS version (I'm on Sonoma), I'm very surprised to find out that it has syntax errors.
I modified the code and finally got it working and it seems good enough. During my testing I also found out some shortcomings of the original code:
- Notably it will only do forward searching for the "front most document" opened by TeXShop. So if I have multiple projects open, only one of them at a time can have forward searching. I fixed it on my machine by checking the corresponding pdf everytime instead of using the front most one.
- When synctex is set, the current code also opens tex file in TeXShop and launches TeXShop's compiler for some reason, which seems completely unnecessary? I deleted the line and it seemed perfectly fine.
- Related to above, when synctex is set, unlike other viewing method like Skim, which simply appends some command to include synctex, the code for TeXShop overwrites it with new command. So the behavior is weird: no synctex => launch previewer normally; yes synctex => launch tex file and compile. I don't know why it was coded this way.
The reason I didn't create a PR is that I don't know if the original author had other intentions and if there is compatibility issues across macos versions. And I'm also not quite familiar with PRs (only done a very tiny one before). If anyone can confirm this issue I'd be happy to submit a PR later.
Steps to reproduce
Set g:vimtex_view_method to "texshop", and launch viewer.
Expected behavior
TeXShop opens with the pdf only, and forward/inverse searching working.
Actual behavior
As is, nothing shows up. I described several other issues after testing the code in the description.
Do you use a latexmkrc file?
Yes
VimtexInfo
It's irrelevant as I was able to pin the error to the AppleScript code in texshop.vim