SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 364 forks source link

No bib file found when ~/ is used to specify its directory #1459

Open ugartecristian opened 4 years ago

ugartecristian commented 4 years ago

I work on several computers so I have my .bib files on the cloud. This implies that I need to call the bibliography from the Home Directory. The .tex looks at follows

\usepackage[style=apa,doi=false,url=false,isbn=false,eprint=false]{biblatex}

\addbibresource{\string~/ownCloud/library.bib}

The document compiles perfectly. My only problem is that when I try to add a new cite I get the a "no .bib files found" message. I tried switching to natbib and that nothing changes. My guess is that the \string at the beginning of the directory specification is creating a problem.

Any ideas how to fix this? Thanks!

r-stein commented 4 years ago

Sorry for the late reply, I also assume the current implementation does not work well with \string prefix.

I would suggest to

  1. Just write \addbibresource{~/ownCloud/library.bib} in a comment environment or behind \end{document} so that LaTeXTools can pick it up in its analysis (don't forget to clear the cache after that)
  2. Use the additional_bibliography_file setting to set it in the LaTeXTools project or global settings.
ugartecristian commented 4 years ago

Sorry for the late response. The comment environment idea worked perfectly. Thanks!!!