[Tex/LaTex] Reference problem: _ must be inside math mode

cross-referencingerrorsmath-mode

In the references, I need to mention to white paper which has a link on the web, but it complains about:

_ must be inside math mode

and here is the code:

\documentclass[runningheads,a4paper]{llncs}

    \usepackage{amssymb}
    \setcounter{tocdepth}{2}
    \usepackage{graphicx}
    \usepackage[latin1]{inputenc}
    \usepackage[english]{babel}

    \usepackage{float}
    \usepackage{booktabs}


    \usepackage{mathtools}

    \usepackage{amsmath}
    \usepackage[english]{babel}
    \usepackage{booktabs,array}
    \usepackage{lipsum}
    \usepackage{hhline}% http://ctan.org/pkg/hhline


    \setcounter{secnumdepth}{5}


    \begin{document}


\begin{thebibliography}{4}

\bibitem{jour} Kordy, B. Kordy, P. Mauw, S. Schweitzer, P: ADTool: Security Analysis with At-tack-Defense Trees (Extended Version), white paper, Accessed on: 19 Aguste 2016 on: https://www.researchgate.net/publication/236955204_ADTool_Security_Analysis_with_Attack-Defense_Trees_Extended_Version

\bibitem{jour}Kordy B, Mauw S, Melissen M, Schweitzer P. Attack–Defense Trees and Two-Player Binary Zero-Sum Extensive Form Games Are Equivalent. In: Alpcan T, Buttyán L, Baras JS, editors. Decision and Game Theory for Security: First International Conference, GameSec 2010, Berlin, Germany, November 22-23, 2010 Proceedings. Berlin, Heidelberg: Springer Berlin Heidelberg; 2010. p. 245-56

\end{thebibliography}



    \end{document}

How can I fix the error?

Best Answer

_ is used in math mode for subscripts. The character _ can be set by \_ or \textunderscore.

The example contains _ inside a URL. The latter can be set by package url, e.g.:

\documentclass[runningheads,a4paper]{llncs}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}% better hyphenation

\usepackage{url}

\begin{document}
\begin{thebibliography}{4}

\bibitem{jour1} Kordy, B.  Kordy, P.  Mauw, S.  Schweitzer, P: ADTool:
Security Analysis with Attack-Defense Trees (Extended Version), white
paper, accessed on: August 19, 2016 on:
\url{https://www.researchgate.net/publication/236955204_ADTool_Security_Analysis_with_Attack-Defense_Trees_Extended_Version}

\bibitem{jour2}Kordy B, Mauw S, Melissen M, Schweitzer P.  Attack–Defense
Trees and Two-Player Binary Zero-Sum Extensive Form Games Are Equivalent.
In: Alpcan T, Buttyán L, Baras JS, editors.  Decision and Game Theory for
Security: First International Conference, GameSec 2010, Berlin, Germany,
November 22--23, 2010 Proceedings.  Berlin, Heidelberg: Springer Berlin
Heidelberg; 2010.  Pages 245--56.

\end{thebibliography}
\end{document}

Result

If you do not want to have the font switch for the URL, then \urlstyle{same} helps:

\usepackage{url}
\urlstyle{same}

Result with \urlstyle{same}

Also, I would recommend biblatex or natbib for setting the bibliography. The bibliography entries should be revisited, they contain lots of small errors. I have tried to fix some of them.