-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Bib File #17
Comments
Thanks for reporting. Could you post the output of the files variable? vim.fn["vimtex#paths#pushd"](vim.b.vimtex.root)
local files = vim.fn["vimtex#bib#files"]()
vim.fn["vimtex#paths#popd"]() Before running them, open that file with Neovim and wait 20 seconds, just to make sure that every potential asynchronous parsing has ended.
Glad to hear it! How are finding the new bibliographic search functionality? Do you have any suggestions to improve it? |
If I am correct in checking the variables with :lua vim.print(vim.fn["vimtex#paths#pushd"](vim.b.vimtex.root)) YIELDS: 0
:lua vim.print(local files = vim.fn["vimtex#bib#files"]()) YIELDS: {}
:lua vim.print(vim.fn["vimtex#paths#popd"]()) YIELDS: E5108: Error executing lua function vimtex#paths#propd, ... Perhaps also worth mentioning, \bibliography{Zotero} %% global bib file found in ~/texmf/bibtex/bib/
\bibliography{PaperName} %% local bib file The same is not true for Now for the relevant parts of the return {
"hrsh7th/nvim-cmp",
event = { "InsertEnter", "CmdlineEnter" },
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"micangl/cmp-vimtex",
-- Other dependencies...
},
config = function()
local cmp = require("cmp")
cmp.setup({
-- formating for autocompletion
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) -- Kind icons
vim_item.menu = ({
vimtex = (vim_item.menu ~= nil and vim_item.menu or ""),
buffer = "[Buffer]",
-- Other formatting for sources...
})[entry.source.name]
return vim_item
end,
},
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "vimtex" },
{ name = "buffer", keyword_length = 3 },
-- Other sources...
}),
})
end,
} As for the return {
"micangl/cmp-vimtex",
config = function()
require('cmp_vimtex').setup({
additional_information = {
info_in_menu = true,
info_in_window = true,
info_max_length = 60,
match_against_info = true,
symbols_in_menu = true,
},
bibtex_parser = {
enabled = true,
},
})
end,
} And for the return {
"lervag/vimtex",
dependencies = {
"micangl/cmp-vimtex",
},
version = "*",
event = { "BufReadPre", "BufNewFile" },
config = function()
vim.g['vimtex_view_method'] = 'zathura'
vim.g['vimtex_quickfix_mode'] = 0
vim.g['vimtex_mappings_enabled'] = 0 -- Ignore mappings
vim.g['vimtex_indent_enabled'] = 0 -- Auto Indent
vim.g['vimtex_syntax_enabled'] = 1 -- Syntax highlighting
vim.g['vimtex_log_ignore'] = ({
'Underfull',
'Overfull',
'specifier changed to',
'Token not allowed in a PDF string',
}) -- Error suppression
vim.g['vimtex_context_pdf_viewer'] = 'okular'
end,
} If there is any other information that I can provide, please don't hesitate to let me know. Regarding suggestions to improve the bib search functionality, it's honestly pretty great. I'll have a think about what could improve it further, but so far I'm psyched. |
Sorry if it took me a while to get back to you. I hoped this problem would be quicker to solve. Unfortunately, I'm quite swamped because of some university exams, and I'll be until the 5th of February; after that date, I'll be able to look into this. Sorry for the incovenience. |
Not a problem. Good luck with your term! |
I'm finally taking a deeper look into this issue. You seem to have set a global Second thing, I can't understand how the latex compiler knows where to look for the |
Hey no worries! Hope your term went well. Yes, I have a global I am not sure how latex knows where to look, but it seems that it looks in both the /texmf/bibtex/bib/ directory and the local project directory for the file specified by |
Ok, now I'm starting to understand this better. It seems that If it does work it may be because the commands you issued earlier were incorrect; this may be better: :lua vim.print(vim.fn["vimtex#paths#pushd"](vim.b.vimtex.root))
:lua vim.print(vim.fn["vimtex#bib#files"]())
:lua vim.print(vim.fn["vimtex#paths#popd"]()) Does |
I couldn't get ctrl-x followed by ctrl-o to do anything besides move to the old position but did get some output from the commands you provided when
When I switched to
I tried running the following from the terminal but not sure if this is what you intended:
Let me know if there is any other information that I can provide. |
Sorry, I should have specified that I meant the output of kpsewhich Zotero and that of
|
Got it. Here's the output:
So looks like it can find the file running the second command. |
I'm thinking this must be related to the way Vimtex looks for |
Please, don't lazy load VimTeX! Do not use Further, VimTeX does not depend on return {
"lervag/vimtex",
init = function()
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_quickfix_mode = 0
vim.g.vimtex_mappings_enabled = 0 -- Ignore mappings
vim.g.vimtex_indent_enabled = 0 -- Auto Indent
vim.g.vimtex_log_ignore = ({
'Underfull',
'Overfull',
'specifier changed to',
'Token not allowed in a PDF string',
}) -- Error suppression
vim.g.vimtex_context_pdf_viewer = 'okular'
end,
} |
VimTeX does use |
Thanks for the help! I managed to git it working. I cleaned up my Thanks again! |
No problem!
That's strange and doesn't make much sense to me either. I've found |
That fixed it! Just to be sure, I renamed the file I had named 'Library.bib' back to 'Zotero.bib' and this reproduced the error. Running |
Great, glad to hear it!
Not sure. It's a little bit hard to say. I hope this is a rare and not important bug. Let me know if you have the same happening again, it would be interesting to inspect the cache file before you clear it. |
Very well, since it seems like the problem is gone, I will close the issue. |
Hopefully it won't come back, but if it does, I'll try to find that Cache file. Thanks again! |
Although I can get bib completion to work with a local .bib file, I cannot manage to get the same to work for a global .bib
~/texmf/bibtex/bib/Zotero.bib
which I source with\bibliography{Zotero}
at the end of my latex document. I use this global .bib file for everything and then have a keybinding set up to generate a local .bib file which only includes entries for the citations that occur in the local latex document once it is finished.I am wondering: how can I get cmp-vimtex to find my global .bib file
~/texmf/bibtex/bib/Zotero.bib
?Thanks so much for an excellent plugin/extension. I'm so pleased to have it back up and running :)
The text was updated successfully, but these errors were encountered: