0

.bbl file screenshotI have the articles & inproceedings in the file dtbase.bib in the following manner:

@article{Russell17012003,
author = {Russell, Philip}, 
title = {Photonic Crystal Fibers},
year = {2003}, 
journal = {Science} 
}


@inproceedings{Hansen:02, 
author = {Kim P. Hansen and Jacob Riis Jensen and Christian Jacobsen and           Harald R. Simonsen and Jes Broeng and Peter M. W. Skovgaard and Anders Petersson    and Anders Bjarklev}, 
booktitle = {Optical Fiber Communications Conference}, 
journal = {Optical Fiber Communications Conference},
keywords = {Nonlinear optics, fibers},
publisher = {Optical Society of America},
title = {Highly Nonlinear Photonic Crystal Fiber with Zero-Dispersion at     1.55\&\#x00B5;m}, 
year = {2002},
pages = {FA9},
}

While my tex file try.tex reads as-

\documentclass{elsarticle}

\begin{document}

\begin{frontmatter}

\title{blablabla}

\author{bla bla}

\address{blabla}

\begin{abstract}
blalbal

\end{abstract}

\begin{keyword}

bla

\end{keyword}

\end{frontmatter}


\section{Introduction}

 microstructured \cite{Russell17012003}  blabla birefringence     etc.\cite{Knight96} high nonlinearity required blabla \cite{Hansen:02} 


\section*{References}
\bibliographystyle{elsarticle-num} 
\bibliography{dtbase}

\end{document}

\endinput

Whenever I put articles & inproceedings in the same bib file, after compiling the tex file it shows - the following warning -

Citation 'Hansen:02' on page 1 undefined. 

and it doesn't show the inproceeding. What am I doing wrong? I am using Texmaker for editing both the .bib file & .tex file.

  • The long blank spaces in Hansen:02, fields author and title, suggest that you have line breaks there, which aren't allowed – musicman Oct 24 '15 at 07:33
  • @musicman they somehow popped up here. In the actual code they're fine, no line breaks. Still doesn't work. – nafizamin Oct 24 '15 at 07:50
  • pls check the biber error log file .blg for errors. Are you running pdflatex - biber - pdflatex? – musicman Oct 24 '15 at 07:51
  • yes i did the pdflatex - biber - pdflatex-pdflatex sequence. I see the .aux & .bbl files, but i see no .blg file out there. fyi there is a text file created from pdflatex log.

    the main file is try.tex. the output files are- try.aux, try.bbl, try.out

    – nafizamin Oct 24 '15 at 08:00
  • 2
    I cannot reproduce your error. It compiles just fine. Please edit your question and give us a full working MWE which shows the problem. – musicman Oct 24 '15 at 08:06
  • 3
    Just in case someone is interested in the answer to the question in the title: You can use different .bib files for different types, but it doesn't really make sense to do so. It is much more useful to separate .bib files by topic or by the document you are currently writing. So I would say the answer is: You shouldn't. – moewe Oct 24 '15 at 08:53
  • 2
    Now to the problem in the question body. The fact that you cannot find a .blg file implies quite heavily that Biber (or BibTeX) didn't run. What does the .bbl contain? Does the .log complain? Did you run from within an editor (refer to Biblatex with Biber: Configuring my editor to avoid undefined citations)? Can you try running the commands from the command line (pdflatex try, biber try, pdflatex try, pdflatex try)? Then please report the screen output of the Biber run, the .blg and .log files. – moewe Oct 24 '15 at 08:56
  • Just for sake of completeness a link to Question mark instead of citation number. – moewe Oct 24 '15 at 08:57
  • You might also want to have a look at the title of Hansen:02, the 1.55\&\#x00B5;m bit looks like a butchered HTML conversion of 1.55µm. (At first I thought all those characters would make Biber uncomfortable, but it ploughed through.) – moewe Oct 24 '15 at 09:02
  • @moewe I have known latex only for 2 days, so here's the answers as far as I could- – nafizamin Oct 24 '15 at 14:18
  • Please create a MWE so we can have a look at what might be your problem. We don't even know which package you use for the bibliography. Maybe you don't even use biblatex in which case you shouldn't run Biber but BIbTeX. – moewe Oct 24 '15 at 14:26
  • @moewe I have known latex only for 2 days, so here's the answers as far as I could- -.bbl snapshot is attached to the question
    • The log gives a warning about only undefined citation Hansen:02.
    • I ran everything using Texmaker.

    -I don't understand what it means running from the command line.

    • I dont see the .blg and .log file in the current directory with .Tex file. Is it possible that they are generated somewhere else ?

    Am I missing something very basic here ? I am using the package elsartice-num for elsevier papers, and I ran Bibtex indeed. Wait I'm giving an MWE in a few minutes

    – nafizamin Oct 24 '15 at 14:30
  • Please embed any kind of file as paste-able text and not in a picture. The .bbl file looks all right, Hansen:02 is defined there... – moewe Oct 24 '15 at 14:35
  • I have given both .tex & .bib files here. Since you said .bbl is all right, I'm not just rembedding it. oh I had another citation named Knight96, just not shown in the .bib file. – nafizamin Oct 24 '15 at 14:50
  • The MWE worked fine for me. You should try and compile from the command line (google how to do that if you don't know how it works), note the output of the runs and find the .log and .blg files. – moewe Oct 24 '15 at 14:55

1 Answers1

3

Elsarticle (elsarticle-num) uses the natbib-package, so you need bibtex for the references, not biber, see here for more information.

Run the following example in the order pdflatex file - bibtex file - pdflatex file - pdflatex file (without fileendings). It should work.

The entry Knight96 was missing in your question so I made one up.

\documentclass{elsarticle}
\usepackage{filecontents}
\begin{filecontents*}{dtbase.bib}
@article{Russell17012003,
author = {Russell, Philip}, 
title = {Photonic Crystal Fibers},
pages = {358-362}, 
year = {2003}, 
doi = {10.1126/science.1079280}, 
journal = {Science} 
}

@inproceedings{Hansen:02, 
author = {Kim P. Hansen and Jacob Riis Jensen and Christian Jacobsen and           Harald R. Simonsen and Jes Broeng and Peter M. W. Skovgaard and Anders Petersson    and Anders Bjarklev}, 
booktitle = {Optical Fiber Communications Conference}, 
journal = {Optical Fiber Communications Conference},
keywords = {Nonlinear optics, fibers},
publisher = {Optical Society of America},
title = {Highly Nonlinear Photonic Crystal Fiber with Zero-Dispersion at     1.55\&\#x00B5;m}, 
year = {2002},
pages = {FA9},
}

@book{Knight96,
title = {How to become a Knight},
author = {Notaknight Yet},
year = {1296},
publisher = {Rich Merchant},
}
\end{filecontents*}


\bibliographystyle{elsarticle-num} 
\begin{document}

\begin{frontmatter}
\title{blablabla}
\author{bla bla}
\address{blabla}
\begin{abstract}
blalbal
\end{abstract}
\begin{keyword}
bla
\end{keyword}
\end{frontmatter}

\section{Introduction}
 microstructured \cite{Russell17012003}  blabla birefringence     etc.\cite{Knight96} high nonlinearity required blabla \cite{Hansen:02} 

\section*{References}
\bibliography{dtbase}

\end{document}
musicman
  • 3,559