Skip to content
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

Warn if bibliography file does not belong to project #3305

Closed
fberlakovich opened this issue Nov 6, 2023 · 5 comments · Fixed by #3749
Closed

Warn if bibliography file does not belong to project #3305

fberlakovich opened this issue Nov 6, 2023 · 5 comments · Fixed by #3749
Labels
enhancement New feature or (non bug related) change to the program.
Milestone

Comments

@fberlakovich
Copy link
Contributor

I recently had the case that the bibliography file was not part of the IntelliJ project. While jumping to the file worked, bibtex references (e.g. with \cite) did not. The reason why they don't work might not be entirely obvious to users. I suggest that Texify-IDEA adds a warning if the bibliography file does not belong to the project.

@fberlakovich fberlakovich added enhancement New feature or (non bug related) change to the program. untriaged Issue type still needs to be triaged or verified. labels Nov 6, 2023
@PHPirates
Copy link
Collaborator

Thanks for the suggestion, but I don't quite understand what you mean. Do you have an example?
Do I understand that TeXiFy was resolving the \bibliography file while in fact it was in such a place that the document did not compile, so the input file reference inspection was a false negative?

@PHPirates PHPirates added more-info-needed More information is needed from the person filing the issue. and removed untriaged Issue type still needs to be triaged or verified. labels Nov 7, 2023
@fberlakovich
Copy link
Contributor Author

I had a folder structure where the IntelliJ project is in a subfolder of the root folder, whereas the bibtex library is in the root folder, e.g.

root
  - latex
      - .idea 
      -  main.tex
      - ...
  - bibtex.bib

The main Latex source file had a relative bibliography reference, e.g., \bibliography{../bibtex.bib}. The project compiled fine, also from within IntelliJ, but the \cite completion and following \cite references didn't work. Following the the bibliography reference did work however. Everything started working as soon as I choose the root folder as the directory for the IntelliJ project, that is:

root
 - .idea 
  - latex
      -  main.tex
      - ...
  - bibtex.bib

Unfortunately, I can't reproduce the issue, so maybe it was just a weird coincidence.

@fberlakovich
Copy link
Contributor Author

Ok, I tried again and can reproduce the issue now with a fresh project. Consider the following folder structure:

├── main.bib
└── project
    ├── auxil
    ├── .idea
    │   ├── checkstyle-idea.xml
    │   ├── .gitignore
    │   ├── misc.xml
    │   ├── modules.xml
    │   ├── .name
    │   └── workspace.xml
    ├── MRE.iml
    ├── out
    └── src
        └── main.tex

and main.bib:

@book{Goossens1993,
    author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title = "The LaTeX Companion",
    year = "1993",
    publisher = "Addison-Wesley",
    address = "Reading, Massachusetts"
}

and main.tex

% Preamble
\documentclass[11pt]{article}

% Packages
\usepackage{amsmath}

% Document
\begin{document}

    \cite{Goossens1993}

    \bibliography{../../main}
    \bibliographystyle{plain}

\end{document}

I opened the folder project in IntelliJ. The document compiles just fine and I can also follow the \bibliography link. Texify complains, however, that Goossens1993 is an unresolved reference. Tested with 0.9.2-alpha.3.

@PHPirates PHPirates removed the more-info-needed More information is needed from the person filing the issue. label Nov 8, 2023
@PHPirates
Copy link
Collaborator

Now I understand, thanks for the example! Yes, indeed reference resolving will not work because the file is not being indexed. This is fixable I think because we can just go over all references in the project and add all referenced files to be indexed, but that might be very slow to do.

@PHPirates
Copy link
Collaborator

PHPirates commented Feb 11, 2024

Now with 0.9.5-alpha.3 we can also recommend users to use the remote libraries tool window to add an out-of-project bibtex file, but then an in-project one is still required. [Edit] Since 0.9.9 auto-import can be disabled, so it is a full workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants