0
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[natbibapa]{apacite}

\title{For testing}

\begin{document}

Information about natbib in \citeauthor{sharelatex}.

\bibliographystyle{apacite}
\bibliography{bibli.bib}

\end{document}

This gives the error "Missing $ inserted". What has mathmode to do with apacite or citeauthor?

  • 7
    Check if there aren't any $ in your bibli.bib file. – Phelype Oleinik Feb 22 '18 at 16:01
  • Welcome to TeX.Stackexchange! Can you share your .bib file? – user36296 Feb 22 '18 at 16:13
  • 2
    Further to @PhelypeOleinik 's comment, anything that could cause TeX to enter mathmode in a .bib entry (e.g., underscores) could cause this. But without looking at the specify .bib entry, it's hard to tell. – Alan Munn Feb 22 '18 at 16:19
  • @samcarter This is the only content in my bib file: @misc{sharelatex, title={ShareLaTeX, the Online LaTeX Editor}, url={nl.sharelatex.com/learn/Natbib_citation_styles}, journal={ShareLaTeX, Online LaTeX-verwerker}} – Simsa Feb 23 '18 at 7:56
  • @AlanMunn See my answer above. BTW, Is it possible to reply to multiple anwers :) ? – Simsa Feb 23 '18 at 8:09
3

The problem is the _ in the url, which can normally only be used in math mode. In order to use them in a url, either use the url or the hyperref package.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[natbibapa]{apacite}

\usepackage{url}


\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{sharelatex, 
    title={ShareLaTeX, the Online LaTeX Editor},
    url={nl.sharelatex.com/learn/Natbib_citation_styles},
    journal={ShareLaTeX, Online LaTeX-verwerker}
} 
\end{filecontents*}


\title{For testing}

\begin{document}

Information about natbib in \citeauthor{sharelatex}.

\bibliographystyle{apacite}
\bibliography{\jobname}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.