Closed ktran9891 closed 6 years ago
First, I suggest that you use the minimal vimrc that I have proposed, that is, don't use Vundle. In this case it won't matter, but for some reason, it seems you have copied my suggested minimal vimrc, and then added complexity by using Vundle to load the plugin. That makes the vimrc file larger and less minimal.
In any case, please do this:
vim -u minivimrc --servername vim file.tex
\ll
\li
(this will show system information and information on the vimtex state)\lo
(this will show output from the latexmk compilation)Please provide the output from 3 and 4.
Ah. I did not fully appreciate what a "minimal .vimrc" meant until now. Here is my new .vimrc that I am testing with:
set nocompatible
" Load Vimtex
let &rtp = '~/.vim/bundle/vimtex,' . &rtp
let &rtp .= ',~/.vim/bundle/vimtex/after'
" Load other plugins, if necessary
" let &rtp = '~/path/to/other/plugin,' . &rtp
filetype plugin indent on
syntax enable
" Use Zathura when opening pdfs with vimtex
let g:vimtex_view_method = 'zathura'
The output of 3:
System info
OS: Mac OS X 10.12.6 (16G29)
Vim version: VIM 8.0 (1-858)
Has clientserver: true
Servername: VIM
vimtex project: tex_top
base: tex_top.tex
root: /Users/KTran/tex_top
tex: /Users/KTran/tex_top/tex_top.tex
out: /Users/KTran/tex_top/tex_top.pdf
log: /Users/KTran/tex_top/tex_top.log
aux: /Users/KTran/tex_top/tex_top.aux
fls: /Users/KTran/tex_top/tex_top.fls
document class: achemso
packages:
amsbsy
amsgen
amsmath
amsopn
amstext
auxhook
booktabs
caption
caption3
color
epstopdf-base
float
geometry
gettitlestring
graphics
graphicx
grfext
hobsub-generic
hobsub-hyperref
hyperref
ifpdf
ifvtex
ifxetex
infwarerr
kvoptions
ltxcmds
mciteplus
nameref
natbib
natmove
rerunfilecheck
setspace
trig
url
xkeyval
compiler: latexmk
backend: jobs
output: /var/folders/3y/grc5bbz509xf3bbf05x7zzvr0000gn/T/v9tdW2a/1
configuration:
continuous: 1
callback: 1
latexmk options:
-verbose
-pdf
-file-line-error
-synctex=1
-interaction=nonstopmode
job: process 31451 run
cmd: max_print_line=2000 latexmk -verbose -pdf -file-line-error -synctex=1 -interaction=nonstopmode -pvc -e '$new_viewer_always = "0"' -e '$pdf_previewer = "zathura -x \"vim --servername VIM --remote +\%{line} \%{input}\" \%S"' -e '$success_cmd = "'""'vim'""' --servername 'VIM' --remote-expr \"vimtex\#compiler\#callback(1)\""' -e '$failure_cmd = "'""'vim'""' --servername 'VIM' --remote-expr \"vimtex\#compiler\#callback(0)\""' 'tex_top.tex'
viewer: Zathura
xwin id: Warning: XTEST extension unavailable on '(null)'. Some functionality may be disabled; See 'man xdotool' for more info.
process:
pid: -
cmd: zathura -x "vim --servername VIM --remote +\%{line} \%{input}" --synctex-forward 1:3:'/Users/KTran/Nerd/tex_top/tex_top.tex' '/Users/KTran/Nerd/tex_top/tex_top.pdf' >/dev/null 2>&1 &
qf: LaTeX logfile
config:
fix_paths: 1
packages:
default: 1
default: 1
Output of 4:
Latexmk: All targets (tex_top.pdf) are up-to-date
For rule 'view', running '&if_source( )' ...
e not found a previewer that is already running.
So I will start it for 'tex_top.pdf'
------------
------------
Running 'start zathura -x "vim --servername VIM --remote +%{line} %{input}" "tex_top.pdf"'
------------
------------
Running 'vim --servername VIM --remote-expr "vimtex#compiler#callback(1)"'
------------
error: Error parsing command line arguments: Unknown option -x
I'm guessing the -x
option for Zathura exists in Linux, but not OS X? I used MacPorts to install my Zathura, and I am using the mupdf plugin.
Thank you for your help!
The problem here is, I think, that your Zathura is compiled without support for synctex. This has been a rather common problem. I don't use OSX myself, and so I don't know the best ways to install Zathura. But you should be able to compile Zathura from the source. If you make sure to have libsynctex available, you should be able to compile with synctex support.
I'm sorry that I can't be more helpful, but I hope this might lead you on the right path...
Thank you for your help. If I find a solution, I'll post here for others' future reference.
Thanks!
@ktran9891 If you're not tied to Zathura for some reason, I recommend Skim on macOS, where backward sync works out of the box.
@clason I am somewhat tied to Zathura (for the vim bindings), but I am open to Skim. I cannot find the hotkey for backwards search, though. Forwards search works out of the box.
Re: solution to the original, Zathura problem:
I am currently waiting on Girara to be updated on MacPorts.
@ktran9891 It's shift-command-left click
. Have you tried homebrew for installing (https://github.com/zegervdv/homebrew-zathura)? It seems to have far fewer problems than macports.
@clason
shift-command-left click
does not work for me. I thought maybe because I might not have actually installed SyncTex, but I double-checked via pdflatex -synctex=1 foo.tex
which worked fine. My MacTex's utility also showed that I have the Darwin version of syntex installed.
I actually tried that installation before MacPorts. For me, brew install zathura-pdf-poppler
fails from mkdir: /usr/local/Cellar/zathura/0.3.7/lib/zathura: Operation not permitted
, but sudo brew
is not allowed by Homebrew.
Thanks for pitching in, @clason! I'll be following the thread, and if I have anything helpful to add, I will contribute.
You need to configure Skim for your editor (which depends on whether you use MacVIM or (any GUI for) neovim; there's a preset in the Preferences (sync
pane) for MacVIM which also works for neovim if you replace the command by nvr
).
For homebrew on newer versions of macOS, you might have issues with newer versions due to the stricter system protection. It should be sufficient to reinstall homebrew with the ruby
command line on the homepage. (sledgehammer solution: chown -R $user /usr/local/Cellar
...)
Interesting. I've been using vim that I compiled from source. So I guess I'll need to start using gvim or neovim for backwards searching to work here?
It should not be necessary if you Vim has the +clientserver
, which you do have. That is, of course, if I have not missed other requirements (but I don't think so).
You need to start Vim with the --servername X
option, which you are already doing. Then you can send commands to Vim from the terminal with vim --servername X --remote-send ...
(or other remote options). Thus, in your Skim configuration, you should either specify a servername explicitly, else it will use the first from the list of servers that you can see from vim --serverlist
.
Update for other Mac users Here's what I have done so far:
port install girara
find / -name girara*.pc
. It turned out to be in /opt/local/lib/pkgconfig
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"
cd
'd into the Zathura repository and did a make install
xdotool
rights to use "test extensions", which are effectively packages that are "under development". I did his by doing:
defaults write org.x.X11 enable_test_extensions -boolean true
defaults write org.macosforge.xquartz.X11 enable_test_extensions -bool yes
Question for vimtex maintainers
After doing all of the above setup/installations, I tried again. I used the same minivimrc as above. I now get a vimtex: Viewer can not find Zathura window ID!
error. Here is the result of \li
:
System info
OS: Mac OS X 10.12.6 (16G29)
Vim version: VIM 8.0 (1-858)
Has clientserver: true
Servername: VIM
vimtex project: Personal_statement
base: Personal_statement.tex
root: /path/to/my/
tex: /path/to/my/minimal.tex
out: /path/to/my/minimal.pdf
log: /path/to/my/minimal.log
aux: /path/to/my/minimal.aux
fls: /path/to/my/minimal.fls
document class: article
packages:
calc
epstopdf-base
etexcmds
everyshi
geometry
graphics
graphicx
grfext
ifluatex
ifpdf
ifthen
ifvtex
ifxetex
infwarerr
kvdefinekeys
kvoptions
kvsetkeys
ltxcmds
microtype
pdftexcmds
pgf
pgfcomp-version-0-65
pgfcomp-version-1-18
pgfcore
pgffor
pgfkeys
pgfmath
pgfrcs
pgfsys
setspace
textcomp
tikz
titlesec
todonotes
trig
xcolor
xkeyval
compiler: latexmk
backend: jobs
output: /var/folders/3y/grc5bbz509xf3bbf05x7zzvr0000gn/T/vKipthl/1
configuration:
continuous: 1
callback: 1
latexmk options:
-verbose
-pdf
-file-line-error
-synctex=1
-interaction=nonstopmode
job: process 91284 run
cmd: max_print_line=2000 latexmk -verbose -pdf -file-line-error -synctex=1 -interaction=nonstopmode -pvc -e '$new_viewer_always = "0"' -e '$pdf_previewer = "zathura -x \"vim --servername VIM --remote +\%{line} \%{input}\" \%S"' -e '$success_cmd = "'""'vim'""' --servername 'VIM' --remote-expr \"vimtex\#compiler\#callback(1)\""' -e '$failure_cmd = "'""'vim'""' --servername 'VIM' --remote-expr \"vimtex\#compiler\#callback(0)\""' 'minimal.tex'
viewer: Zathura
xwin id: 0
process:
pid: -
cmd: zathura -x "vim --servername VIM --remote +\%{line} \%{input}" --synctex-forward 2:1:'/path/to/my/minimal.tex' '/path/to/my/minimal.pdf' >/dev/null 2>&1 &
qf: LaTeX logfile
config:
fix_paths: 1
packages:
default: 1
default: 1
Any thoughts?
Yes: You should be able to run the zathura
command from a terminal. It should give clear pointers to why it does not work. My suspicion is still that your zathura does not have libsynctex included, which will make the -x
option an error. In general, all of the vimtex commands may be run directly from a terminal, and so this is the best place to debug when things like xdotool/zathura does not work as expected.
A minor suggestion: Use the minimal
class when you define a minimal example. It will make the \li
information more dense, since it does not load any packages.
@andymass I am opening a new issue to avoid spamming the previous thread, which is probably a different fundamental issue.
Doing a
vim --servername local file.tex
and then\ll
yielded a successful compilation, but Zathura did not open. I did a separatezathura file.pdf
to check my Zathura; it's working fine.Here is my
.vimrc
. I use Vundle, so my "load Vimtex" section is different. I am also not entirely literate in vim script, so please let me know if thelet &rtp *
lines are actually necessary. My.latexmkrc
file is empty.