1

I am using the TeXiFy IDEA plugin in Pycharm as it's convenient for what I'm doing.

I have continuously browsed the forums for similar errors but couldn't find solutions that worked.

Relevant sample from the .tex file:

    Stars are classified based on their temperature, put into classes denoted by the letters, known as the Current Harvard System\cite{1901AnHar..28..129C}.

    \bibliography{main}
    \bibliographystyle{plain}

My .bib file:

@ARTICLE{1901AnHar..28..129C,
    author = {{Cannon}, Annie J. and {Pickering}, Edward C.},
    title = {Spectra of bright southern stars photographed with the 13-inch Boyden telescope as part of the Henry Draper Memorial},
    journal = {Annals of Harvard College Observatory},
    keywords = {STARS: SPECTRA, STARS: CATALOGS, STARS: CLASSIFICATION},
    year = {1901},
    month = {jan},
    volume = {28},
    pages = {129-P.6},
    adsurl = {https://ui.adsabs.harvard.edu/abs/1901AnHar..28..129C},
    adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

.log file:

Package natbib Warning: Citation `1901AnHar..28..129C' on page 1 undefined on i
nput line 46.

[1

{C:/Users/denet/AppData/Local/MiKTeX/pdftex/config/pdftex.map} <./LULogo-eps-co
nverted-to.pdf>] (C:/Users\denet\Desktop\PHYS363_Report\out\main.bbl

Package natbib Warning: Empty `thebibliography' environment on input line 3.

)

Package natbib Warning: There were undefined citations.

.aux file:

\providecommand\hyper@newdestlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldcontentsline\contentsline
\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\contentsline\oldcontentsline
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax 
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\citation{1901AnHar..28..129C}
\providecommand*\caption@xref[2]{\@setref\relax\@undefined{#1}}
\newlabel{fig:figure}{{\caption@xref {fig:figure}{ on input line 20}}{1}{}{figure.caption.1}{}}
\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}\protected@file@percent }
\newlabel{sec:Intro}{{1}{1}{Introduction}{section.1}{}}
\bibdata{main}
\bibstyle{plain}
\gdef \@abspage@last{2}

.blg file:

Capacity: max_strings=200000, hash_size=200000, hash_prime=170003
The top-level auxiliary file: out/main.aux
Reallocating 'name_of_file' (item size: 1) to 5 items.
I couldn't open database file main.bib
---line 24 of file out/main.aux
 : \bibdata{main
 :              }
I'm skipping whatever remains of this command
Reallocating 'name_of_file' (item size: 1) to 6 items.
The style file: plain.bst
I found no database files---while reading file out/main.aux
Warning--I didn't find a database entry for "1901AnHar..28..129C"

.bbl file is empty as implied from the above files:

\begin{thebibliography}{}

\end{thebibliography}

My suspicion is that it's something to do with the compiler, but this is not the first time I'm using TeXiFy, it has worked before.

6
  • First time posting on stack exchange, ignore the formatting mishap at the end (can't figure out editing the post) Commented Jan 8, 2023 at 16:24
  • 1
    Is your .bib file called main.bib? Is it in the same directory as your main .tex file? The error messages mention an out/ folder. It could be that something is set up to use so-called "build" folders, which can cause issues when LaTeX needs to work together with helper programmes like BibTeX.
    – moewe
    Commented Jan 8, 2023 at 17:09
  • @moewe I tried putting everything in the same folder but nothing changed. And every file I mentioned is named "main.[relevant extension]" Commented Jan 8, 2023 at 19:25
  • The message "I couldn't open database file main.bib" can only be interpreted in one way: BibTeX was unable to find a file called main.bib.
    – Mico
    Commented Jan 8, 2023 at 20:42
  • Off-topic: It's completely unnecessary to encase the authors' surnames in curly braces. Writing {Cannon} and {Pickering} does nothing useful; Cannon and Pickering is every bit as good; actually, they're better because there's less code clutter.
    – Mico
    Commented Jan 8, 2023 at 20:45

1 Answer 1

1

The message

I couldn't open database file main.bib

can only mean one thing: BibTeX was unable to open the file main.bib. This can happen if the bib filename is misspelled and/or if the file main.bib exists but is not located in BibTeX's search path.

Some comments about your bib file: (a) no need to encase the authors' surnames in curly braces; (b) do encase Boyden and Henry Draper Memorial in curly braces; (c) the line month = {jan}, is wrong; (d) since you're using the natbib citation management package, do consider plainnat instead of plain as the bibliography style. And, to give BibTeX a chance to get the formatting right, do please write month = jan, instead of month = {jan},.

enter image description here

\documentclass{article}

%% create the file main.bib "on the fly":
\begin{filecontents}[overwrite]{main.bib}
@ARTICLE{1901AnHar..28..129C,
    author = {Cannon, Annie J. and Pickering, Edward C.},
    title  = {Spectra of bright southern stars photographed 
              with the 13-inch {Boyden} telescope as part of 
              the {Henry Draper Memorial}},
    journal= {Annals of Harvard College Observatory},
    keywords={STARS: SPECTRA, STARS: CATALOGS, STARS: CLASSIFICATION},
    year   = {1901},
    month  = jan,
    volume = {28},
    pages  = {129-P.6},
    adsurl = {https://ui.adsabs.harvard.edu/abs/1901AnHar..28..129C},
    adsnote= {Provided by the SAO/NASA Astrophysics Data System}
}
\end{filecontents}

\usepackage[numbers]{natbib}
\bibliographystyle{plainnat}

\begin{document}
\dots\ known as the Current Harvard System~\cite{1901AnHar..28..129C}.
\bibliography{main}
\end{document}
2
  • 1
    Thank you so much, I had to go over all the paths that the configurations used, turns out it defaulted to the folder where the software is installed rather than the folder the project is in. Commented Jan 11, 2023 at 18:22
  • 1
    Also thanks for the .bib formatting help! Commented Jan 11, 2023 at 18:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .