56

Sample running code:

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[hidelinks]{hyperref} % Hyperref package for url's and [hidelinks] option to remove collouring

\title{Test}
\author{Thanos}

\begin{document}

\maketitle
\tableofcontents

\begin{abstract}
  This is abstract
\end{abstract}

\section{Section 1}

Referecnce example~\cite{ref:thanos}

\bibliographystyle{./IEEEtran}
\bibliography{./IEEEabrv,./references/ref}

\end{document}

It seems like a very simple question/answer but I can not find the error/solution to my problem. I am trying to understand why IEEEtran class is the problem of the code. While I am compiling the current example I keep getting this error:

LaTeX Warning: Citationref:thanos' on page 1 undefined on input line 21.`

I know that this question has been answered here Undefined citation warnings, which states that the user should compile the code with the following process:

  1. latex
  2. bibtex
  3. latex
  4. latex

I tried the following process, but unfortunately, my problem was not solved.

If I change my \bibliographystyle{plain} and \bibliography{./references/ref} it compiles normally. I have also include the IEEEtran.cls in the same compiling file but unfortunately did help.

Also I tried to compile with LaTeXiLa and a different error is printed:

latexmk -pdf -synctex=1 name.tex
Rule 'bibtex name': File changes, etc:
  Non-existent destination files:
    'name.bbl'
Latexmk: I WON'T RUN 'bibtex configuration' because I don't find the following files:
  ./IEEEabrv.bib
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: applying rule 'bibtex configuration'...
Latexmk: Errors, so I did not complete making targets

As a next step I deleted all files apart from the .tex file and the reference file, still the same error (terminal and compiler).

The reference sample that I am using:

@online {ref:thanos,
title = {Statistics},
author = {ITU 2014 All Rights Reserved},
titleaddon = {{ITU}},
year = {2014},
month = {Mar.},
urldate = {2014-03-05},
howpublished = {\url{http://www.itu.int/en/ITU-D/Statistics/Pages/stat/default.aspx#}}
}

I also tried the format of the reference to @MISC but unfortunately the error is not solved.

I am not 100% sure if I am using biblatex or bibtex, so I am sorry I can not provide more information about it.

Has anybody encounter the same error? I can not find similar information or solution. Thanks in advance for your time and effort.

Thanos
  • 1,133
  • 2
  • 10
  • 17
  • well you should be running bibtex but as yiou showed in the error message it did not run as you haven't got ./IEEEabrv.bib did you mean to have ./IEEEabrv in the \bibliography command (which tries to load a .bib file of that name? – David Carlisle Mar 28 '14 at 23:24
  • @DavidCarlisle, to be honest I found an example here where I followed their structure \bibliography{IEEEabrv,mybibfile}. This is not the correct way to define the IEEEabrv ref.? – Thanos Mar 28 '14 at 23:35
  • It's legal syntax but only if you have two bibliography files to load, IEEEabrv.bib and mybibfile.bib. – David Carlisle Mar 29 '14 at 00:00
  • @DavidCarlisle, ok so I guess the correct format for my use would be: \bibliographystyle{./IEEEtran} and \bibliography{./references/ref}. It is extra and unecessary the part \bibliography{./IEEEabrv}. I removed this extra line and I also added the usepackage{cite} but still the same error. – Thanos Mar 29 '14 at 00:13
  • well run the commands by hand so you see the real error rather than whatever latexmk is doing, that is run pdflatex file, then bibtex file then pdflatex file twice more, and if you get an error add the exact error text from the log (for latex) or blg (for bibtex) file – David Carlisle Mar 29 '14 at 00:18
  • @DavidCarlisle, unfortunately I still keep getting the same error by compiling from terminal LaTeX Warning: Citationref:thanos' on page 1 undefined on input line 22.`. – Thanos Mar 29 '14 at 00:30
  • yes that's just latex saying bibtex didn't make the citation, but did bibtex make an error? – David Carlisle Mar 29 '14 at 00:42
  • @DavidCarlisle, it seemed to be my error typing extra characters (./) on the reference file. In the future in order to compile and avoid this small mistakes is there any other way to find my error? based on your experience? Thanks again for your time and effort I appreciate that. – Thanos Mar 29 '14 at 01:02
  • Note that had you said \bibliography{IEEEabrv,reference} and you have reference.bib in the same directory as your .tex file, it would work fine. You don't need IEEEabrv.bib in the directory because you almost certainly already have it in a path bibTeX searches e.g. /usr/local/texlive/2013/texmf-dist/bibtex/bib/IEEEtran/IEEEabrv.bib on my system. – cfr Mar 29 '14 at 01:19
  • 1
    To find the error, you should have ignored the warning from latex (which just meant bibtex had not made the bibliography) and concentrated on bibtex. With the ./ before the bibtex style I get I couldn't open style file ./IEEEtran.bst ---line 20 of file bt77.aux : \bibstyle{./IEEEtran which is bibtex telling you that it can not find the file ./IEEtran.bib in the current directory – David Carlisle Mar 29 '14 at 01:28
  • @DavidCarlisle, ok got it. Again thank you for your time and effort. You helped me a lot. Best Regards, Thanos – Thanos Mar 29 '14 at 09:33
  • In overleaf, clearing cashed files worked for me – Matteo Grasso Jan 07 '21 at 22:09

3 Answers3

34

enter image description here

It works for me after running

pdflatex file
bibtex file
pdflatex file
pdflatex file

I removed the ./ from the bibliography style as it is not installed in the current directory.

I saved the bibliography entry you posted as ref.bib in the current directory, and the code below as file.tex

\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[hidelinks]{hyperref} % Hyperref package for url's and [hidelinks] option to remove collouring

\title{Test} \author{Thanos}

\begin{document}

\maketitle \tableofcontents

\begin{abstract} This is abstract \end{abstract}

\section{Section 1}

Referecnce example~\cite{ref:thanos}

\bibliographystyle{IEEEtran} \bibliography{ref}

\end{document}

David Carlisle
  • 757,742
  • You are absolutely right. Is it possible to provide with some more information/reference to read more about the (./) before the file. As I see it in many examples and I might miss using it. Thank you in advance for your time and effort. – Thanos Mar 29 '14 at 00:58
  • @Thanos well the file path syntax is basically just sent to the operating system, but just as if you are running a command ./foo is essentially an absolute path to a file foo in the current directory but foo searches the input path (in TeX's case looking in current directory first) – David Carlisle Mar 29 '14 at 01:02
  • if I understand correctly. I am defining a starting point from ,.foo and then since I have a file reference and in that file ref, I do not need ./ again because it will produce confusion to the system. Thank you for your time and effort I will try to read more upon it. – Thanos Mar 29 '14 at 01:11
  • 1
    Not "not need" if you are in c:/a/b/c then ./foo is a request for c:/a/b/c/foo.bib so the bibtex file path is not used. but if you use foo then the current directory and every directory on the bibinputs path is checked. So the commands mean different things, the system doesn't get confused (just users:-) – David Carlisle Mar 29 '14 at 01:23
  • Again thank you for your time and effort. You helped me a lot. I know my question was not something special but I could not figure out why was not working properly. Best Regards, Thanos – Thanos Mar 29 '14 at 09:35
  • 1
    The second time 'pdlfatex file' was the charm! – Raein Hashemi Jun 29 '18 at 15:55
  • This is a good cookbook but how does it work??? – RexYuan Dec 20 '22 at 18:01
9

Copy over the .bst file.

David Carlisle's answer is very thorough, but I recently faced the same situation when I was working on a second paper, and wanted it to have the same format as my first paper. I copied over the .cls file, the .tex file and the .bib file and received the exact same error as OP.

LaTeX Warning: Citationref:thanos' on page 1 undefined on input line 21.

Following the previous answer's steps I was unable to resolve my issue. Turns out that in order to solve my problem I also needed to copy over the .bst file from my first paper's folder or the bibliography style file. Copying over the .bst file, I was able to resolve my issue.

  • 1
    Instead of copying your .bst file, you can try \bibliographystyle{plain} - which should work with the IEEEtran cls file – Agile Bean Dec 27 '20 at 03:23
6

I've recently experienced the same problem when typing my PhD thesis.

It has a master file and all the chapters and etc. are added with \input command.

Recently to speed up the compilation time, I started using \includeonly. I did not have this error until I replaced \input with \include to add the chapters. Then, I realized that \chapterbib is suitable to work with \include not with \input. So, when I was using \input, \chapterbib was idle and I never needed it because I print the bibliography at the end of the thesis, not separately for each chapter.

Long story short, I deactivated \chapterbib and it started to work normally again. Hope this can help to the ones experiencing the same difficulty.