Error in \cite question mark, but entry is showing in bibliography

40 Views Asked by At

I am using overleaf. I am writing an article using article document class. I use school.sty file to modify certain styles. In my article, I need to cite a few references. So I created research.bib.

When I include \cite{einstein} in the tex file, I get a question mark, whereas there is an entry for the einstein after compilation.

[1] Albert Einstein. Zur Elektrodynamik bewegter K ̈orper. (German) [On the electrodynam-
ics of moving bodies]. Annalen der Physik, 322(10):891–921, 1905.

Can someone please help me to resolve the question mark error when using \cite{}.

This is my main.tex

% % document type % %
\documentclass[12pt]{article}

% % preamble % %
\usepackage{amsmath} % % centers and provides equation numbers for align env
\usepackage{amssymb} % % allows use of normal N symbol
\usepackage{graphicx} % % allows graphics floats
\usepackage{grffile} % % allows more image file names
\usepackage{subcaption} % % allows subfigures in floats
\usepackage[margin=1in]{geometry}
\usepackage[hidelinks]{hyperref} % % allows URLs and in-document hyperlinking
\usepackage{color}
\usepackage{setspace} % % allows line spacing
\usepackage{moreverb} % % allows use of verbatimtab
\renewcommand\verbatimtabsize{4\relax} % % sets verbatimtab indent to half of default, looks better
\edef\restoreparindent{\parindent=\the\parindent\relax}
\usepackage{parskip} % % don't indent new paragraphs
\restoreparindent
\usepackage{enumerate}
\usepackage{harvard}


 % header and footer % %
\usepackage{fancyhdr}
\fancypagestyle{plain}{
    \fancyhead[L]{Research Statement}  % left header
    \fancyhead[R]{\Name{}} % right header
    
    \fancyfoot[R]{\thepage} % % pg number in footer
    \fancyfoot[C]{} % % remove default centered page numbers
    \fancyfoot[L]{} % last compiled in footer
}

% % expand head of document:
\setlength{\headheight}{14.49998pt}

% % application specific information % %
\usepackage{school}

% % document begins % %
\begin{document} \pagestyle{plain}

% % body % %

My research interest \cite{einstein}.

\bibliographystyle{plain}
\bibliography{research}

\end{document}

My research.bib file

@article{einstein,
    author = "Albert Einstein",
    title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal = "Annalen der Physik",
    volume = "322",
    number = "10",
    pages = "891--921",
    year = "1905",
    DOI = "http://dx.doi.org/10.1002/andp.19053221004",
    keywords = "physics"
}

This is my school.sty file

% % color for links
\definecolor{linkcol}{rgb}{0.0,0.0,0.3}
\hypersetup{colorlinks,breaklinks,
    linkcolor=linkcol,urlcolor=linkcol,
    anchorcolor=linkcol,citecolor=linkcol}

% For \email{ADDRESS}, links ADDRESS to the url mailto:ADDRESS in teletype fixed-width font
\providecommand*\email[1]{\href{mailto:#1}{\texttt{#1}}}

% For \url{ADDRESS}, links ADDRESS to the url https://ADDRESS in teletype fixed-width font
\renewcommand*\url[1]{\href{http://#1}{\texttt{#1}}}

% % use for commenting -- change initials to match yours
\usepackage{color}
\newcommand{\rwcomment}[1]{{\textcolor{blue}{\textsc{\textbf{[#1 --RW]}}}}}

% % document variables % %

% % your name
\newcommand{\Name}{SUMESH}

% % position name
\newcommand{\PositionName}{TITLE position in SUBFIELD}

% % institution name
\newcommand{\InstitutionName}{SCHOOL}

% % department name
\newcommand{\DepartmentName}{DEPTARTMENT}

% % department address
\newcommand{\DepartmentAddress}{ROOM BUILDING \\
    STREET ADDRESS \\
    CITY STATE ZIP}
0

There are 0 best solutions below