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

Bibtex Connection for Configuration does not seem to work for Python Project. #1208

Closed
MalteLeuschner opened this issue Jan 26, 2020 · 15 comments
Labels
support Issues that were migrated to a Discussion.

Comments

@MalteLeuschner
Copy link

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

PyCharm 2019.3.2 Professional

Operating System

MacOS Mojave

TeXiFy IDEA version

0.6.7

What I did (steps to reproduce)

Existing Python Project. Structure:
src/
thesis/
main.tex (includes
\input{main-content}
\bibliographystyle{abbrvnat} % OR {abbrvnat}
\bibliography{mainBibliography}
main-content.tex
\cite{SourceExistingInMainBibliography}
mainBibliography.bib
...

I create a run configuration for the main.tex with pdfLatex compiler, rest default,
and compiled my main.tex file

Expected behavior

Everything should work fine, cited sources should be available and References displayed in pdf.

Actual behavior

The link to the .bib does not seem to work. Sources are never displayed and I get the below warning. In the configuration BibTex is "disabled" but without any entrees to enable it. MikTeX is installed an "bibtex --version" in console works i.e. fine.

(if applicable) The full stacktrace of the exception thrown

Package natbib Warning: Citation `richardfeynman1998' on page 3 undefined on in
put line 24.

[3] [4]

Package natbib Warning: Citation `richardfeynman1998' on page 5 undefined on in
put line 45.

) [5]
No file main.bbl.

Package natbib Warning: There were undefined citations.
@PHPirates
Copy link
Collaborator

I think you are creating the run config manually, instead of via the gutter icon next to \begin{document} or using the shortcut for that?
We assume that when people create a run config manually that they do that because they do not want all these things to be auto-created.
You can also create a bib run config manually and then select it from the latex run config.
If you think anything should be improved in the documentation/UI, please let us know.

@MalteLeuschner
Copy link
Author

Ah, unterstood. Yes, I created it manually and was confused not to find it working out of the box. Via the gutter icon everything works as expected. Thanks!

@PHPirates PHPirates added the support Issues that were migrated to a Discussion. label Jan 27, 2020
@cbtum
Copy link

cbtum commented Mar 11, 2020

Dear @PHPirates ,

Sorry for this stupid question, but with IntelliJ Utilmate I am running into similar problems on a Mac - although I generated the run-config via the gutter icon.

Steps to reproduce this problem:

  1. Download the current version of elsearticle via https://www.elsevier.com/authors/author-schemas/latex-instructions. This template comes with it's own cas-refs.bib.
  2. Click the gutter icon to create a run config
  3. run the created config
- compiler: pdfLatex
- executable path: /usr/local/texlive/2019/bin/x86_64-darwin/pdflatex
- main file to compile is selected correctly
- separate output files does not have any impact (for Biber I have it swichted on, but now I need else articles natibib-bibtex)
- bibliography is disabled => do I need to configure bibtex separately?

I also get the warning - Package natbib Warning: There were undefined citations.

What am I missing? Biber is working fine, but for this paper I have to use elsearticle...

Thanks for your help!

@PHPirates
Copy link
Collaborator

@cbtum Thanks for the question, I never tried the elsevier class before. Can you help me by providing a minimal example of something that reproduces your problem? This works fine for me, and the elsarticle class does not seem to have any influence compared to the article class on this result:

main.tex

\documentclass{elsarticle}

\begin{document}

    When you are not looking at it, this sentences stops citing~\cite{knuth1990}.

    \bibliography{references}
    \bibliographystyle{plain}

\end{document}

references.bib

@book{knuth1990,
    author = {Knuth, Donald E.},
    title = {The {\TeX} book },
    year = {1990},
    isbn = {0-201-13447-0},
    publisher = {Addison\,\textendash\,Wesley},
    bibsource = {out/main.pdf},
}

Just to be sure: what IntelliJ/IDEA and TeXiFy version are you using?

I do note that the Elsevier class uses Natbib, but in your comment you are talking about biber. You cannot use biber with natbib, you have to use the bibtex compiler. (https://tex.stackexchange.com/a/299286/98850)

@cbtum
Copy link

cbtum commented Mar 12, 2020

Dear @PHPirates,
Thanks for your quick response.
This comment about Biber was just to state that Texify generally works for me, as long as I am using Biber.
In this case I have to use elsearticle, natbib, bibtex.
So maybe some other installation/configuration problem?
How do I tell texify to use bibtex?

@PHPirates
Copy link
Collaborator

@cbtum Ah I see, well TeXiFy should detect automatically that you want to use bibtex, very similar as to using biber.

I still want to know: what IntelliJ/IDEA and TeXiFy version are you using?

Though now I try my above example again using the latest alpha build of TeXiFy with pdflatex+bibtex instead of latexmk, it indeed doesn't work for me also (with the article class) - so at least there is a bug somewhere, though if you are using version 0.6.8 then you probably are not running into this. Two problems for me:

  1. When I create the run config from the gutter icon the output path is set to /home/thomas/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-1/201.6073.9/bin - that's a problem that has been there for a while and I've been trying to solve it a lot of times already. Will try again.
  2. When I change the path to src, the bibtex run gives I couldn't open database file references.bib which I assume is because the working directory is incorrect, but will have to check that.

@cbtum
Copy link

cbtum commented Mar 12, 2020

Dear @PHPirates,
sorry, I am using IntelliJ IDEA 2019.3.3 (Ultimate Edition) with Texify 0.6.8.

I don't even get a couldn't open database file. Instead, it only tells me

No file cas-dc-template.bbl.
...
Package natbib Warning: There were undefined citations.

To me it seems as if bibtex is not installed / configured properly. I don't even have a Bibtex run-config (it only creates the latex runconfig).
In contrast, when I do the same thing with biber, I just add a Bibtex run-config with biber selected as compiler and the path to the executable.

image

In contrast, I can create a biber run config that works...
image

@PHPirates
Copy link
Collaborator

Oh, wait, I forgot you had to set the path manually on a Mac. Any idea why that is?
In that case, try the same with bibtex: specify the path to the bibtex compiler, wherever that is.

@cbtum
Copy link

cbtum commented Mar 12, 2020

Dear @PHPirates ,

right, after configuring the bibtex manually, I at least get the following output:
/usr/local/texlive/2019/bin/x86_64-darwin/bibtex

Do I need any compiler arguments? For biber for instance, I am using a different output directory via

--input-directory
--output-directory

In this case however, all files are in the same directory. Was just wandering, whether something should be specified in addition...

@PHPirates
Copy link
Collaborator

PHPirates commented Mar 12, 2020

I'm not sure what you mean, does it work now or not?
I don't know exactly what Mac supports or not, but it's definitely easiest to not use any output directories when using bibtex, at least for TeX Live it is so, and I think MacTeX or whatever you are using (from the path it looks like texlive) is similar.

@cbtum
Copy link

cbtum commented Mar 12, 2020

Sorry to bother you. After starting again and doing the whole setup manually, I have a working configuration now. This is what I did:

  1. Download the elsearticle template: https://www.elsevier.com/__data/assets/file/0007/56842/elsarticle-template.zip

  2. Create a BibTex run-config manually with the following settings:

Compiler: BibTeX
Check custom compiler
Pah: e.g. /usr/local/texlive/2019/bin/x86_64-darwin/bibtex (which is bibtex from texlive)
Mail file to compile:  [path]/elsarticle-template.tex
  1. Create a LaTeX run-config manually with the following settings:
Compiler: pdfLaTeX
Check: Select custom compiler executable
Path: e.g. /usr/local/texlive/2019/bin/x86_64-darwin/pdflatex
Uncheck: custom pdf viewer
Do not provide custom compiler arguments
Main file to compile: (same as for the BibTeX config) [path]/elsarticle-template.tex
Uncheck: Separate output files from source
Check: Always compile twice
Under Extensions, link the created BibTeX run-config as bibliography extension

Optionally: Create another LaTeX run-config which does not compile twice and which is not linked to a bib config.

@PHPirates : Thanks again for your help and sorry for these stupid questions..

@PHPirates
Copy link
Collaborator

@cbtum Thanks, so I think the only problem was that you had to provide a path to the bibtex compiler manually? Unfortunately there's no TeXiFy developer with a Mac at the moment, so we can't easily solve that issue.

@cbtum
Copy link

cbtum commented Mar 12, 2020

@PHPirates , texify did not create the BibTeX runconfig, so I though the bibtex-compiler was somehow included.

Still, after this problem is solved I am happy to continue using TeXiFy. Great work guys!

@PHPirates
Copy link
Collaborator

Hm strange, not sure why it didn't create the bibtex run config. Maybe we can look into that another time. Good to hear the problem is solved, thanks!

@Silver-Golden
Copy link

Found this issue and it set me on the right path, so leaving this here for anyone else searching.

For Nixos, even if ye run from teh gutter it still fails to make the references.
Thankfully this is solved by setting teh custom compiler executable (I found mine by going which pdflatex)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Issues that were migrated to a Discussion.
Projects
None yet
Development

No branches or pull requests

4 participants