Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem making my bibliography run. I had the same code some time ago and it did run then, I can't figure out what the problem is.

\documentclass[12pt]{scrartcl}
\usepackage[comma,authoryear]{natbib}
\begin{document}
Blablabla \cite{xy}
\bibliographystyle{natbib}
\bibliography{rp_bib.bib}
\end{document}

When I run LaTeX and afterwards BibTeX, it says I couldn't open style file natbib.bst I'm skipping whatever remains of this command I couldn't open database file...

Does anyone know what the problem might be?

share|improve this question
1  
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code. Alternatively, use the "code" button (with "{}" on it). –  doncherry Dec 4 '12 at 3:48
1  
As far as I know there is no standard natbib.bst file. The standard ones are abbrvnat, plainnat and unsrtnat. –  Guido Dec 4 '12 at 4:30

1 Answer 1

There are several errors in your MWE. I have corrected them and included a short example bib file with package filecontents (for the manual type texdoc filecontents in your command line).

Please have a look for the bibliography style: natbib is the name of the package, you ment natdin I guess. Macro \bibname needs only the name (here: \jobname) of your bib file. Leave out .bib (Explanation: If you store the MWE with the file name mwe.tex your created bib file will be named mwe.bib).

Corrected and pretty printed MWE:

%http://tex.stackexchange.com/questions/85424/bibtex-cant-open-style-file
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}  % writes bib file.
@book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
\end{filecontents*}

\documentclass[12pt]{scrartcl}
\usepackage[comma,authoryear]{natbib}
%\usepackage{natbib}
\begin{document}
Blablabla \cite{adams}
\bibliographystyle{natdin} % natdin alphadin
\bibliography{\jobname}    % use file \jobname.bib for bibliography
\end{document}
share|improve this answer
    
Thank you very much, now everything is running just fine. –  Franziska Dec 4 '12 at 16:58
1  
@Franziska: You are welcome. Please consider to upvote and accept my answer if it was helpful for you. That's the way we say here thank you. –  Kurt Dec 4 '12 at 17:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.