0

I am writing a document in text mode and I wish to refer to a variable in some separate software file. But when I try to typeset the document Latex seems to think that the name of the variable is in math mode.

If I write

\documentclass[11pt]{amsart}
\begin{document}

The name of the proposed variable is log_acceptance.

\end{document}

I get the following message on the console:

./mre.tex:5: Missing $ inserted.
<inserted text> 
                $
l.5 The name of the proposed variable is log_acceptance.

If I change my text to

\documentclass[11pt]{amsart}
\begin{document}

The name of the proposed variable is log.

\end{document}

then that is typeset correctly as text.

How can I tell Latex to stop thinking that log_acceptance is math?

JeremyC
  • 347
  • It does! Many thanks. The specific solution from amongst the many discussed there is to use {_}. That does the job for me. – JeremyC May 02 '22 at 14:50
  • (you probably mean {\_}.) I totally don't understand why people use that instead of just \_. What's the difference!? – user202729 May 02 '22 at 14:51
  • Underline is to insert subscript in math mode, for example, x_1. – Sigur May 02 '22 at 15:47
  • If you are using OpTeX (instead LaTeX) then you can simply write: The name of the proposed variable is log_acceptance. \bye. No problem. – wipet May 02 '22 at 18:00

0 Answers0