\nonstopmode
\documentclass[12pt]{article}
\usepackage{cancel}
\pagestyle{empty}
\begin{document}
$$
{\texttt  {next(head\$_{{train}}\$)}}
$$
\end{document}
