Closed Aneeqasif closed 1 year ago
Thanks, I think my last commit may have fixed your problem. Can you update and test?
Your configuration is quite "messy". The following is a reduced version of your configuration where I've:
-- Notice that these options are window and buffer local options
vim.wo.conceallevel = 2
vim.bo.spelllang = "en_gb"
vim.g.vimtex_syntax_conceal = {
sections = 1,
}
vim.g.vimtex_context_pdf_viewer = "okular"
vim.g.vimtex_view_general_viewer = "okular"
vim.g.vimtex_view_general_options = "--unique file:@pdf\\#src:@line@tex"
vim.g.vimtex_mappings_prefix = "<localleader>v"
vim.g.vimtex_toc_config = {
show_help = 0,
layer_status = {
content = 1,
label = 0,
todo = 1,
include = 0
}
}
vim.g.vimtex_log_ignore = {
"Underfull \\\\hbox",
"Overfull \\\\hbox",
"LaTeX Warning: .\\+ float specifier changed to",
"LaTeX hooks Warning",
'Package siunitx Warning: Detected the "physics" package:',
"Package hyperref Warning: Token not allowed in a PDF string",
"Compilation completed",
}
vim.g.vimtex_quickfix_mode = 0
vim.g.vimtex_fold_enabled = 1
vim.g.vimtex_fold_manual = 1
the issue got fixed. thank you so much for that :heart: . i have a lil problem with inverse search through zathura like by shift+r-click to get to the code in latex (which does work in okular) can u give me some pointer how to do that or what can be issue for this. :)
zathura --version (from arch official extra repo)
zathura 0.5.2
girara 0.3.9 (runtime: 0.4.0)
(plugin) djvu (0.2.9) (/usr/lib/zathura/libdjvu.so)
(plugin) pdf-mupdf (0.4.0) (/usr/lib/zathura/libpdf-mupdf.so)
and how can i do add this in lua i need to do it when working with using minted package
-- " let g:vimtex_compiler_latexmk.options += ['-shell-escape']
the issue got fixed. thank you so much for that
Glad to hear it!
i have a lil problem with inverse search through zathura like by shift+r-click to get to the code in latex (which does work in okular) can u give me some pointer how to do that or what can be issue for this. :)
Inverse search in Zathura is activated with ctrl + right-click. Perhaps that's your problem?
and how can i do add this in lua i need to do it when working with using minted package
-- " let g:vimtex_compiler_latexmk.options += ['-shell-escape']
vim.g.vimtex_compiler_latexmk = {
options = {
"-verbose",
"-file-line-error",
"-synctex=1",
"-interaction=nonstopmode",
"-shell-escape",
}
}
Inverse search in Zathura is activated with ctrl + right-click
yeah i have tried this many times and it donot work :(
Strange. It works for me. I'm also on Arch Linux.
What's the output of these commands?
ldd /usr/bin/zathura|grep sync
zathura --help|grep -- -x
Also, can you provide a proper minimal example for this? Preferable with a minimal vimrc file, e.g. test.vim
with this content:
set nocompatible
set runtimepath^=~/.local/plugged/vimtex
set runtimepath+=~/.local/plugged/vimtex/after
filetype plugin indent on
syntax enable
let g:vimtex_view_method = 'zathura'
Change ~/.local/plugged/vimtex
to the path to VimTeX on your computer.
Also, create a corresponding minimal LaTeX file, e.g. test.tex
:
\documentclass{minimal}
\begin{document}
Hello World!
\newpage
Hello Moon!
\end{document}
Then, from a terminal, do: nvim --clean -u test.vim test.tex
and check if things work with the minimal config and example.
i can not make it work with the test.vim as vimtex commands were not available. with following settings test.vim
set nocompatible
set runtimepath^=~/.local/share/nvim/lazy/vimtex
set runtimepath+=~/.local/share/nvim/lazy/vimtex/after/ftplugin
filetype plugin indent on
syntax enable
let g:vimtex_view_method = 'zathura'
the tree is
/home/aneeq/.local/share/nvim/lazy/vimtex
├── after
│ └── ftplugin
├── assets
│ └── json
├── autoload
│ ├── health
│ ├── unite
│ ├── vimtex
│ └── vimtex.vim
├── cliff.toml
├── compiler
│ ├── bibertool.vim
│ ├── chktex.vim
│ ├── lacheck.vim
│ ├── style-check.vim
│ ├── textidote.vim
│ └── vlty.vim
├── CONTRIBUTING.md
├── doc
│ ├── tags
│ ├── targets-textobj-cheatsheet.md
│ └── vimtex.txt
├── docker
│ └── Dockerfile
├── DOCUMENTATION.md
├── ftdetect
│ ├── cls.vim
│ ├── tex.vim
│ └── tikz.vim
├── ftplugin
│ ├── bib.vim
│ └── tex.vim
├── .github
│ ├── ISSUE_TEMPLATE
│ └── workflows
├── .gitignore
├── indent
│ ├── bib.vim
│ └── tex.vim
├── LICENSE.md
├── plugin
│ └── vimtex.vim
├── README.md
├── rplugin
│ └── python3
├── syntax
│ └── tex.vim
├── test
│ ├── common
│ ├── example-book
│ ├── example-book-multifile
│ ├── example-minimal
│ ├── example-performance
│ ├── example-quickfix
│ ├── example-quick-start
│ ├── example-startup-timing
│ ├── Makefile
│ ├── test-bibfiles
│ ├── test-cache
│ ├── test-commands
│ ├── test-compiler
│ ├── test-compiler-generic
│ ├── test-compiler-method-dynamic
│ ├── test-compiler-pdfmode
│ ├── test-compiler-selected
│ ├── test-completion-bibstyle
│ ├── test-completion-bibtex
│ ├── test-completion-bibtex-speed
│ ├── test-completion-commands
│ ├── test-completion-documentclass
│ ├── test-completion-environments
│ ├── test-completion-filenames
│ ├── test-completion-glossary
│ ├── test-completion-glossary-texinputs
│ ├── test-completion-labels
│ ├── test-completion-packages
│ ├── test-context-cite
│ ├── test-delim
│ ├── test-doc
│ ├── test-env
│ ├── test-folding
│ ├── test-folding-bib
│ ├── test-formatting
│ ├── test-getfile
│ ├── test-get-main
│ ├── test-imaps
│ ├── test-include
│ ├── test-indentation
│ ├── test-indentation-timing
│ ├── test-jobs
│ ├── test-matchparen-speed
│ ├── test-metadata
│ ├── test-motions
│ ├── test-motions-virtual
│ ├── test-parser-bib
│ ├── test-parser-cmds
│ ├── test-parser-tex
│ ├── test-parser-toc
│ ├── test-paths
│ ├── test-quickfix
│ ├── test-quickfix-fix-path
│ ├── test-state
│ ├── test-subfiles
│ ├── test-syntax
│ ├── test-texflavor
│ ├── test-textobj
│ ├── test-textobj-targets
│ ├── test-toc
│ ├── test-toc-speed
│ ├── test-utils
│ ├── test-view
│ └── test-wordcount
├── .vintrc.yaml
└── VISUALS.md
86 directories, 29 files
output for required commands are
ldd /usr/bin/zathura|grep sync
libsynctex.so.2 => /usr/lib/libsynctex.so.2 (0x00007f5d194b7000)
#####
zathura --help|grep -- -x
-x, --synctex-editor-command=cmd Synctex editor (forwarded to the synctex command)
i can not make it work with the test.vim as vimtex commands were not available.
Well, then we need to figure out why.
Ok, do this:
cd $HOME
mkdir test
cd test
touch test.vim
touch test.tex
# add content to the above files, then
nvim --clean -u test.vim test.tex
The content of test.tex
is the same as mentioned in my previous post. The content of test.vim
is this (almost the same as what you just posted):
set nocompatible
set runtimepath^=/home/aneeq/.local/share/nvim/lazy/vimtex
set runtimepath+=/home/aneeq/.local/share/nvim/lazy/vimtex/after
filetype plugin indent on
syntax enable
let g:vimtex_view_method = 'zathura'
After doing nvim --clean -u test.vim test.tex
, you should be able to do :VimtexCompile
to start compilation. Can you confirm that?
output for required commands are …
Good, this indicates that we should be able to make everything work.
Also: I notice you are using lazy.nvim; please confirm that you do not lazy load VimTeX.
yes i am able to compile and :VimtexView to the specific line in zathura but i cant do ctrl+right click to go back to neovim latex line of interest through zathura . the cursos just stays at its position. i was using xbindkey that had a similiar shortcut for a bash script but even after killing it the zathura synctex is not working. :(
Ah, sorry, I've been thinking about this the wrong way. I did ask an important question that you never answered:
Also: I notice you are using lazy.nvim; please confirm that you do not lazy load VimTeX.
Can you show me your current actual configuration, i.e. not the minimal one? If you have it on github, e.g.?
To be clear: I believe you are lazy loading VimTeX, which will essentially break this exact feature.
To be clear: I believe you are lazy loading VimTeX, which will essentially break this exact feature.
mmmm this is my lazy config
{"lervag/vimtex",
lazy=false,
ft = {"tex","bib"},
config = function()
require("custom.configs.vimtex")
end,
},
but by defualt lazy is configured to lazy load all plugins . i also have vim can i install vimtex and test it from a short init.vim file.
mmmm this is my lazy config …
Yes: The ft = ...
implies that you are lazy loading VimTeX. Please remove that line. I believe things will work as expected afterwards.
but by defualt lazy is configured to lazy load all plugins .
I assume this means you are using LazyVim? lazy.nvim (the plugin manager) does not lazy load by default, but it can be configured to do so.
i also have vim can i install vimtex and test it from a short init.vim file.
That will not be necessary.
Description
Steps to reproduce
Expected behavior
No response
Actual behavior
Whenever it try to open a file it just through error. the plugin keybindings and commandly only work if the file is main.tex. otherwise it throues some autocmd error.
Do you use a latexmkrc file?
VimtexInfo