0

This seems ridiculous but I'm using LaTeX for the first time in a while and when I attempt to underline like so:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
...
\begin{document}
\maketitle
...
\subsection{}
\underline{ActorName} | Phone, Address, AgentName, Appears-In_Scene
\break
...
\end{document}

I get a math mode error:

! Missing $ inserted.
<inserted text> 
                $
l.15 ...me} Phone, Address, AgentName, Appears-In_
                                                  Scene

Any idea what is causing this and how to fix it? I am not opening a math statement anywhere. Also using BibTeX but I don't think that matters.

casr
  • 77
  • 6
  • In the future, please make sure your code is (besides the problem you are asking about) compilable. For example don't add `...` in the preamble which will cause and error and if you must have `\maketitle` in your code, you also give and `\title{...}` and `\author{...}` so we can concentrate on your actual question and don't have to fix all this unnecessary stuff before actually starting to work on your problem. – samcarter_is_at_topanswers.xyz Mar 14 '22 at 21:03

1 Answers1

0

I am not opening a math statement anywhere.

Well, that's the problem. You use a _ which is a command which must only be used in math mode to write underscores. If you want to write a _, you can use \textunderscore or escape the underscore with \_

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}


\title{text}
\author{names}

\begin{document}
\maketitle
...
\subsection{}
\underline{ActorName} | Phone, Address, AgentName, Appears-In\textunderscore Scene
\break
...
\end{document}