Why my bibliography is not showing up in document? Latex overleaf - latex

So i just wrote an example to see if bib is working but it's not, i have a file that is 03-bibliography.bib and then i print it in the main document, but its not working.
bib file
calling bib into the main doc
I tryd to reformulate the bib file but nothing happened.

Related

I couldn't open database file .bib : \bibdata{ : }

So we changed our LaTeX file from a regular style to an Elsevier style, but the bibliography does not get added to the file. Judging from the error statement I used as the title, I believe it has to do with this error message. I have made multiple attempts by e.g. changing the name of the bibliography, forcing it in etc. and yet it does not show.
Can anyone help me out?
This what I have used:
% Loading bibliography style file
%\bibliographystyle{model1-num-names}
\bibliographystyle{cas-model2-names}
% Loading bibliography database
\bibliography{cas-refs}
where cas-refs.bib is the bibliography file.

Biblatex -- Caught signal: SEGV

I get a fatal error compiling one of my documents -- "FATAL - Caught signal: SEGV Likely your .bib has a very bad entry which causes libbtparse to crash:" -- and I'm not sure what's causing it.
All my googling indicates that there is a corrupt entry in my bib file, but I can't find it. Furthermore, my bib file is created by zotero and all my other documents use the same bib file and compile just fine.
I have tried cleaning out errors in the bib file by validating it and correcting errors (there were a few "date" fields with something other than a date), changing the relative path to my bib file to an absolute path, and duplicating my bib file to the same folder as the tex document (also correcting the path to \addbibresource{}).
from the doc preamble:
\usepackage[backend=biber, style=authoryear, citestyle=authoryear, bibencoding=utf8]{biblatex}
\addbibresource{path/to/file.bib}
Anyone know how to solve this?
Well, it turns out there was a problematic bibtex entry. It's really strange that other documents continued to compile -- perhaps it's only relevant if you cite the particular reference with a problematic entry.
I ended up manually debugging the bib file in a manner that I found on another forum. Splitting the files in half and compiling until the problem entry is isolated. My bib file is a few thousand entries, so it took a while, but problem solved, at least.

Latextools does not display cite keys if .tex file is in subfolder

The wonderful LatexTools plugin for Sublime Text 2 autocompletes references when using \cite. Everything works perfectly when the .bib filed is in the same folder as the .tex file, and the .tex file includes the \bibliography command.
Unfortunately, for my larger projects, I keep my chapter .tex files in a subfolder. The \bibliography command only appears once in the master .tex file, and the .bib file lives with the master .tex file.
Is there a way to "point" LatexTools to my bibliography for all of the sub .tex files which do not include the \bibliography command, so that I can get autocomplete working?
LatexTools searches for a root file that is specified in the subfile you are editing. When it finds such a file, it will look for bibliography related commands there and load the corresponding data. You provide the root file by placing the line
%!TEX root = ../my_main_file.tex
in the (first line of the) subfile.

Compiling LaTex bib source

I am writing my thesis in Latex, and I have the references in an own thesis.bib
file which look as follows
#Article{xxx,
author = "D.A. Reinhard",
title = "Case Study",
year = "1985",
}
and I reference them in my main document as ~\cite{xxx}
When I compile then the main document with: pdflatex main.tex than
it shows me question marks instead of the proper references to the bibliography.
Do I also need to compile the bib source on its own? If yes, can somebody please
tell me the command for Linux
Many thanks!
You need to compile the bibtex file.
Suppose you have article.tex and article.bib. You need to run:
latex article.tex (this will generate a document with question marks in place of unknown references)
bibtex article (this will parse all the .bib files that were included in the article and generate metainformation regarding references)
latex article.tex (this will generate document with all the references in the correct places)
latex article.tex (just in case if adding references broke page numbering somewhere)
You have to run 'bibtex':
latex paper.tex
bibtex paper
latex paper.tex
latex paper.tex
dvipdf paper.dvi
I am using texmaker as the editor.
you have to compile it in terminal as following:
pdflatex filename (with or without extensions)
bibtex filename (without extensions)
pdflatex filename (with or without extensions)
pdflatex filename (with or without extensions)
but sometimes, when you use \citep{}, the names of the references don't show up. In this case, I had to open the references.bib file , so that texmaker could capture the references from the references.bib file. After every edition of the bib file, I had to close and reopen it!! So that texmaker could capture the content of new .bbl file each time. But remember, you have to also run your code in texmaker too.
Just in case it helps someone, since these questions (and answers) helped me really much; I decided to create an alias that runs these 4 commands in a row:
Just add the following line to your ~/.bashrc file (modify the main keyword accordingly to the name of your .tex and .bib files)
alias texbib = 'pdflatex main.tex && bibtex main && pdflatex main.tex && pdflatex main.tex'
And now, by just executing the texbib command (alias), all these commands will be executed sequentially.

Odd Bibtex behaviour in a Latex document

I added a line "\cite{test}" as a test to my working Latex document. When I compiled the bibtex "!bibtex name_of_my_file, I got the expected error:
Warning--I didn't find a database entry for "test"
Then, I removed the line and compiled the bibtex again, hoping to have a working Latex file again. However, the same error occurs, even with a fresh shell. I cannot understand the behaviour. What is the logic? How can I get my Latex document working again?
[Updated Info]
The problem dissapeared as unexpectedly as it emerged. I have no idea why but it works now. Do you know the reason for the odd behaviour?
I think you are tripping over the multi-pass nature of LaTex plus Bibtex. If you look at Step 3 in this discussion, you'll see the following:
The first run (through latex)
generates an auxiliary file,
paper.aux, containing information
about citations (and other types of
references), the bibliography style
used, and the name of the bibtex
database. The second run (through
bibtex) uses the information in the
auxiliary file, along with the data
contained in the bibtex database, to
create a file paper.bbl. This file
contains a thebibliography environment
with \bibitem entries formatted
according to the bibliography style
specified.
So, what I think is happening is that your name_of_my_file.aux file still contains your placeholder \cite{test}. If you remove the auxiliary file, you should be able to start over with:
latex name_of_my_file
bibtex name_of_my_file
latex name_of_my_file
latex name_of_my_file
[Update based on additional info]: The problem was that you had a .aux file with your \cite{} still embedded. The second time that you ran latex, you overrode the old file with the new. That's why the complete set of steps includes an initial latex call, a bibtex call and two follow-up latex calls. Think of it as a multi-pass compiler and it might be more intuitive.
You could have a look at latexmk, which will take care of the fix point compilation for you.
Anyway, you should be able to build the document (pdflatex blah.tex), even if you're missing a bibliography item. The corresponding references will just appear as question marks in the PDF.
Rerun latex to regenerate the aux file.
Have a look at this discussion for pointers to a bit more information. Basically, you may have taken your citation out of the .tex file, but it still exists in one of the derived files (aux, bbl, whatever...)
Check if your bib file has the extension .bib and not .tex.
If it is .tex, just change it to .bib and that should do it.
Once I changed it accidentally to tex, by adding some references, and saving it with the "save as" option, without specifying the bib extension. That's how it can happen all of a sudden.
delete all your .aux and temporal files, re run with latex and then bibtex and then latex twice.

Resources