缺少用 apacite 插入的 $?

缺少用 apacite 插入的 $?
\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}

這會出現錯誤「缺少 $ 插入」。 mathmode 與 apacite 或 citeauthor 有什麼關係?

答案1

問題在於_url 中的 ,通常只能在數學模式下使用。為了在 url 中使用它們,請使用urlhyperref套件。

\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}

相關內容