3

So I'm trying to do a bibliography for my report on overleaf using LaTeX, and most of my sources are website that have URLs. I keep getting " Missing $ inserted. " I have used any "$" signs, so I'm not sure why I keep getting this error. Any help would be much appreciated thank you This is how I coded my sources

misc{website:Stanford,
  author = {Stanford Center for Professional Development},
  title = {CS221 - Artificial Intelligence Principles and Techniques},
  month = {October},
  year = {2016},
  URL ={http://scpd.stanford.edu/search/publicCourseSearchDetails.do?method=load&courseId=11747},
}

@misc{website:CIPS2,
  author = {CIPS},
  title = {Computer Science Accredited Programs},
  month = {October},
  year = {2016},
  URL ={http://www.cips.ca/ComputerScience},
}
David Carlisle
  • 757,742

1 Answers1

1

Don't "escape" the special characters ($, _, $, etc) if they occur in URL strings, as escaping them will almost certainly render the URL strings unusable.

Instead, encase the URL strings in \url{...} macros (and load the url package). Better still, use a bibliography style that knows how to handle fields named URL -- plainnat, unsrtnat, and abbrvnat are three such styles -- and load the natbib package.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{website:Stanford,
  author = {Stanford Center for Professional Development},
  title = {CS221---{Artificial} Intelligence Principles and Techniques},
  month = {October},
  year = {2016},
  URL ={http://scpd.stanford.edu/search/publicCourseSearchDetails.do?method=load&courseId=11747},
}

@misc{website:CIPS2,
  author = {CIPS},
  title = {Computer Science Accredited Programs},
  month = {October},
  year = {2016},
  URL ={http://www.cips.ca/ComputerScience},
}
\end{filecontents}
\documentclass{article}
\usepackage[hyphens]{url} % for "\url" macro (used by natbib for "url" fields)
\usepackage[numbers]{natbib}
\bibliographystyle{plainnat}

\begin{document}
\nocite{*}
\raggedright
\bibliography{mybib}
\end{document}
Mico
  • 506,678