# Latex \cite produces question mark?

I have a couple of problems with my Latex. I am trying to reference from a .bib file. The \cite command just produces a (?).

I tried the latex, bibtex, latex, latex sequence but that didn't help me. If I try \cite{pascal} I just get (?) but if I try \nocite{*} then it doesn*t make the (?) but just prints my .bib file in a random order.

\documentclass[a4paper, 11pt]{report}
\usepackage[top=15mm, bottom=15mm, left=35mm, right=20mm]{geometry}
\usepackage{hyperref}

\makeatletter
\def\@biblabel#1{}
\makeatother

\renewcommand\bibname{References}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\hypersetup{
citecolor = blue,
anchorcolor = blue,
urlcolor=blue,
}

\begin{document}

\section{Introduction}
The philosophy behind \textbf{\textit{Web 3.0}} (commonly known as \textbf{\textit{"Semantic Web"}}) and its main premise is to make the Web more accessible to computers so that data can be accessed, shared and analysed, so that computers can then search, combine and process the data intelligently
\linebreak (Hitzler,~et~al.~2010,~p.~11). \cite{pascal}
\\[5mm]
To achieve this philosophy, Web Ontology Language, OWL \footnote[1]{ \url{http://www.w3.org/TR/owl2-overview/}} have been developed as a standard format for the sharing and integration of data and knowledge.
\\[5mm]

\bibliographystyle{plain}

\nocite{*}

\bibliography{cm1201_1515140}

\end{document}


And here is my .bib file.

@book{pascal,
author    = "P. Hitzler\text{,} et al. (2010)",
title     = "Foundations of Semantic Web Technologies",
publisher = "Chapman \& Hall/CRC",
}

@incollection{franz,
author      = "F. Baader\text{,} et al. (2008)",
title       = "'{D}escription {L}ogics'",
booktitle   = "\emph{F. van Harmelen, V. Lifschitz, \& B. Porter (eds.),} Handbook of Knowledge Representation",
note        = "chap. 3, pp. 135-180. Elsevier.",
}

@misc{w3c,
author    = "W3C OWL Working Group (2009)",
title     = "'{OWL} 2 {W}eb {O}ntology {L}anguage - {D}ocument {O}verview ({W}orking {D}raft 27 {M}arch 2009)'",
howpublished       = "\url{http://www.w3.org/TR/owl2-overview/}",
}


Here are some picture to show what i get exactly.

On the picture below i get the right one but I need to make it to the left one. I tried bibel and other packages. Some say \citename is already define for example or other errors I don't know how to fix.

• why have you \def\@biblabel#1{} ? also never end a paragraph with \\  you shouldn't get ? if you run latex bibtex latex latex. – David Carlisle Nov 23 '15 at 23:28
• running pdflatex bibtex pdflatex on your posted source produces the error ! Undefined control sequence. l.10 F.~Baader\text – David Carlisle Nov 23 '15 at 23:30
• \text does not belong there and bibtex complains/has warnings about empty year-field in pascal – user31729 Nov 23 '15 at 23:31
• If i dont have the \text it prints the (et al.) first and then the name. Also if i put the year it prints it after everything and not near the name. I use \def\@biblable#1{} to remove the label infront of the references. – BlazeAxtrius Nov 23 '15 at 23:35
• it would print the names correctly if you entered all the names separated by and, if you go zzz, et al it takes et al as the first name and zzz as the surname like carlisle, david. You need to specify the order the references, but since you only have one \cite order of citation can't work well, since you have not entered the date fields, chronological order can not work, and since the names are not entered in standard form, alphabetic ordering can not work. but none of that is related to the question in your title which is about ? in the citation (for which the answer is latex twice) – David Carlisle Nov 23 '15 at 23:47

First, you should put your .bib file in the standard form. Google Scholar can help you in this regard. So, here is my .bib which I used (you may add or remove information, but keep it in standard form):

@book{van2008handbook,
title={Handbook of knowledge representation},
author={Van Harmelen, Frank and Lifschitz, Vladimir and Porter, Bruce},
volume={1},
year={2008},
publisher={Elsevier}
}

@book{pascal,
title={Foundations of semantic web technologies},
author={Hitzler, Pascal and Krotzsch, Markus and Rudolph, Sebastian},
year={2009},
publisher={CRC Press}
}

@article{world2012owl,
title={OWL 2 web ontology language document overview},
author={World Wide Web Consortium and others},
year={2012},
publisher={Word Wide Web Consortium}
}


Second, to have the references ordered in the same order as they appear in your text file, you should use the \bibliographystyle{unsrt} command. If you need it sorted chronologically, just use the \bibliographystyle{plain} command.

Here is the complete document:

\documentclass[a4paper, 11pt]{report}
\usepackage[top=15mm, bottom=15mm, left=35mm, right=20mm]{geometry}
\usepackage{hyperref}

\makeatletter
\def\@biblabel#1{}
\makeatother

\renewcommand\bibname{References}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\hypersetup{
citecolor = blue,
anchorcolor = blue,
urlcolor=blue,
}

\begin{document}

\section{Introduction}
The philosophy behind \textbf{\textit{Web 3.0}} (commonly known as \textbf{\textit{Semantic Web"}}) and its main premise is to make the Web more accessible to computers so that data can be accessed, shared and analysed, so that computers can then search, combine and process the data intelligently
\linebreak (Hitzler,~et~al.~2010,~p.~11). Cite \cite{van2008handbook} then \cite{pascal} then \cite{world2012owl}

\bigskip

To achieve this philosophy, Web Ontology Language, OWL \footnote[1]{ \url{http://www.w3.org/TR/owl2-overview/}} have been developed as a standard format for the sharing and integration of data and knowledge.

\bibliographystyle{unsrt}
\bibliography{cm1201_1515140}

\end{document}


and the required output:

Also, the order they appear in text:

Take into consideration the notes given by others above about not using \\[5mm], etc, besides using the correct quotations as Semantic Web". Finally, running the pdflatex-->bibtex-->pdflatex-->pdflatex sequence should be O.K. with all references.

• I don't really understand why for me the '\cite' doesn't work. I still get these (?). I copied your code and tried with pdflatex->bibtex->pdflatex->pdflatex and only latex->bibtex->latex->latex. Still does the same thing. I don't understand what the problem it. – BlazeAxtrius Nov 24 '15 at 0:34
• @BlazeAxtrius If you copy the code from this into a new .tex file and the entries from this answer into a new .bib file in the same directory and then you run pdflatex -> bibtex -> pdflatex -> pdflatex, does it work? Note that the question asks you to test exactly the code posted, even if that does not solve your problem by itself. This checks that your TeX installation is working correctly so that we can eliminate one source of potential problems. – cfr Nov 24 '15 at 0:49
• By the way, " are acceptable for the values of fields in .bib entries, as far as I know. You don't have to use curly brackets. (I always do and always have, but I am not aware of them being any more 'proper'.) The other issues are the real problems. – cfr Nov 24 '15 at 0:51
• I copied it in a different file and it works. But if i copy it in my original file and try to run it there well it still shows (?). Also instead of "Cite [1] then [2] then [3]. I need to get "(Hitzler, et al. 2010, p. 11)" as a reference from the .bib file – BlazeAxtrius Nov 24 '15 at 1:05
• I removed some of my packages that I had in my file and it works now. It still shows [1], [2] and [3] but at least it isn't (?). – BlazeAxtrius Nov 24 '15 at 1:14