I have been trying to reference an image URL using BibTex. Please find below minimum working example(MWE).
I have the following entry in my main.tex file:
\documentclass{report}
\usepackage{url}
\begin{document}
\nocite{*}
\input{background}
\bibliographystyle{abbrv}
\bibliography{main}
\end{document}
Following is the separate background.tex file. I have cited the image url as shown below:
% !TEX root = main.tex
\chapter{Background}
\label{chap:backround}
About clusters in Apache Spark:
\begin{figure}[h]
\includegraphics[width=0.7\textwidth]{cluster_overview}
\centering
\caption{Spark stack (\cite{clustermodeoverview})}
\end{figure}
Below is a snippet of main.bib file:
@article{afrati2001generating,
title={Generating efficient plans for queries using views},
author={Afrati, Foto N and Li, Chen and Ullman, Jeffrey D},
journal={ACM SIGMOD Record},
volume={30},
number={2},
pages={319--330},
year={2001},
publisher={ACM New York, NY, USA}
}
@inproceedings{herodotou2011query,
title={Query optimization techniques for partitioned tables},
author={Herodotou, Herodotos and Borisov, Nedyalko and Babu, Shivnath},
booktitle={Proceedings of the 2011 ACM SIGMOD International Conference on Management of data},
pages={49--60},
year={2011}
}
@misc{clustermodeoverview,
author = {Spark 2.4.5 documentation},
title = {Cluster mode overview},
year = {2019},
url = {https://spark.apache.org/docs/latest/img/cluster-overview.png}
}
I always get a warning "Citation 'clustermodeoverview' on page 5 undefined". There are no errors on compilation. Also, I observed that there is no entry for URL citation in my "Bibliography" page. All other citations of research papers are showing up properly.
I have included url package in main.tex. I have tried to search for the reason of this warning but could not fix it. Can anyone please help me with it?
\protectbefore\cite{}. – May 22 '20 at 00:03.bbland recompile? – algae May 22 '20 at 03:56\captions can be tricky, but if things there go wrong, they usually go wrong in a way that causes a real error message, not justCitation 'clustermodeoverview' on page 5 undefined. Are there any other errors or warnings in your.logfile? Did you run LaTeX, LaTeX, BibTeX, LaTeX, LaTeX on your document after you added the citation? Unfortunately, it is hard to give any further advice, because so far the question only contains code snippets and not a full example document. The snippets leave to much room for guessing. We need an MWE: https://tex.meta.stackexchange.com/q/228/ – moewe May 22 '20 at 06:45urlfield, which could explain why the URL is not shown in the bibliography at the end. We can only say if that is the problem, though, if you tell us what bibliography style you are using (this is best done in an MWE, see my comment above). – moewe May 22 '20 at 06:47\includegraphicsbecause the example doesn't loadgraphicx. – moewe May 22 '20 at 08:34\usepackage{graphicx}I get a citation in the caption and no warning about undefined citations. As suspected you are using one of the standard BibTeX styles, which can not deal with URLs in theurlfield. You can either switch to a more modern style (for exampleabbrvnatwith\usepackage{natbib}) or put the URL into thehowpublishedfield. – moewe May 22 '20 at 08:36author = {Spark 2.4.5 documentation},looks very odd. If you write stuff into theauthorfield that is not a person's name, you need to protect it with bracesauthor = {{Spark 2.4.5 documentation}},. ButSpark 2.4.5 documentationdoesn't appear to be an author anyway. (Cf. https://tex.stackexchange.com/q/10808/35864) – moewe May 22 '20 at 08:40.bibentry as suggested. Now it displays the correct references. But in the Bibliography page it doesn't display the URL. Do you know why this could happen? – A Beginner May 22 '20 at 09:07abbrvdates back to the eighties, when URLs weren't a big thing yet.abbrvsimply does not support aurlfield. You could use the standard workaroundhowpublished = {\url{https://spark.apache.org/docs/latest/img/cluster-overview.png}},or use a different style that supports theurlfield. (There are many such styles, for exampleurlbst'sabbrvurl, but I would probably start looking atnatbib: load\usepackage{natbib}and use\bibliographystyle{abbrvnat}.) – moewe May 22 '20 at 09:10